/* =========================================================
   JIEDEEDU - VIBRANT EDUCATIONAL THEME
   Main Stylesheet
   ========================================================= */

:root {
  /* Radiant Educational Color Palette */
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-coral: #ff6b35;
  --primary-light: #fff7ed;
  --primary-tint: #ffedd5;
  --primary-border: #fed7aa;
  
  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #f0f9ff;
  --secondary-border: #bae6fd;
  
  --sunny-amber: #f59e0b;
  --sunny-gold: #fbbf24;
  --sunny-light: #fef3c7;
  
  --mint-emerald: #10b981;
  --mint-dark: #059669;
  --mint-light: #ecfdf5;
  --mint-border: #a7f3d0;
  
  --berry-purple: #8b5cf6;
  --berry-light: #f5f3ff;
  --berry-border: #ddd6fe;

  --bg-page: #fffdfa;
  --bg-page-alt: #fffaf3;
  --bg-surface: #ffffff;
  --bg-warm: #fef3e7;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-warm: #9a3412;
  
  --border-subtle: #f1f5f9;
  --border-card: #ffedd5;
  --border-focus: #f97316;

  --shadow-sm: 0 4px 12px rgba(249, 115, 22, 0.05);
  --shadow-md: 0 10px 28px rgba(249, 115, 22, 0.09);
  --shadow-lg: 0 18px 45px rgba(249, 115, 22, 0.14);
  
  /* Prefer the requested system 楷体 fonts across the whole site. */
  --font-kaiti: "KaiTi_GB2312", "KaiTi", "楷体", "STKaiti", "Kaiti SC", "BiauKai", serif;
  --font-site: "KaiTi_GB2312", "KaiTi", "楷体", "STKaiti", "Kaiti SC", "BiauKai", serif;
}

/* =========================================================
   AUTHENTIC 楷体 (KAITI) CHINESE TEXT & WRITING STROKE STYLES
   Ensures all Chinese text output renders inside HTML blocks
   styled with 楷体, especially for character stroke writing.
   ========================================================= */

.chinese-kaiti,
.chinese-kaiti-block,
.kaiti-block,
.kaiti-text,
[lang="zh"],
.char-giant-display,
.canvas-ghost-character,
.fallback-ghost-char,
.writing-char-chip,
.try-another-char-box,
.practice-inner-watermark,
.stroke-steps-text,
.stroke-rule-explanation,
.stroke-rule-card-title,
.stroke-rule-card-example,
.stroke-rule-card-example strong,
.stroke-rule-badge-pill,
.hero-character,
.hero-pinyin-cn,
.reading-item .chinese-sentence,
.chinese-sentence,
.vocabulary-character,
.card-character,
.card-character-sub,
.sub-line-cn,
.workspace-chinese-text,
.dialogue-chinese,
.continue-chinese-title,
.lesson-cover-character,
.lesson-chinese-title,
.tone-character,
.conversation-chinese,
.reel-card-chinese,
.category-icon-bg,
.story-hero h1,
.story-image-content h3 {
  font-family: var(--font-kaiti) !important;
}

/* Specific enhancements for Writing & Stroke Order sections */
.writing-character-hero-card .char-giant-display {
  font-family: var(--font-kaiti) !important;
  font-weight: 700;
  letter-spacing: normal;
}

.canvas-mizige-box .canvas-ghost-character,
.canvas-mizige-box .fallback-ghost-char {
  font-family: var(--font-kaiti) !important;
  font-weight: 700;
}

.stroke-steps-text {
  font-family: var(--font-kaiti) !important;
  font-size: 1.05rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.stroke-rule-card-example strong {
  font-family: var(--font-kaiti) !important;
  font-size: 1.15rem;
  font-weight: 700;
}

.writing-char-chip {
  font-family: var(--font-kaiti) !important;
}

.practice-inner-watermark {
  font-family: var(--font-kaiti) !important;
}

.try-another-char-box {
  font-family: var(--font-kaiti) !important;
}

/* =========================================================
   RESET
========================================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-site);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   GLOBAL
========================================================= */

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: 90px 0;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px 16px;
  border-radius: 9999px;
  background: #fff7ed;
  color: #ea580c;
  border: 1.5px solid #fed7aa;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
}

.section-heading h2 {
  margin-bottom: 14px;
  color: #0f172a;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 800;
  line-height: 1.15;
}

.section-heading p {
  color: #475569;
  font-size: 1.08rem;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 0.96rem;
  font-weight: 700;
  border: none;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #ff7849 0%, #f97316 55%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff8559 0%, #f97316 45%, #c2410c 100%);
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.42);
}

.btn-secondary {
  background: #ffffff;
  color: #c2410c;
  border: 1.5px solid #fed7aa;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.08);
}

.btn-secondary:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.16);
}


/* =========================================================
   HEADER / NAVIGATION
========================================================= */

#sharedHeader {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1.5px solid #ffedd5;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.04);
  transition: box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled,
#sharedHeader.is-scrolled .site-header {
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.12), 0 2px 8px rgba(15, 23, 42, 0.08);
  border-bottom-color: #fed7aa;
}

[data-theme="dark"] .site-header.is-scrolled,
[data-theme="dark"] #sharedHeader.is-scrolled .site-header {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);
  border-bottom-color: #475569;
}

.nav-container {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo.has-custom-logo {
  gap: 0;
  padding: 2px 4px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.site-brand-logo-img {
  display: block;
  height: 38px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  border-radius: 8px;
}

.logo-chinese {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff7849 0%, #f97316 100%);
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  flex-shrink: 0;
}

.logo-text {
  color: #0f172a;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Primary Desktop Navigation Links (Clean Single Line) */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0;
}

.desktop-nav .nav-link {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  white-space: nowrap !important;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link:focus-visible {
  color: #ea580c;
  background: #fff7ed;
  transform: translateY(-1px);
}

.desktop-nav .nav-link.active,
.desktop-nav .nav-link[aria-current="page"] {
  color: #ea580c;
  font-weight: 800;
  background: #fff7ed;
  box-shadow: inset 0 0 0 1.5px #fed7aa;
}

.desktop-nav .nav-link.active::after,
.desktop-nav .nav-link[aria-current="page"]::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ea580c;
  box-shadow: 0 0 6px rgba(234, 88, 12, 0.7);
  margin-left: 2px;
  flex-shrink: 0;
  animation: navDotPulse 2s ease-in-out infinite;
}

/* Additional navigation items in header bar:
   Style .nav-item-additional to be 'display: none' when moved to the hide menu
   (e.g., on smaller laptop screens 769px to 1024px, on mobile, or when marked) */
.nav-item-additional {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1024px) {
  .desktop-nav .nav-item-additional,
  .nav-item-additional {
    display: none !important;
  }

  .nav-container {
    gap: 12px;
  }

  .desktop-nav {
    gap: 6px;
  }

  .desktop-nav .nav-link {
    padding: 8px 12px;
    font-size: 0.92rem;
  }
}

.nav-item-additional.is-hidden,
.nav-item-additional.moved-to-hide-menu,
.nav-item-additional[data-moved="true"] {
  display: none !important;
}

/* Mobile viewport: hide entire desktop nav bar */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  position: relative;
}

/* Daily Streak Counter Badge (Strictly Single-Line Display) */
.streak-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #fffaf5 0%, #fff7ed 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
  outline: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.streak-badge:hover,
.streak-badge:focus-visible {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.18);
}

.streak-badge.is-active {
  background: linear-gradient(135deg, #ffedd5 0%, #fef3c7 100%);
  border-color: #f97316;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.22);
}

.streak-flame {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.streak-badge.is-active .streak-flame {
  animation: streakFlamePulse 1.8s ease-in-out infinite;
}

@keyframes streakFlamePulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  30% {
    transform: scale(1.22) rotate(-5deg);
  }
  60% {
    transform: scale(1.15) rotate(5deg);
  }
}

.streak-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}

.streak-count {
  font-size: 0.98rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.streak-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 480px) {
  .streak-label {
    display: none;
  }
}

.streak-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  max-width: 280px;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1005;
}

.streak-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
}

.streak-tooltip strong {
  display: block;
  font-size: 0.92rem;
  color: #fdba74;
  margin-bottom: 4px;
}

.streak-tooltip p {
  margin: 0;
  color: #cbd5e1;
}

.streak-badge:hover .streak-tooltip,
.streak-badge:focus-visible .streak-tooltip,
.streak-badge.show-tooltip .streak-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   USER LEVEL & RANK BADGE (Header)
========================================================= */

.level-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
  outline: none;
}

.level-badge:hover,
.level-badge:focus-visible {
  background: #ecfdf5;
  border-color: #10b981;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18);
}

.level-badge.rank-novice {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.level-badge.rank-scholar {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.level-badge.rank-scholar:hover,
.level-badge.rank-scholar:focus-visible {
  background: #e0e7ff;
  border-color: #6366f1;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.2);
}

.level-badge.rank-master {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.level-badge.rank-master:hover,
.level-badge.rank-master:focus-visible {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.level-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.level-badge:hover .level-icon {
  transform: scale(1.18);
}

.level-text-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.level-rank {
  font-size: 0.98rem;
  font-weight: 900;
  color: #065f46;
  line-height: 1;
  letter-spacing: -0.01em;
}

.level-badge.rank-scholar .level-rank {
  color: #3730a3;
}

.level-badge.rank-master .level-rank {
  color: #92400e;
}

.level-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #047857;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.level-badge.rank-scholar .level-label {
  color: #4338ca;
}

.level-badge.rank-master .level-label {
  color: #b45309;
}

/* Level Tooltip */
.level-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 250px;
  max-width: 300px;
  background: #0f172a;
  color: #f8fafc;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1005;
}

.level-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 24px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #0f172a transparent;
}

.level-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.level-tooltip-header strong {
  font-size: 0.94rem;
  color: #34d399;
}

.level-badge.rank-scholar .level-tooltip-header strong {
  color: #818cf8;
}

.level-badge.rank-master .level-tooltip-header strong {
  color: #fbbf24;
}

.level-tooltip-chinese {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

.level-tooltip p {
  margin: 0 0 10px 0;
  color: #cbd5e1;
}

.level-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.level-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.level-badge.rank-scholar .level-progress-bar {
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
}

.level-badge.rank-master .level-progress-bar {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.level-progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}

.level-badge:hover .level-tooltip,
.level-badge:focus-visible .level-tooltip,
.level-badge.show-tooltip .level-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   HIDE MENU (Flyout Drawer / Tools Dropdown)
========================================================= */

.menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
  outline: none;
  flex-shrink: 0;
  user-select: none;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.18);
}

.menu-toggle[aria-expanded="true"] {
  background: #ffedd5;
  border-color: #ea580c;
  color: #ea580c;
}

.menu-toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.menu-toggle-label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  color: inherit;
}

.main-nav {
  position: absolute;
  top: calc(100% + 10px);
  right: max(20px, calc((100vw - 1120px) / 2 + 20px));
  width: 320px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid #fed7aa;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 20px 48px rgba(249, 115, 22, 0.16), 0 4px 16px rgba(15, 23, 42, 0.08);
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 1002;
  transform-origin: top right;
  animation: hideMenuFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hideMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes navDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-nav .nav-link.active::after,
  .desktop-nav .nav-link[aria-current="page"]::after,
  .hide-menu-link.active::after,
  .hide-menu-link[aria-current="page"]::after {
    animation: none !important;
  }
}

.main-nav.active,
.main-nav.is-open,
.main-nav.open,
.main-nav[aria-hidden="false"] {
  display: flex !important;
}

.hide-menu-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #ffedd5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hide-menu-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hide-menu-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.hide-menu-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  line-height: 1;
}

.hide-menu-close-btn:hover {
  color: #ea580c;
  background: #fff7ed;
}

.hide-menu-subtitle {
  font-size: 0.78rem;
  color: #64748b;
}

.hide-menu-nav-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hide-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.18s ease;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
}

.hide-menu-link-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hide-menu-link:hover {
  background: #fff7ed;
  color: #ea580c;
  transform: translateX(3px);
}

.hide-menu-link.active,
.hide-menu-link[aria-current="page"] {
  background: #fff7ed;
  color: #ea580c;
  font-weight: 800;
  box-shadow: inset 3.5px 0 0 #ea580c;
  padding-left: 14px;
}

.hide-menu-link.active::after,
.hide-menu-link[aria-current="page"]::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ea580c;
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.75);
  margin-left: auto;
  margin-right: 2px;
  flex-shrink: 0;
  animation: navDotPulse 2s ease-in-out infinite;
}

.hide-menu-link.active .menu-link-icon {
  transform: scale(1.1);
}

.menu-link-icon {
  font-size: 1.15rem;
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hide-menu-review-link {
  background: #fff1f2;
  color: #e11d48;
  border: 1.5px solid #fecdd3;
  margin-top: 2px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.hide-menu-review-link:hover {
  background: #ffe4e6;
  color: #be123c;
}

.hide-menu-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  line-height: 1;
  white-space: nowrap;
}

.hide-menu-tag-review {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fecdd3;
}

.hide-menu-divider {
  height: 1px;
  background: #fed7aa;
  margin: 2px 0;
}

.hide-menu-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.hide-menu-section-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a3412;
  margin-top: 2px;
}

.hide-menu-streak-card {
  flex-shrink: 0 !important;
  min-width: 220px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  background: linear-gradient(135deg, #fffaf5 0%, #fff7ed 100%) !important;
  border: 1.5px solid #fed7aa !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08) !important;
  cursor: pointer;
  outline: none;
  white-space: normal !important;
  overflow: hidden !important;
  text-align: left;
}

.hide-menu-level-card {
  flex-shrink: 0 !important;
  min-width: 220px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
  border: 1.5px solid #a7f3d0 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08) !important;
  cursor: pointer;
  outline: none;
  white-space: normal !important;
  overflow: hidden !important;
  text-align: left;
}

.hide-menu-card-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;
  line-height: 1.25 !important;
  min-width: 0 !important;
  flex: 1 !important;
  white-space: normal !important;
  overflow: hidden !important;
}

.hide-menu-card-body .streak-text-wrap,
.hide-menu-card-body .level-text-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  gap: 6px !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.hide-menu-card-body .streak-count {
  font-size: 1.12rem !important;
  font-weight: 900 !important;
  color: #ea580c !important;
  line-height: 1 !important;
}

.hide-menu-card-body .streak-label {
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  color: #9a3412 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.hide-menu-card-sub {
  font-size: 0.74rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Prevent tooltip popups inside drawer from overflowing the box */
.hide-menu-streak-card .streak-tooltip,
.hide-menu-level-card .level-tooltip {
  display: none !important;
}

.hide-menu-reminder-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fffaf5;
  border: 1.5px solid #fed7aa;
}

.hide-menu-reminder-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.hide-menu-reminder-title {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 700;
}

.hide-menu-reminder-sub {
  font-size: 0.75rem;
  color: #64748b;
}


/* =========================================================
   HERO - BRIGHT & SUNLIT
========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 95px;
  background:
    radial-gradient(circle at 85% 15%, rgba(254, 215, 170, 0.45) 0%, transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(186, 230, 253, 0.45) 0%, transparent 50%),
    linear-gradient(180deg, #fffaf5 0%, #fff5eb 60%, #fffdfa 100%);
  border-bottom: 1.5px solid #ffedd5;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.hero-text h1 {
  max-width: 680px;
  margin-bottom: 22px;
  color: #0f172a;
  font-size: clamp(3rem, 6.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.hero-text h1 span {
  display: block;
  color: #ea580c;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text > p {
  max-width: 600px;
  margin-bottom: 32px;
  color: #475569;
  font-size: 1.15rem;
  line-height: 1.65;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 32px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 50% 12%, rgba(254, 215, 170, 0.45) 0%, transparent 65%),
    linear-gradient(145deg, #ffffff 0%, #fff7ed 60%, #ffedd5 100%);
  border: 2px solid #fed7aa;
  box-shadow:
    0 25px 65px rgba(249, 115, 22, 0.16),
    0 4px 16px rgba(249, 115, 22, 0.06);
  text-align: center;
}

/* Subtle decorative background elements for hero card */
.hero-card-decoration {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 1;
}

.hero-deco-radical-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #c2410c;
  background: rgba(255, 237, 213, 0.9);
  border: 1px dashed #fdba74;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.hero-deco-dot {
  opacity: 0.5;
}

.hero-deco-contour {
  width: 100%;
  max-width: 220px;
  height: 20px;
  color: #ea580c;
  opacity: 0.35;
}

.hero-character {
  position: relative;
  z-index: 2;
  color: #ea580c;
  font-family: var(--font-kaiti);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 10px 30px rgba(249, 115, 22, 0.25);
}

.hero-pinyin {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  color: #b45309;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.5;
  min-height: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-translation {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  color: #64748b;
  font-size: 1.05rem;
  font-weight: 600;
}

.hero-tone-preview {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a3412;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.08);
}

.hero-tone-preview .tone-tag {
  color: #ea580c;
}

.hero-tone-preview .tone-sandhi-hint {
  color: #78350f;
  font-size: 0.74rem;
  opacity: 0.85;
}





/* =========================================================
   PRONUNCIATION & COLORFUL TONES
========================================================= */

.tone-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tone-button {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tone-button:hover {
  transform: translateY(-2px);
  border-color: #f97316;
  color: #ea580c;
  background: #fff7ed;
}

/* Standard pedagogical tone colors for clear learning */
.tone-button[data-tone="1"], .tone-button:nth-child(1) {
  border-color: #bae6fd;
  color: #0369a1;
  background: #f0f9ff;
}
.tone-button[data-tone="1"].active, .tone-button:nth-child(1).active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.tone-button[data-tone="2"], .tone-button:nth-child(2) {
  border-color: #a7f3d0;
  color: #047857;
  background: #ecfdf5;
}
.tone-button[data-tone="2"].active, .tone-button:nth-child(2).active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.tone-button[data-tone="3"], .tone-button:nth-child(3) {
  border-color: #fde68a;
  color: #b45309;
  background: #fffbeb;
}
.tone-button[data-tone="3"].active, .tone-button:nth-child(3).active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}

.tone-button[data-tone="4"], .tone-button:nth-child(4) {
  border-color: #fed7aa;
  color: #c2410c;
  background: #fff7ed;
}
.tone-button[data-tone="4"].active, .tone-button:nth-child(4).active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}

.tone-button[data-tone="5"], .tone-button:nth-child(5) {
  border-color: #ddd6fe;
  color: #6d28d9;
  background: #f5f3ff;
}
.tone-button[data-tone="5"].active, .tone-button:nth-child(5).active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.tone-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: #fffaf5;
  border: 1.5px solid #fed7aa;
  border-radius: 18px;
}

.tone-main,
.tone-word-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Pinyin & Character Alignment (height: 1.5 or higher for tone diacritics) */
.pinyin-large,
.hero-character-pinyin,
.hero-pinyin,
#toneSyllable,
.tone-syllable {
  color: #0f172a;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.5;
  min-height: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tone-character-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.tone-character {
  color: #ea580c;
  font-family: var(--font-kaiti);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
}

.tone-translation {
  color: #c2410c;
  font-size: 1.1rem;
  font-weight: 700;
  background: #ffedd5;
  border: 1.5px solid #fed7aa;
  padding: 4px 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.08);
}


/* =========================================================
   VIBRANT AUDIO BUTTONS
========================================================= */

.audio-button,
.conversation-audio-button {
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.audio-button:hover,
.conversation-audio-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.38);
}

.audio-button:disabled,
.conversation-audio-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.audio-button.playing,
.conversation-audio-button.playing {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45);
  animation: audioPulse 1.4s ease-in-out infinite alternate;
}

@keyframes audioPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  }
  100% {
    transform: scale(1.03);
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.6);
  }
}

.tone-audio-fallback {
  margin: 12px 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.tone-audio-notice {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0369a1;
}

.tone-audio-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #b91c1c;
}

.tone-graph {
  margin-bottom: 16px;
  color: #f97316;
}

.tone-description {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 500;
}


/* =========================================================
   CONVERSATION
========================================================= */

.conversation-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 100%;
}

.conversation-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px 24px;
  margin-bottom: 26px;
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(5, 150, 105, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.conversation-line:last-child {
  margin-bottom: 0;
}

.conversation-line:hover {
  border-color: #34d399;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12);
}

.conversation-chinese-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.conversation-chinese {
  color: #0f172a;
  font-family: var(--font-kaiti);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
}

.conversation-audio-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.85rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.conversation-pinyin {
  color: #059669;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  margin-bottom: 4px;
}

.conversation-english {
  color: #475569;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}


/* =========================================================
   QUICK CHECK
========================================================= */

.quiz-block {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1.5px solid #fed7aa;
}

.quiz-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.quiz-question {
  margin-bottom: 16px;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-option {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  border-color: #f97316;
  background: #fff7ed;
  color: #ea580c;
  transform: translateY(-1px);
}

.quiz-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.quiz-option.incorrect {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}

.quiz-feedback {
  min-height: 24px;
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.quiz-feedback.correct {
  color: #059669;
}

.quiz-feedback.incorrect {
  color: #dc2626;
}


/* =========================================================
   LEARNING HUB & SEARCH BAR
========================================================= */

.learning-section {
  background: linear-gradient(180deg, #fffaf5 0%, #fef3e7 60%, #fffdfa 100%);
  border-top: 1.5px solid #ffedd5;
  border-bottom: 1.5px solid #ffedd5;
}

.learning-search-box {
  max-width: 820px;
  margin: 0 auto 38px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar-inner:focus-within {
  border-color: #f97316;
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.18), 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.search-icon {
  display: grid;
  place-items: center;
  padding-left: 20px;
  padding-right: 8px;
  color: #f97316;
  flex-shrink: 0;
}

.lesson-search-input {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px 12px 6px;
  border: none;
  outline: none;
  background: transparent;
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 600;
}

.lesson-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.clear-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 14px;
  border-radius: 50%;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.clear-search-btn:hover {
  background: #fca5a5;
  color: #991b1b;
  transform: scale(1.08);
}

/* Quick Topic Chips & Review Mode Bar */
.search-keywords-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.keywords-chips-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.keywords-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.keywords-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Review Mode Trigger Button */
.btn-review-mode {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 50%, #4f46e5 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  outline: none;
}

.btn-review-mode:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #6d28d9 0%, #4f46e5 50%, #4338ca 100%);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45);
}

.btn-review-mode:active {
  transform: translateY(0);
}

.review-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.review-btn-text {
  letter-spacing: -0.01em;
}

.review-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.76rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #c2410c;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.05);
}

.keyword-chip:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
  transform: translateY(-1px);
}

.keyword-chip.active {
  background: linear-gradient(135deg, #ff7849 0%, #f97316 100%);
  border-color: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

/* Search Status Count */
.search-results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748b;
  padding: 0 4px;
}

/* Empty State */
.search-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  background: #ffffff;
  border: 2px dashed #fed7aa;
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.05);
}

.search-empty-state .empty-icon {
  font-size: 3.4rem;
  margin-bottom: 12px;
}

.search-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.search-empty-state p {
  color: #64748b;
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 20px;
}

.search-empty-state .empty-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.empty-suggestions span {
  font-size: 0.88rem;
  font-weight: 700;
  color: #94a3b8;
}

.suggestion-chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  color: #ea580c;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-chip:hover {
  background: #ffedd5;
  border-color: #ea580c;
  transform: translateY(-1px);
}

/* Lesson Cards Grid */
.lesson-grid,
#lessonGrid {
  min-height: 420px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

/* Skeleton Card Placeholder Loader */
.skeleton-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border-radius: 24px;
  border: 1.5px solid #fed7aa;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 340px;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.05);
  pointer-events: none;
  cursor: default;
}

.skeleton-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(254, 215, 170, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeletonShimmer 1.8s infinite;
  pointer-events: none;
}

@keyframes skeletonShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-box {
  background: #f1f5f9;
  border-radius: 8px;
  animation: skeletonPulse 1.6s ease-in-out infinite alternate;
}

@keyframes skeletonPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skeleton-badge {
  width: 90px;
  height: 24px;
  border-radius: 9999px;
  background: #ffedd5;
}

.skeleton-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #fed7aa;
}

.skeleton-title {
  width: 70%;
  height: 28px;
  border-radius: 8px;
  background: #e2e8f0;
}

.skeleton-subtitle {
  width: 88%;
  height: 18px;
  border-radius: 6px;
  background: #f8fafc;
}

.skeleton-tags {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.skeleton-tag {
  width: 64px;
  height: 22px;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #fed7aa;
}

.skeleton-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #f1f5f9;
}

.skeleton-btn {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  background: #fed7aa;
}

.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  border: none;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
}

.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(249, 115, 22, 0.18);
}

/* Lesson Progress Bar */
.lesson-progress-box {
  margin: 10px 0 18px;
  padding: 12px 14px;
  background: #fff7ed;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: none;
}

.progress-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-status-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.progress-status-label.is-completed {
  color: #059669;
}

.progress-toggle-btn {
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #c2410c;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.progress-toggle-btn:hover {
  background: #ffedd5;
  border-color: #f97316;
  color: #ea580c;
  transform: scale(1.05);
}

.progress-toggle-btn.is-done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-bar-fill.completed-fill {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.lesson-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff7ed;
  position: relative;
}

.lesson-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.lesson-card:hover .lesson-card-image img {
  transform: scale(1.04);
}

/* Favorite Heart Toggle Button on Card */
.lesson-favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #fed7aa;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lesson-favorite-btn:hover {
  transform: scale(1.15);
  background: #ffffff;
  border-color: #f97316;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.25);
}

.lesson-favorite-btn.active {
  background: #fff1f2;
  border-color: #fda4af;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
  animation: heartPulse 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPulse {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.favorite-filter-chip.active {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  border-color: #be123c !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35) !important;
}

.lesson-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #ea580c;
  background: #ffedd5;
  font-family: var(--font-kaiti);
  font-size: 3.8rem;
}

.lesson-card-content {
  padding: 26px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.lesson-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  align-self: flex-start;
}

.lesson-card-content h3 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
}

.lesson-chinese-title {
  color: #ea580c;
  font-family: var(--font-kaiti);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lesson-pinyin {
  color: #d97706;
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lesson-meaning {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.lesson-description {
  margin: 0 0 16px;
  color: #475569;
  font-size: 0.96rem;
  line-height: 1.55;
  flex-grow: 1;
}

.lesson-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.lesson-keyword-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 3px 8px;
  border-radius: 6px;
}

.lesson-card-actions {
  margin-top: auto;
}

.lesson-button {
  width: 100%;
}


/* =========================================================
   SECTION 1: HERO IMAGE BANNER
========================================================= */

.hero-image-container {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.hero-upload-img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(249, 115, 22, 0.08);
  border: 2px solid #fed7aa;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-upload-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(249, 115, 22, 0.18);
}


/* =========================================================
   SECTION 2: STORIES & REELS (9:16 VERTICAL PREVIEWS)
========================================================= */

.stories-reels-section {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
  border-bottom: 1.5px solid #ffedd5;
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 30px;
}

.reels-grid.reels-count-1 {
  grid-template-columns: minmax(260px, 340px);
  justify-content: center;
}

.reels-grid.reels-count-2 {
  grid-template-columns: repeat(2, minmax(260px, 340px));
  justify-content: center;
}

.reel-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0f172a;
  border: 1.5px solid #fed7aa;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.09);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.reel-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(249, 115, 22, 0.2);
  border-color: #f97316;
}

.reel-thumbnail-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-preview-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.reel-preview-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.reel-card:hover .reel-preview-video {
  transform: scale(1.05);
}

.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.5) 0%,
    rgba(15, 23, 42, 0) 30%,
    rgba(15, 23, 42, 0.3) 60%,
    rgba(15, 23, 42, 0.95) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  color: #ffffff;
  pointer-events: none;
}

.reel-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 2;
}

.reel-badge-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.reel-tag-culture {
  background: #dc2626;
  color: #ffffff;
}

.reel-tag-daily {
  background: #0284c7;
  color: #ffffff;
}

.reel-tag-market {
  background: #d97706;
  color: #ffffff;
}

.reel-duration {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #f8fafc;
}

.reel-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 2px solid rgba(255, 255, 255, 0.35);
  z-index: 3;
}

.reel-play-btn .play-icon {
  margin-left: 3px;
  line-height: 1;
}

.reel-card:hover .reel-play-btn {
  transform: translate(-50%, -50%) scale(1.15);
  background: #ea580c;
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.6);
}

.reel-meta-bottom {
  z-index: 2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.reel-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 2px;
  line-height: 1.25;
}

.reel-card-chinese {
  font-family: var(--font-kaiti);
  font-size: 0.98rem;
  font-weight: 700;
  color: #fdba74;
  margin-bottom: 4px;
}

.reel-card-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =========================================================
   SECTION 3: GAMES (EMBEDDED IFRAME & ACTION)
========================================================= */

.games-section {
  background: #ffffff;
  border-bottom: 1.5px solid #ffedd5;
}

.game-featured-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.game-iframe-wrapper {
  position: relative;
  width: 100%;
  max-width: 540px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid #fed7aa;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 380px;
}

.game-iframe {
  width: 100%;
  max-width: 100%;
  height: 390px;
  border: none;
  display: block;
}


/* =========================================================
   SECTION 4: LESSONS (2 CATEGORY SELECTION CARDS)
========================================================= */

.lessons-portal-section {
  background: linear-gradient(180deg, #fffaf5 0%, #fff7ed 100%);
  border-bottom: 1.5px solid #ffedd5;
}

.lesson-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 10px;
}

.category-card {
  border-radius: 28px;
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.07);
}

.category-card-adult {
  background: linear-gradient(145deg, #ffffff 0%, #fffaf5 60%, #fff7ed 100%);
  border: 2px solid #fed7aa;
}

.category-card-adult:hover {
  transform: translateY(-6px);
  border-color: #f97316;
  box-shadow: 0 22px 55px rgba(249, 115, 22, 0.18);
}

.category-card-kids {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 60%, #ecfdf5 100%);
  border: 2px solid #a7f3d0;
}

.category-card-kids:hover {
  transform: translateY(-6px);
  border-color: #10b981;
  box-shadow: 0 22px 55px rgba(16, 185, 129, 0.2);
}

.category-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: #ffedd5;
  color: #ea580c;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
  margin-bottom: 18px;
}

.category-card-badge.badge-kids {
  background: #dcfce7;
  color: #15803d;
}

.category-card-visual {
  position: absolute;
  top: 18px;
  right: 20px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon-bg {
  font-family: var(--font-kaiti);
  font-size: 5.5rem;
  font-weight: 900;
  color: #fed7aa;
  opacity: 0.45;
  line-height: 1;
}

.visual-kids .category-icon-bg {
  color: #a7f3d0;
  opacity: 0.55;
}

.category-art-emoji {
  position: absolute;
  font-size: 2.2rem;
  top: 14px;
  right: 14px;
}

.category-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.category-card-content h3 {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.category-subtitle {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 14px;
}

.category-card-kids .category-subtitle {
  color: #059669;
}

.category-card-content p {
  color: #475569;
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.category-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-features li {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-features li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffedd5;
  color: #ea580c;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 900;
  flex-shrink: 0;
}

.features-kids li span {
  background: #dcfce7;
  color: #16a34a;
}

.category-card-footer {
  margin-top: auto;
}

.category-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 14px;
}

.btn-kids {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35) !important;
}

.btn-kids:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45) !important;
}

.section-action-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 36px;
}


/* =========================================================
   HOMEPAGE REEL VIDEO PLAYER MODAL (#reelModal)
========================================================= */

#reelModal.reel-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10025;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#reelModal.reel-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#reelModal .reel-modal-card {
  background: #0f172a;
  border-radius: 24px;
  border: 2px solid #fed7aa;
  width: min(92vw, 430px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#reelModal.reel-modal-backdrop.active .reel-modal-card {
  transform: translateY(0) scale(1);
}

#reelModal .reel-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

#reelModal .reel-modal-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.08);
}

#reelModal .reel-modal-video-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-height: calc(90vh - 104px);
  max-height: calc(90dvh - 104px);
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#reelModal .reel-modal-video-wrap video {
  width: 100%;
  height: 100%;
  max-height: calc(90vh - 104px);
  max-height: calc(90dvh - 104px);
  object-fit: contain;
  display: block;
}

#reelModal .reel-modal-info {
  flex-shrink: 0;
  padding: 14px 20px;
  color: #ffffff;
  background: #1e293b;
  border-top: 1px solid #334155;
}

#reelModal .reel-modal-info h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 4px;
}

#reelModal .reel-modal-info p {
  font-size: 0.86rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

#reelModal .reel-modal-status {
  margin-top: 8px !important;
  color: #fecaca !important;
  font-size: 0.84rem !important;
  font-weight: 600;
}


/* =========================================================
   STORY LESSON PAGE (story.html) - BRIGHT & INSPIRING
========================================================= */

.section-light {
  background: #ffffff;
}

.section-alt {
  background: #fffaf5;
}

.section-alt,
.section-alt p,
.section-alt .section-subtitle,
.section-alt .text-secondary,
.section-alt .text-muted,
.section-alt .vocabulary-meaning,
.section-alt .exercise-instruction {
  color: #334155; /* WCAG AA 4.5:1 compliant: 7.6:1 against #fffaf5 */
}

/* Upgraded from dark to bright educational theme */
.section-dark,
.story-quiz.section-dark {
  background: linear-gradient(180deg, #fff7ed 0%, #fef3c7 60%, #fffbf5 100%);
  color: #0f172a;
  border-top: 1.5px solid #fed7aa;
  border-bottom: 1.5px solid #fed7aa;
}

.section-dark .section-heading h2 {
  color: #0f172a;
}

.section-dark .section-heading p {
  color: #475569;
}

/* Lesson Sticky Navigation */
.lesson-navigation {
  position: sticky;
  top: 74px;
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid #fed7aa;
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.05);
}

.lesson-navigation-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  overflow-x: auto;
  padding: 6px 0;
}

.lesson-navigation a {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lesson-navigation a:hover {
  color: #ea580c;
  background: #fff7ed;
}

/* Story Hero Banner */
.story-hero {
  padding: 70px 0 60px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 45%, #e0f2fe 100%);
  color: #0f172a;
  border-bottom: 1.5px solid #fed7aa;
}

.story-hero .section-label {
  color: #ea580c;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  display: inline-block;
  margin-bottom: 16px;
}

.story-hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-family: var(--font-kaiti);
  margin: 0 0 10px;
  color: #0f172a;
  line-height: 1.15;
  font-weight: 800;
}

.story-pinyin {
  color: #d97706;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.story-meaning {
  color: #475569;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 24px;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.story-meta span {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 9999px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #9a3412;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}

.story-progress-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 9999px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #ea580c;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
}

.story-progress-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1px);
}

.story-progress-btn.is-completed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.15);
}

/* Story Switcher Tabs */
.story-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.story-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  color: #9a3412;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.06);
}

.story-switcher-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
  transform: translateY(-1px);
}

.story-switcher-btn.active {
  background: linear-gradient(135deg, #ff7849 0%, #f97316 100%);
  border-color: #ea580c;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.story-switcher-badge {
  display: inline-block;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}

/* Story Pagination & Navigation at bottom */
.story-pagination-section {
  padding: 55px 0 75px;
  background: #fffaf5;
  border-top: 1.5px solid #fed7aa;
}

.story-pagination-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 20px;
  padding: 28px 34px;
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.08);
}

.story-pagination-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
}

.story-pagination-info p {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0;
}

.story-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Story Sections */
.story-section,
.story-images-section,
.story-reading,
.story-vocabulary,
.story-quiz {
  padding: 75px 0;
}

.video-card {
  max-width: 880px;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(249, 115, 22, 0.1);
}

.story-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(520px, 68vh);
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-video {
  width: 100%;
  height: 100%;
  max-height: min(520px, 68vh);
  object-fit: contain;
  display: block;
  background: #000000;
}

.story-video-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.story-video-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.story-video-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.story-video-cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.56) 100%);
  pointer-events: none;
}

.story-video-cover-play {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 10px 12px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.96rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.story-video-cover:hover .story-video-cover-play,
.story-video-cover:focus-visible .story-video-cover-play {
  transform: scale(1.04);
  background: rgba(234, 88, 12, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
}

.story-video-cover-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ea580c;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.story-video-cover-label {
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-caption {
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: #ffffff;
}

.video-caption strong {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
}

.video-caption span {
  color: #64748b;
  font-size: 0.92rem;
}

.video-status-banner {
  margin: 14px 26px 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.video-status-banner.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .video-status-banner {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(251, 146, 60, 0.35);
  color: #fed7aa;
}

[data-theme="dark"] .video-status-banner.is-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.story-audio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 16px 22px;
  background: #fff7ed;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
}

.full-narration-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.full-narration-icon {
  font-size: 1.4rem;
}

.full-narration-title {
  display: block;
  font-size: 0.98rem;
  color: #0f172a;
  font-weight: 700;
}

.full-narration-sub {
  display: block;
  font-size: 0.85rem;
  color: #475569;
}

.full-narration-btn {
  min-width: 150px;
}

/* 02 Understand Images */
.story-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}

.story-image-card {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.12);
  border-color: #f97316;
}

.story-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.story-image-content {
  padding: 22px;
}

.story-image-content h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: #0f172a;
  font-family: var(--font-kaiti);
  font-weight: 700;
}

.story-image-content p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 03 Story Reading */
.reading-card {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(249, 115, 22, 0.08);
}

.reading-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 18px;
  padding: 26px 32px;
  border-bottom: 1.5px solid #ffedd5;
  align-items: start;
}

.reading-item:last-child {
  border-bottom: none;
}

.reading-number {
  color: #ea580c;
  font-size: 0.95rem;
  font-weight: 800;
  padding-top: 4px;
}

.reading-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chinese-sentence {
  font-family: var(--font-kaiti);
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.pinyin-sentence {
  color: #d97706;
  font-size: 1.1rem;
  font-weight: 700;
}

.english-sentence {
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* 04 Vocabulary */
.vocabulary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}

.vocabulary-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 20px;
  padding: 30px 22px 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.vocabulary-card:hover {
  transform: translateY(-4px);
  border-color: #f97316;
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.12);
}

.vocabulary-number {
  position: absolute;
  top: 14px;
  left: 16px;
  color: #ea580c;
  font-size: 0.78rem;
  font-weight: 800;
}

.vocabulary-character {
  font-family: var(--font-kaiti);
  font-size: 3.4rem;
  font-weight: 700;
  color: #ea580c;
  margin: 6px 0 4px;
  line-height: 1.1;
}

.vocabulary-pinyin {
  color: #d97706;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.vocabulary-meaning {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 18px;
}

/* 05 Quiz & Exercises */
.story-quiz-card {
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 26px;
  padding: 44px;
  box-shadow: 0 18px 45px rgba(249, 115, 22, 0.1);
  color: #0f172a;
}

.story-quiz-card h2 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #0f172a;
}

.exercise-intro {
  color: #475569;
  font-size: 1.05rem;
  margin: 0 0 32px;
}

.exercise-list {
  display: grid;
  gap: 26px;
}

.exercise-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  padding: 26px;
  background: #fffaf5;
  border: 1.5px solid #fed7aa;
  border-radius: 18px;
  align-items: start;
}

.exercise-number {
  color: #ea580c;
  font-size: 0.95rem;
  font-weight: 800;
  padding-top: 2px;
}

.exercise-body h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
}

.exercise-options {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.exercise-option {
  padding: 14px 20px;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  color: #1e293b;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.exercise-option:hover {
  border-color: #f97316;
  background: #fff7ed;
  color: #ea580c;
  transform: translateY(-1px);
}

.exercise-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.exercise-option.incorrect {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
}

.exercise-feedback {
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 8px;
}

.correct-feedback {
  color: #059669;
}

.incorrect-feedback {
  color: #dc2626;
}


/* =========================================================
   FOOTER - CLEAN, INFORMATIVE & CONTACT
========================================================= */

.site-footer {
  background: #1e293b;
  color: #cbd5e1;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 40px;
  padding: 60px 0 50px;
  align-items: start;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
}

.footer-logo.has-custom-logo {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  width: fit-content;
}

.footer-brand-logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  border-radius: 6px;
}

.footer-logo span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff7849 0%, #f97316 100%);
  color: #ffffff;
  font-family: var(--font-kaiti);
  font-size: 1.3rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: #fb923c;
  transform: translateX(3px);
}

/* Contact Us Column */
.footer-contact {
  display: flex;
  flex-direction: column;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.contact-item:hover {
  background: transparent !important;
  border: none !important;
  color: #fb923c;
  transform: translateX(4px);
}

.contact-item:hover .contact-value {
  color: #fb923c;
  text-decoration: underline;
}

.contact-icon {
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.contact-item:hover .contact-icon {
  transform: scale(1.1);
  background: rgba(249, 115, 22, 0.22);
}

.viber-badge {
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
}

.contact-details {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.contact-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  padding: 18px 0;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
}


/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text > p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }

  /* Section 2: Stories & Reels on Tablet */
  .reels-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  /* Section 3: Games on Tablet */
  .game-featured-container {
    max-width: 600px;
  }

  .game-iframe-wrapper {
    max-width: 520px;
    min-height: 380px;
  }

  .game-iframe {
    height: 380px;
  }

  /* Section 4: Lessons on Tablet */
  .lesson-categories-grid {
    gap: 20px;
  }

  .category-card {
    padding: 30px 24px;
  }

  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 768px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .section {
    padding: 65px 0;
  }

  /* Header */
  .nav-container {
    min-height: 64px;
    position: relative;
    gap: 10px;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
  }

  .nav-actions {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .streak-badge {
    padding: 6px 10px;
    gap: 5px;
  }

  .streak-count {
    font-size: 0.92rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 14px;
    left: auto;
    width: min(320px, calc(100vw - 28px));
    border-radius: 20px;
    border: 1.5px solid #fed7aa;
  }

  /* Hero */
  .hero {
    padding: 70px 0 60px;
  }

  .hero-text h1 {
    font-size: clamp(2.8rem, 12vw, 3.8rem);
  }

  .hero-text > p {
    font-size: 1.05rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .hero-visual {
    min-height: auto;
    padding: 10px;
    border-radius: 24px;
  }

  /* Section 2: Stories & Reels on Mobile */
  .reels-grid,
  .reels-grid.reels-count-1,
  .reels-grid.reels-count-2 {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto 24px;
    gap: 22px;
  }

  /* Section 3: Games on Mobile */
  .game-featured-container {
    width: 100%;
  }

  .game-iframe-wrapper {
    border-radius: 18px;
    max-width: 100%;
    min-height: 380px;
  }

  .game-iframe {
    height: 380px;
  }

  /* Section 4: Lessons Category Cards on Mobile */
  .lesson-categories-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 520px;
    margin: 0 auto;
  }

  .category-card {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .category-card-content h3 {
    font-size: 1.35rem;
  }



  /* Learning Hub — Full Width Layout for Each Lesson */
  .lesson-grid,
  #lessonGrid {
    grid-template-columns: 1fr !important;
    gap: 22px;
    width: 100%;
    box-sizing: border-box;
  }

  .lesson-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 1.5px solid #fed7aa;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.07);
    overflow: hidden;
    background: #ffffff;
  }

  .lesson-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 250px;
    overflow: hidden;
  }

  .lesson-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .lesson-card-content {
    padding: 22px 20px;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .lesson-card-content h3 {
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 0 0 6px;
    word-break: break-word;
  }

  .lesson-chinese-title {
    font-size: 1.4rem;
    line-height: 1.25;
    margin-bottom: 4px;
  }

  .lesson-pinyin {
    font-size: 0.96rem;
    margin-bottom: 4px;
  }

  .lesson-meaning {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .lesson-description {
    font-size: 0.94rem;
    line-height: 1.55;
    margin: 0 0 16px;
  }

  .lesson-keywords {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .lesson-progress-box {
    margin: 6px 0 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff7ed;
    width: 100%;
    box-sizing: border-box;
  }

  .progress-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
  }

  .progress-status-label {
    font-size: 0.82rem;
    font-weight: 800;
  }

  .progress-toggle-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
  }

  .progress-bar-track {
    width: 100%;
    height: 8px;
  }

  .lesson-card-actions {
    margin-top: auto;
    width: 100%;
  }

  .lesson-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 14px;
    box-sizing: border-box;
  }

  .learning-search-box {
    margin-bottom: 28px;
  }

  .keywords-chips {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* Story Lesson Page Responsive */
  .story-hero {
    padding: 45px 0 35px;
  }

  .lesson-navigation-inner {
    justify-content: flex-start;
    padding: 8px 15px;
  }

  .reading-item {
    grid-template-columns: 32px 1fr;
    padding: 20px 16px;
    gap: 12px;
  }

  .chinese-sentence {
    font-size: 1.35rem;
  }

  .story-quiz-card {
    padding: 26px 18px;
  }

  .exercise-item {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 10px;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .section-heading {
    margin-bottom: 30px;
  }

  .section-heading h2 {
    font-size: 2rem;
  }

  /* Section 1: Hero on Small Mobile */
  .hero-upload-img {
    border-radius: 14px;
  }

  /* Section 2: Stories & Reels on Small Mobile */
  .reels-grid {
    max-width: 100%;
    gap: 18px;
  }

  /* Section 3: Games on Small Mobile */
  .game-iframe-wrapper,
  .game-iframe {
    height: 380px;
    min-height: 380px;
    border-radius: 14px;
  }

  /* Section 4: Lessons Category Cards on Small Mobile */
  .category-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .category-card-content h3 {
    font-size: 1.25rem;
  }

  .category-subtitle {
    font-size: 0.88rem;
    margin-bottom: 10px;
  }

  .category-card-content p {
    font-size: 0.9rem;
    margin-bottom: 16px;
  }

  .category-features {
    margin-bottom: 20px;
    gap: 8px;
  }

  .category-btn {
    padding: 12px 18px;
    font-size: 0.96rem;
    border-radius: 12px;
  }

  .lesson-grid,
  #lessonGrid {
    gap: 16px;
  }

  .lesson-card {
    border-radius: 18px;
  }

  .lesson-card-content {
    padding: 18px 15px;
  }

  .lesson-card-content h3 {
    font-size: 1.18rem;
  }

  .lesson-chinese-title {
    font-size: 1.28rem;
  }

  .lesson-description {
    font-size: 0.88rem;
    margin-bottom: 12px;
  }

  .lesson-button {
    padding: 11px 16px;
    font-size: 0.94rem;
  }

  .streak-label,
  .level-label {
    display: none;
  }

  .menu-toggle {
    padding: 0 10px;
    height: 38px;
    width: 38px;
  }

  .menu-toggle-label {
    display: none;
  }

  .tone-display {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .tone-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
  }

  .audio-button,
  .conversation-audio-button {
    width: 100%;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

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


/* =========================================================
   COMPLETION CONGRATULATORY MODAL
========================================================= */

.completion-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}

.completion-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.completion-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 28px;
  padding: 38px 30px 32px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
  text-align: center;
  overflow: hidden;
  transform: scale(0.9) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.completion-modal-backdrop.active .completion-modal-card {
  transform: scale(1) translateY(0);
}

.completion-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.completion-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.08);
}

.completion-trophy-wrap {
  width: 82px;
  height: 82px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.22);
  animation: trophyBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes trophyBounce {
  0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.completion-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.completion-modal-card h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.25;
}

.completion-lesson-name {
  color: #64748b;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 22px;
}

.completion-stats-box {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbf5 100%);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 24px;
  border: 1.5px solid #fed7aa;
}

.completion-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .completion-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.completion-stat-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ffedd5;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}

.completion-stat-item .stat-icon {
  font-size: 2rem;
  line-height: 1;
}

.completion-stat-item .stat-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.completion-stat-item .stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1.05;
}

.completion-stat-item .stat-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #9a3412;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.completion-stat-status {
  font-size: 0.92rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.completion-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.completion-modal-actions .btn {
  min-width: 140px;
  flex: 1 1 auto;
}


/* =========================================================
   DAILY REMINDER & NOTIFICATION SYSTEM
========================================================= */

.reminder-bell-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #ea580c;
  font-size: 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
  outline: none;
  flex-shrink: 0;
}

.reminder-bell-btn:hover,
.reminder-bell-btn:focus-visible {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.18);
}

.reminder-status-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  display: none;
}

.reminder-status-dot.active {
  display: block;
}

/* Accessible Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Theme Toggle Button for Late-Night Learning */
.theme-toggle-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #ea580c;
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
  outline: none;
  flex-shrink: 0;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
}

.theme-toggle-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.18);
}

.theme-toggle-btn:focus-visible {
  outline: 2.5px solid #ea580c;
  outline-offset: 3px;
  background: #fff7ed;
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.theme-toggle-btn:active {
  transform: scale(0.92);
}

.theme-toggle-btn .theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle-btn .theme-icon-sun {
  display: none;
}

.theme-toggle-btn .theme-icon-moon {
  display: inline-flex;
}

/* Mobile Drawer Theme Row in Navigation Flyout */
.hide-menu-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  margin-top: 6px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.hide-menu-theme-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hide-menu-theme-icon {
  font-size: 1.35rem;
}

.hide-menu-theme-text {
  display: flex;
  flex-direction: column;
}

.hide-menu-theme-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.hide-menu-theme-status {
  font-size: 0.78rem;
  color: #ea580c;
  font-weight: 600;
}

/* Reminder Modal Backdrop & Card */
.reminder-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}

.reminder-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.reminder-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 28px;
  padding: 34px 28px 28px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  transform: scale(0.9) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reminder-modal-backdrop.active .reminder-modal-card {
  transform: scale(1) translateY(0);
}

.reminder-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.reminder-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.08);
}

.reminder-modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.reminder-bell-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  display: grid;
  place-items: center;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.18);
}

.reminder-modal-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.25;
}

.reminder-modal-subtitle {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0;
}

.reminder-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.reminder-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reminder-toggle-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.reminder-toggle-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.reminder-toggle-text span {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}

/* Toggle Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 34px;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-toggle input:checked + .switch-slider {
  background-color: #f97316;
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(22px);
}

.reminder-section-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  text-align: left;
}

.reminder-section-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.35;
  text-align: left;
}

.reminder-preset-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.time-chip {
  padding: 8px 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.time-chip:hover {
  border-color: #f97316;
  color: #ea580c;
  background: #fff7ed;
}

.time-chip.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.reminder-custom-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
}

.reminder-time-input {
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.reminder-time-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.reminder-permission-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.reminder-permission-card.is-granted {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.reminder-permission-card.is-denied {
  background: #fef2f2;
  border-color: #fecaca;
}

.permission-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.permission-content {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.permission-content strong {
  font-size: 0.86rem;
  color: #0f172a;
  margin-bottom: 1px;
}

.permission-content span {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.3;
}

.reminder-goal-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.goal-status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.goal-status-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.goal-status-text strong {
  font-size: 0.88rem;
  color: #0f172a;
  margin-bottom: 1px;
}

.goal-status-text p {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.reminder-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.reminder-modal-actions .btn {
  flex: 1 1 auto;
  font-size: 0.9rem;
  padding: 10px 16px;
}

/* In-app Toast Banner */
.reminder-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: min(92vw, 420px);
}

.reminder-toast {
  pointer-events: auto;
  background: #0f172a;
  color: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1.5px solid rgba(254, 215, 170, 0.3);
  animation: toastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.reminder-toast.toast-hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reminder-toast-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.reminder-toast-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.reminder-toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fdba74;
  margin-bottom: 3px;
}

.reminder-toast-body {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin-bottom: 8px;
}

.reminder-toast-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f97316;
  background: rgba(249, 115, 22, 0.14);
  padding: 4px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.reminder-toast-action:hover {
  background: #f97316;
  color: #ffffff;
}

.reminder-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.reminder-toast-close:hover {
  color: #ffffff;
}


/* =========================================================
   REVIEW MODE FLASHCARDS MODAL
========================================================= */

.review-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.review-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.review-modal-card {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 32px;
  border: 2px solid #fed7aa;
  box-shadow: 0 25px 65px rgba(15, 23, 42, 0.35);
  padding: 30px 34px;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 94vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.review-modal-backdrop.active .review-modal-card {
  transform: translateY(0) scale(1);
}

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

.review-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-header-badge {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 9999px;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.review-modal-header h2 {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

.review-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-review-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1.5px solid #fed7aa;
  background: #fffaf5;
  color: #c2410c;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-review-header:hover {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1px);
}

.review-modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* Progress & stats bar */
.review-progress-bar-wrap {
  margin-bottom: 20px;
}

.review-progress-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.review-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.review-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
}

.review-stat-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-stat-pill {
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill-mastered {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.pill-practice {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* 3D Flashcard Structure */
.flashcard-container {
  perspective: 1200px;
  width: 100%;
  min-height: 330px;
  margin: 16px 0 22px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 330px;
  border-radius: 28px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flashcard-inner.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 330px;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.flashcard-front {
  background:
    radial-gradient(circle at 85% 15%, rgba(254, 215, 170, 0.45) 0%, transparent 50%),
    linear-gradient(145deg, #ffffff 0%, #fffaf5 60%, #fff7ed 100%);
  border: 2px solid #fed7aa;
}

.flashcard-back {
  background:
    radial-gradient(circle at 15% 15%, rgba(199, 210, 254, 0.45) 0%, transparent 50%),
    linear-gradient(145deg, #ffffff 0%, #f8fafc 60%, #eef2ff 100%);
  border: 2px solid #c7d2fe;
  transform: rotateY(180deg);
}

.card-face-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-source-tag {
  font-size: 0.82rem;
  font-weight: 800;
  color: #c2410c;
  background: #ffedd5;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #fed7aa;
}

.flashcard-back .card-source-tag {
  color: #4338ca;
  background: #e0e7ff;
  border-color: #c7d2fe;
}

.card-hint-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  text-align: center;
}

.card-character {
  font-family: var(--font-kaiti);
  font-size: clamp(3.2rem, 9vw, 5.2rem);
  font-weight: 800;
  color: #ea580c;
  line-height: 1.15;
  text-shadow: 0 6px 18px rgba(234, 88, 12, 0.15);
  margin-bottom: 8px;
}

.card-hanzi-writer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  max-width: 100%;
  margin: 0 auto 8px auto;
  position: relative;
  background: rgba(254, 243, 199, 0.25);
  border-radius: 16px;
  box-shadow: inset 0 0 12px rgba(234, 88, 12, 0.08);
}

.card-hanzi-writer-container svg {
  width: 100% !important;
  height: 100% !important;
}

.card-stroke-btn {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
}

.card-stroke-btn:hover {
  background: #c2410c !important;
  transform: translateY(-1px);
}

.card-character-sub {
  font-family: var(--font-kaiti);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  color: #4338ca;
  line-height: 1.15;
  margin-bottom: 6px;
}

.card-pinyin {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0284c7;
  line-height: 1.5;
  min-height: 1.5em;
  margin-bottom: 4px;
}

.card-meaning {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.card-context-box {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  max-width: 90%;
  margin-top: 4px;
}

.card-context-box .context-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
}

.card-context-box .context-chinese {
  font-weight: 700;
  color: #0f172a;
}

.card-context-box .context-english {
  color: #64748b;
  font-size: 0.84rem;
}

.card-face-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #ea580c;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.08);
}

.flashcard-back .card-audio-btn {
  border-color: #c7d2fe;
  color: #4f46e5;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08);
}

.card-audio-btn:hover {
  transform: scale(1.05);
  background: #fff7ed;
  border-color: #ea580c;
}

.flashcard-back .card-audio-btn:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}

.card-flip-prompt {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Review action controls */
.review-controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.review-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.review-action-btn:hover {
  transform: translateY(-2px);
}

.btn-action-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.btn-action-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.btn-action-label strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.btn-action-label small {
  font-size: 0.72rem;
  opacity: 0.85;
}

.btn-need-practice {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25);
}

.btn-need-practice:hover {
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.35);
}

.btn-flip-card {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25);
}

.btn-flip-card:hover {
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.35);
}

.btn-got-it {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.btn-got-it:hover {
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.review-keyboard-hints {
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
}

/* Empty State & Summary Screens */
.review-empty-state,
.review-summary-screen {
  text-align: center;
  padding: 30px 10px;
}

.review-empty-icon,
.summary-trophy {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 14px;
}

.review-empty-state h3,
.review-summary-screen h3 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 10px;
}

.review-empty-state p,
.summary-subtitle {
  color: #64748b;
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.review-empty-actions,
.summary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 460px;
  margin: 0 auto 28px;
}

.summary-stat-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.summary-stat-box .stat-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #6366f1;
  line-height: 1;
  margin-bottom: 4px;
}

.summary-stat-box .stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .review-modal-card {
    padding: 24px 18px;
    border-radius: 26px;
  }

  .review-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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


/* =========================================================
   DARK MODE THEME ([data-theme="dark"])
   Optimized for Late-Night Learning Sessions
========================================================= */

[data-theme="dark"] {
  --primary: #fb923c;
  --primary-hover: #f97316;
  --primary-coral: #ff7849;
  --primary-light: #2a1b14;
  --primary-tint: #3b2416;
  --primary-border: #7c2d12;
  
  --secondary: #38bdf8;
  --secondary-hover: #0ea5e9;
  --secondary-light: #082f49;
  --secondary-border: #0369a1;
  
  --sunny-amber: #fbbf24;
  --sunny-gold: #fde047;
  --sunny-light: #451a03;
  
  --mint-emerald: #34d399;
  --mint-dark: #10b981;
  --mint-light: #064e3b;
  --mint-border: #047857;
  
  --berry-purple: #a78bfa;
  --berry-light: #2e1065;
  --berry-border: #6d28d9;

  --bg-page: #0b1120;
  --bg-page-alt: #0f172a;
  --bg-surface: #1e293b;
  --bg-warm: #172033;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-warm: #fdba74;
  
  --border-subtle: #334155;
  --border-card: #334155;
  --border-focus: #fb923c;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] body {
  background-color: #0b1120;
  color: #f8fafc;
}

/* Header & Navigation in Dark Mode */
[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: #334155;
}

[data-theme="dark"] .desktop-nav .nav-link {
  color: #cbd5e1;
}

[data-theme="dark"] .desktop-nav .nav-link:hover,
[data-theme="dark"] .desktop-nav .nav-link:focus-visible {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
}

[data-theme="dark"] .desktop-nav .nav-link.active,
[data-theme="dark"] .desktop-nav .nav-link[aria-current="page"] {
  color: #fb923c;
  font-weight: 800;
  background: rgba(251, 146, 60, 0.16);
  box-shadow: inset 0 0 0 1.5px rgba(251, 146, 60, 0.4);
}

[data-theme="dark"] .desktop-nav .nav-link.active::after,
[data-theme="dark"] .desktop-nav .nav-link[aria-current="page"]::after {
  background-color: #fb923c;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.85);
}

[data-theme="dark"] .logo-text {
  color: #f8fafc;
}

[data-theme="dark"] .site-header .logo.has-custom-logo {
  background: rgba(255, 255, 255, 0.96);
  padding: 4px 10px;
}

[data-theme="dark"] .main-nav {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

@media (max-width: 900px) {
  [data-theme="dark"] .main-nav {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  }
}

[data-theme="dark"] .main-nav a {
  color: #cbd5e1;
}

[data-theme="dark"] .main-nav a:hover,
[data-theme="dark"] .main-nav a:focus {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
}

[data-theme="dark"] .hide-menu-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .hide-menu-title {
  color: #f8fafc;
}

[data-theme="dark"] .hide-menu-close-btn {
  color: #94a3b8;
}

[data-theme="dark"] .hide-menu-close-btn:hover {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
}

[data-theme="dark"] .hide-menu-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .hide-menu-section-label {
  color: #fdba74;
}

[data-theme="dark"] .hide-menu-divider {
  background: #334155;
}

[data-theme="dark"] .hide-menu-card-sub {
  color: #94a3b8;
}

[data-theme="dark"] .hide-menu-tag {
  background: #334155;
  color: #fb923c;
  border-color: #475569;
}

[data-theme="dark"] .hide-menu-tag-review {
  background: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.4);
}

[data-theme="dark"] .hide-menu-link {
  color: #cbd5e1;
}

[data-theme="dark"] .hide-menu-link:hover {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}

[data-theme="dark"] .hide-menu-link.active,
[data-theme="dark"] .hide-menu-link[aria-current="page"] {
  background: rgba(251, 146, 60, 0.16);
  color: #fb923c;
  font-weight: 800;
  box-shadow: inset 3.5px 0 0 #fb923c;
}

[data-theme="dark"] .hide-menu-link.active::after,
[data-theme="dark"] .hide-menu-link[aria-current="page"]::after {
  background-color: #fb923c;
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.95);
}

[data-theme="dark"] .hide-menu-review-link {
  background: rgba(225, 29, 72, 0.16) !important;
  border-color: rgba(225, 29, 72, 0.45) !important;
  color: #fda4af !important;
}

[data-theme="dark"] .hide-menu-review-link:hover {
  background: rgba(225, 29, 72, 0.28) !important;
  color: #fecdd3 !important;
}

[data-theme="dark"] .hide-menu-streak-card {
  background: linear-gradient(135deg, #1e293b 0%, #172033 100%) !important;
  border-color: #475569 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .hide-menu-level-card {
  background: linear-gradient(135deg, #1e293b 0%, #132a22 100%) !important;
  border-color: #065f46 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .hide-menu-reminder-wrap {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .hide-menu-reminder-title {
  color: #f8fafc;
}

[data-theme="dark"] .hide-menu-reminder-sub {
  color: #94a3b8;
}

[data-theme="dark"] .menu-toggle {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .menu-toggle:hover,
[data-theme="dark"] .menu-toggle:focus-visible {
  background: #243248;
  border-color: #fb923c;
  color: #fb923c;
}

/* Header Badges */
[data-theme="dark"] .streak-badge,
[data-theme="dark"] .level-badge {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .streak-badge:hover,
[data-theme="dark"] .level-badge:hover {
  background: #243248;
  border-color: #fb923c;
}

[data-theme="dark"] .streak-count {
  color: #fb923c;
}

[data-theme="dark"] .streak-label,
[data-theme="dark"] .level-label {
  color: #94a3b8;
}

[data-theme="dark"] .level-rank {
  color: #38bdf8;
}

[data-theme="dark"] .streak-tooltip,
[data-theme="dark"] .level-tooltip {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .streak-tooltip strong,
[data-theme="dark"] .level-tooltip strong {
  color: #f8fafc;
}

[data-theme="dark"] .streak-tooltip p,
[data-theme="dark"] .level-tooltip p {
  color: #cbd5e1;
}

[data-theme="dark"] .level-progress-bar-wrap {
  background: #0f172a;
}

[data-theme="dark"] .reminder-bell-btn {
  background: #1e293b;
  border-color: #334155;
  color: #fb923c;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .reminder-bell-btn:hover,
[data-theme="dark"] .reminder-bell-btn:focus-visible {
  background: #334155;
  border-color: #fb923c;
}

/* Theme Toggle Button in Dark Mode */
[data-theme="dark"] .theme-toggle-btn {
  background: #1e293b;
  border-color: #475569;
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: #334155;
  border-color: #fb923c;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.25);
}

[data-theme="dark"] .theme-toggle-btn:focus-visible {
  outline: 2.5px solid #fb923c;
  outline-offset: 3px;
  background: #334155;
  border-color: #fb923c;
  box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.25);
}

[data-theme="dark"] .hide-menu-theme-row {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .hide-menu-theme-title {
  color: #f8fafc;
}

[data-theme="dark"] .hide-menu-theme-status {
  color: #38bdf8;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
  display: inline-flex;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
  display: none;
}

/* Hero Section in Dark Mode */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0b1120 0%, #0f172a 50%, #1e1b4b 100%);
}

[data-theme="dark"] .hero-text h1 {
  color: #f8fafc;
}

[data-theme="dark"] .hero-text p {
  color: #94a3b8;
}

[data-theme="dark"] .eyebrow {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border-color: #7c2d12;
}

[data-theme="dark"] .hero-visual {
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .hero-upload-img {
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .stories-reels-section {
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  border-bottom-color: #334155;
}

[data-theme="dark"] .reel-card {
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .reel-card:hover {
  border-color: #fb923c;
  box-shadow: 0 20px 48px rgba(251, 146, 60, 0.25);
}

[data-theme="dark"] .games-section {
  background: #0f172a;
  border-bottom-color: #334155;
}

[data-theme="dark"] .game-iframe-wrapper {
  border-color: #334155;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .lessons-portal-section {
  background: linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
  border-bottom-color: #334155;
}

[data-theme="dark"] .category-card-adult {
  background: linear-gradient(145deg, #1e293b 0%, #172033 60%, #1e1b4b 100%);
  border-color: #475569;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .category-card-adult:hover {
  border-color: #fb923c;
  box-shadow: 0 22px 55px rgba(251, 146, 60, 0.22);
}

[data-theme="dark"] .category-card-adult .category-icon-bg {
  color: #334155;
  opacity: 0.35;
}

[data-theme="dark"] .category-card-adult h3 {
  color: #f8fafc;
}

[data-theme="dark"] .category-card-adult p {
  color: #cbd5e1;
}

[data-theme="dark"] .category-card-adult .category-features li {
  color: #e2e8f0;
}

[data-theme="dark"] .category-card-adult .category-features li span {
  background: #334155;
  color: #fb923c;
}

[data-theme="dark"] .category-card-kids {
  background: linear-gradient(145deg, #1e293b 0%, #142a24 60%, #064e3b 100%);
  border-color: #065f46;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .category-card-kids:hover {
  border-color: #34d399;
  box-shadow: 0 22px 55px rgba(52, 211, 153, 0.22);
}

[data-theme="dark"] .category-card-kids .category-icon-bg {
  color: #064e3b;
  opacity: 0.4;
}

[data-theme="dark"] .category-card-kids h3 {
  color: #f8fafc;
}

[data-theme="dark"] .category-card-kids p {
  color: #cbd5e1;
}

[data-theme="dark"] .category-card-kids .category-features li {
  color: #e2e8f0;
}

[data-theme="dark"] .category-card-kids .category-features li span {
  background: #064e3b;
  color: #34d399;
}

[data-theme="dark"] .hero-card-decoration {
  color: #475569;
}

[data-theme="dark"] .hero-character {
  color: #f8fafc;
}

[data-theme="dark"] .hero-pinyin {
  color: #38bdf8;
}

[data-theme="dark"] .hero-character-sub {
  color: #94a3b8;
}

[data-theme="dark"] .hero-badge {
  background: rgba(30, 41, 59, 0.95);
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .hero-badge strong {
  color: #f8fafc;
}

[data-theme="dark"] .hero-badge span {
  color: #94a3b8;
}

[data-theme="dark"] .hero-stat-box {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .hero-stat-number {
  color: #fb923c;
}

[data-theme="dark"] .hero-stat-label {
  color: #cbd5e1;
}

[data-theme="dark"] .section-heading h2 {
  color: #f8fafc;
}

[data-theme="dark"] .section-heading p {
  color: #94a3b8;
}

[data-theme="dark"] .card-label {
  background: #334155;
  color: #fb923c;
}

[data-theme="dark"] .card-icon {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

[data-theme="dark"] .tone-buttons .tone-button {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .tone-buttons .tone-button:hover {
  border-color: #fb923c;
  color: #f8fafc;
}

[data-theme="dark"] .tone-buttons .tone-button.active {
  background: #ea580c;
  border-color: #f97316;
  color: #ffffff;
}

[data-theme="dark"] .tone-display {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .tone-syllable {
  color: #f8fafc;
}

[data-theme="dark"] .tone-character {
  color: #fb923c;
}

[data-theme="dark"] .tone-translation {
  background: #2a1b14;
  border-color: #7c2d12;
  color: #fdba74;
}

[data-theme="dark"] .tone-description {
  color: #cbd5e1;
}

[data-theme="dark"] .tone-graph {
  color: #38bdf8;
}


[data-theme="dark"] .everyday-item,
[data-theme="dark"] .conversation-item {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .chinese-text {
  color: #f8fafc;
}

[data-theme="dark"] .pinyin-text {
  color: #38bdf8;
}

[data-theme="dark"] .english-text {
  color: #94a3b8;
}

[data-theme="dark"] .speaker-label {
  color: #fb923c;
}

[data-theme="dark"] .dialogue-bubble {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .quiz-question {
  color: #f8fafc;
}

[data-theme="dark"] .quiz-option {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .quiz-option:hover:not(:disabled) {
  border-color: #fb923c;
  background: #1e293b;
}

[data-theme="dark"] .quiz-option.correct {
  background: #064e3b;
  border-color: #10b981;
  color: #ecfdf5;
}

[data-theme="dark"] .quiz-option.incorrect {
  background: #450a0a;
  border-color: #ef4444;
  color: #fef2f2;
}

/* Methodology & Journey in Dark Mode */
[data-theme="dark"] .methodology-section {
  background: #0f172a;
}

[data-theme="dark"] .methodology-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .methodology-card h3 {
  color: #f8fafc;
}

[data-theme="dark"] .methodology-card p {
  color: #94a3b8;
}

[data-theme="dark"] .journey-section {
  background: #0b1120;
}

[data-theme="dark"] .journey-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .journey-card h3 {
  color: #f8fafc;
}

[data-theme="dark"] .journey-card p {
  color: #94a3b8;
}

[data-theme="dark"] .journey-step-number {
  background: #334155;
  color: #fb923c;
}

/* Learning Hub in Dark Mode */
[data-theme="dark"] .learning-section {
  background: #0f172a;
}

[data-theme="dark"] .learning-search-box {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .lesson-search-input {
  color: #f8fafc;
  background: transparent;
}

[data-theme="dark"] .lesson-search-input::placeholder {
  color: #64748b;
}

[data-theme="dark"] .filter-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .filter-btn:hover {
  border-color: #fb923c;
  color: #f8fafc;
}

[data-theme="dark"] .filter-btn.active {
  background: #ea580c;
  border-color: #f97316;
  color: #ffffff;
}

[data-theme="dark"] .review-mode-trigger-btn {
  background: #1e293b;
  border-color: #f43f5e;
  color: #f43f5e;
}

[data-theme="dark"] .review-mode-trigger-btn:hover {
  background: #f43f5e;
  color: #ffffff;
}

[data-theme="dark"] .lesson-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lesson-card:hover {
  border-color: #fb923c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .lesson-title {
  color: #f8fafc;
}

[data-theme="dark"] .lesson-subtitle {
  color: #94a3b8;
}

[data-theme="dark"] .lesson-card-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .lesson-tag {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .favorite-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .favorite-btn:hover {
  border-color: #f43f5e;
  color: #f43f5e;
}

[data-theme="dark"] .favorite-btn.favorited {
  background: #2a1215;
  border-color: #f43f5e;
  color: #f43f5e;
}

[data-theme="dark"] .lesson-progress-wrap {
  background: #0f172a;
}

/* Modals & Flashcards in Dark Mode */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .review-modal-card,
[data-theme="dark"] .completion-modal-card,
[data-theme="dark"] .reminder-modal-card {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .review-modal-header,
[data-theme="dark"] .reminder-modal-header,
[data-theme="dark"] .completion-modal-header {
  border-bottom-color: #334155;
}

[data-theme="dark"] .flashcard-front,
[data-theme="dark"] .flashcard-back {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

[data-theme="dark"] .flashcard-character {
  color: #fb923c;
}

[data-theme="dark"] .flashcard-pinyin {
  color: #38bdf8;
}

[data-theme="dark"] .flashcard-meaning {
  color: #f8fafc;
}

[data-theme="dark"] .review-stat-pill {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .review-progress-track {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .summary-stat-box {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .review-empty-state {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

/* Story Lesson Page (story.html) in Dark Mode */
[data-theme="dark"] .section-light {
  background: #0b1120;
  color: #f8fafc;
}

[data-theme="dark"] .section-alt {
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="dark"] .section-alt p,
[data-theme="dark"] .section-alt .section-subtitle,
[data-theme="dark"] .section-alt .text-secondary,
[data-theme="dark"] .section-alt .text-muted,
[data-theme="dark"] .section-alt .vocabulary-meaning,
[data-theme="dark"] .section-alt .exercise-instruction {
  color: #cbd5e1;
}

[data-theme="dark"] .section-dark,
[data-theme="dark"] .story-quiz.section-dark {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .section-dark .section-heading h2 {
  color: #f8fafc;
}

[data-theme="dark"] .section-dark .section-heading p {
  color: #94a3b8;
}

[data-theme="dark"] .lesson-navigation {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lesson-nav-btn {
  color: #cbd5e1;
}

[data-theme="dark"] .lesson-nav-btn:hover {
  color: #fb923c;
}

[data-theme="dark"] .lesson-nav-btn.active {
  color: #fb923c;
  border-bottom-color: #fb923c;
}

[data-theme="dark"] .story-video-container,
[data-theme="dark"] .video-card {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .video-caption {
  background: #0f172a;
}

[data-theme="dark"] .video-caption strong {
  color: #f8fafc;
}

[data-theme="dark"] .video-caption span {
  color: #94a3b8;
}

[data-theme="dark"] .story-audio-bar {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .full-narration-title {
  color: #f8fafc;
}

[data-theme="dark"] .full-narration-sub {
  color: #94a3b8;
}

[data-theme="dark"] .story-image-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .vocab-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .vocab-character {
  color: #fb923c;
}

[data-theme="dark"] .vocab-pinyin {
  color: #38bdf8;
}

[data-theme="dark"] .vocab-meaning {
  color: #cbd5e1;
}

[data-theme="dark"] .exercise-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

/* Footer in Dark Mode */
[data-theme="dark"] .site-footer {
  background: #070d19;
  border-top-color: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .footer-chinese {
  color: #334155;
}

[data-theme="dark"] .footer-links a {
  color: #94a3b8;
}

[data-theme="dark"] .footer-links a:hover {
  color: #fb923c;
}

/* =========================================================
   UNIFIED PAGE HERO & SUB-PAGE TAB SWITCHERS
   (Matching lessons.html, games.html & story.html)
========================================================= */

.story-page-hero,
.page-hero-unified {
  padding: 56px 0 36px;
  text-align: center;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fef3c7 100%);
  border-bottom: 1.5px solid #fed7aa;
}

[data-theme="dark"] .story-page-hero,
[data-theme="dark"] .page-hero-unified {
  background: linear-gradient(135deg, #0b1120 0%, #1e1b4b 50%, #0f172a 100%);
  border-bottom-color: #334155;
}

.story-page-hero .eyebrow,
.page-hero-unified .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

[data-theme="dark"] .story-page-hero .eyebrow,
[data-theme="dark"] .page-hero-unified .eyebrow {
  background: #1e293b;
  border-color: #475569;
  color: #fb923c;
}

.story-page-hero h1,
.page-hero-unified h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 14px;
  line-height: 1.2;
}

[data-theme="dark"] .story-page-hero h1,
[data-theme="dark"] .page-hero-unified h1 {
  color: #f8fafc;
}

.story-page-hero p,
.page-hero-unified p {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
  color: #475569;
  line-height: 1.6;
}

[data-theme="dark"] .story-page-hero p,
[data-theme="dark"] .page-hero-unified p {
  color: #94a3b8;
}

/* Tab Switcher Bar (Pill style matching lessons.html) */
.audience-tab-bar,
.hero-tab-bar {
  display: inline-flex;
  background: #fed7aa;
  padding: 6px;
  border-radius: 9999px;
  margin: 24px auto 0;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.12);
}

[data-theme="dark"] .audience-tab-bar,
[data-theme="dark"] .hero-tab-bar {
  background: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.audience-tab,
.hero-tab-btn {
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #9a3412;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  white-space: nowrap;
}

[data-theme="dark"] .audience-tab,
[data-theme="dark"] .hero-tab-btn {
  color: #cbd5e1;
}

.audience-tab:hover,
.hero-tab-btn:hover {
  color: #c2410c;
  transform: translateY(-1px);
}

[data-theme="dark"] .audience-tab:hover,
[data-theme="dark"] .hero-tab-btn:hover {
  color: #ffffff;
}

.audience-tab.active,
.hero-tab-btn.active {
  background: #ffffff;
  color: #ea580c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

[data-theme="dark"] .audience-tab.active,
[data-theme="dark"] .hero-tab-btn.active {
  background: #0f172a;
  color: #fb923c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* Filter Chips & Track Pills (Matching lessons-adult.html) */
.track-pills,
.reels-filter-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px auto 0;
  max-width: 900px;
  padding: 4px;
}

@media (max-width: 640px) {
  .track-pills,
  .reels-filter-chips {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 6px 4px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .track-pills::-webkit-scrollbar,
  .reels-filter-chips::-webkit-scrollbar {
    display: none;
  }
}

.track-pill,
.filter-chip {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  color: #7c2d12;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .track-pill,
[data-theme="dark"] .filter-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.track-pill:hover,
.filter-chip:hover {
  border-color: #f97316;
  color: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

[data-theme="dark"] .track-pill:hover,
[data-theme="dark"] .filter-chip:hover {
  border-color: #fb923c;
  color: #ffffff;
}

.track-pill.active,
.filter-chip.active {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  border-color: #9a3412;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.35);
  transform: translateY(-2px);
}

[data-theme="dark"] .track-pill.active,
[data-theme="dark"] .filter-chip.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #fb923c;
  color: #ffffff;
}

/* =========================================================
   REELS SUB-PAGE GRID & VIDEO CARDS (9:16 VERTICAL)
========================================================= */

.reels-grid-section {
  padding: 40px 0 80px;
}

.reels-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid #fed7aa;
}

[data-theme="dark"] .reels-grid-header {
  border-bottom-color: #334155;
}

.reels-count-info {
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
}

[data-theme="dark"] .reels-count-info {
  color: #94a3b8;
}

.reels-count-info strong {
  color: #ea580c;
  font-weight: 900;
}

[data-theme="dark"] .reels-count-info strong {
  color: #fb923c;
}

.reels-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

@media (max-width: 640px) {
  .reels-video-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
}

.reel-video-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0f172a;
  border: 2px solid #fed7aa;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.09);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .reel-video-card {
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.reel-video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(249, 115, 22, 0.22);
  border-color: #f97316;
}

[data-theme="dark"] .reel-video-card:hover {
  border-color: #fb923c;
  box-shadow: 0 20px 48px rgba(251, 146, 60, 0.25);
}

.reel-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #0b1120;
}

.reel-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.reel-video-card:hover .reel-card-thumb-img {
  transform: scale(1.06);
}

.reel-card-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.55) 0%,
    rgba(15, 23, 42, 0.05) 35%,
    rgba(15, 23, 42, 0.35) 60%,
    rgba(15, 23, 42, 0.95) 100%
  );
  pointer-events: none;
}

.reel-card-top-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.reel-card-category-badge {
  background: rgba(234, 88, 12, 0.92);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reel-card-duration-badge {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.reel-card-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.92);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 2px solid rgba(255, 255, 255, 0.4);
  z-index: 3;
}

.reel-video-card:hover .reel-card-play-btn {
  transform: translate(-50%, -50%) scale(1.18);
  background: #ea580c;
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.65);
}

.reel-card-quick-actions {
  position: absolute;
  right: 12px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
}

.btn-reel-mini-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reel-mini-action:hover {
  transform: scale(1.15);
  background: #ea580c;
  border-color: #ea580c;
}

.btn-reel-mini-action.active {
  background: #fff1f2;
  border-color: #fda4af;
  color: #e11d48;
}

.reel-card-bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  z-index: 2;
  color: #ffffff;
  pointer-events: none;
}

.reel-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 2px;
  line-height: 1.25;
}

.reel-card-pinyin {
  font-size: 0.82rem;
  color: #fed7aa;
  font-weight: 700;
  margin: 0 0 4px;
}

.reel-card-snippet {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reels-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 20px;
  border: 2px dashed #fed7aa;
  max-width: 500px;
  margin: 40px auto;
}

[data-theme="dark"] .reels-empty-state {
  background: #1e293b;
  border-color: #475569;
}

.reels-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.reels-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: #0f172a;
}

[data-theme="dark"] .reels-empty-state h3 {
  color: #f8fafc;
}

.reels-empty-state p {
  color: #64748b;
  font-size: 0.92rem;
  margin: 0 0 16px;
}

[data-theme="dark"] .reels-empty-state p {
  color: #94a3b8;
}

/* =========================================================
   REEL MODAL OVERLAY PLAYER (#reelPlayerModal — QUAD-LANGUAGE SUBTITLES)
========================================================= */

#reelPlayerModal.reel-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10030;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#reelPlayerModal.reel-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#reelPlayerModal .reel-modal-container {
  background: #ffffff;
  border-radius: 26px;
  border: 2px solid #fed7aa;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
}

@media (max-width: 768px) {
  #reelPlayerModal .reel-modal-container {
    grid-template-columns: 1fr;
    max-height: 92dvh;
  }
}

[data-theme="dark"] #reelPlayerModal .reel-modal-container {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

#reelPlayerModal .reel-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  z-index: 10;
  transition: all 0.18s ease;
}

[data-theme="dark"] #reelPlayerModal .reel-modal-close {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

#reelPlayerModal .reel-modal-close:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

#reelPlayerModal .reel-modal-stage {
  position: relative;
  background: #0b1120;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: min(80vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 24px;
  border-bottom-left-radius: 24px;
  overflow: hidden;
}

@media (max-width: 768px) {
  #reelPlayerModal .reel-modal-stage {
    border-radius: 24px 24px 0 0;
    aspect-ratio: auto;
    height: min(46dvh, 380px);
    min-height: 220px;
  }
}

.reel-vertical-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#reelPlayerModal .reel-modal-floating-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 3;
}

.reel-duration-pill {
  background: rgba(0, 0, 0, 0.75);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
}

.reel-modal-content {
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reel-modal-heading {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 10px;
  line-height: 1.3;
}

[data-theme="dark"] .reel-modal-heading {
  color: #f8fafc;
}

.reel-modal-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-reel-action {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  color: #ea580c;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

[data-theme="dark"] .btn-reel-action {
  background: #334155;
  border-color: #475569;
  color: #fdba74;
}

.btn-reel-action:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.btn-reel-action.active {
  background: #fff1f2;
  border-color: #fda4af;
  color: #e11d48;
}

/* Subtitle Toggles & Quad Display */
.reel-sub-toggle-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
}

[data-theme="dark"] .reel-sub-toggle-bar {
  background: #0f172a;
  border-color: #334155;
}

.sub-toggle-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #9a3412;
  text-transform: uppercase;
}

[data-theme="dark"] .sub-toggle-label {
  color: #fdba74;
}

.sub-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .sub-chip {
  background: #1e293b;
  border-color: #475569;
  color: #94a3b8;
}

.sub-chip.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

[data-theme="dark"] .sub-chip.active {
  background: #f97316;
  border-color: #f97316;
}

.reel-quad-subtitles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
}

[data-theme="dark"] .reel-quad-subtitles {
  background: #0f172a;
  border-color: #334155;
}

.sub-line-cn {
  font-family: var(--font-kaiti);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ea580c;
  line-height: 1.4;
}

[data-theme="dark"] .sub-line-cn {
  color: #fb923c;
}

.sub-line-pinyin {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d97706;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .sub-line-pinyin {
  color: #38bdf8;
}

.sub-line-en {
  font-size: 0.98rem;
  color: #334155;
  font-weight: 600;
  line-height: 1.5;
}

[data-theme="dark"] .sub-line-en {
  color: #cbd5e1;
}

.sub-line-my {
  font-size: 0.98rem;
  color: #059669;
  font-weight: 600;
  line-height: 1.5;
}

[data-theme="dark"] .sub-line-my {
  color: #34d399;
}

/* =========================================================
   3-CATEGORY CURRICULUM SYSTEM & 3-SECTION LESSON WORKSPACE
   (Video Lesson, Practice Exercises, Writing & Stroke Order)
========================================================= */

/* Category Navigation Bar */
.curriculum-category-bar-wrap {
  margin: 28px 0 10px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.curriculum-category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  padding: 6px;
  border-radius: 9999px;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.curriculum-category-bar::-webkit-scrollbar {
  display: none;
}

[data-theme="dark"] .curriculum-category-bar {
  background: #1e293b;
  border-color: #334155;
}

.cat-pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #475569;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  flex-shrink: 0;
}

[data-theme="dark"] .cat-pill-btn {
  color: #94a3b8;
}

.cat-pill-btn:hover {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

[data-theme="dark"] .cat-pill-btn:hover {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
}

.cat-pill-btn.active {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

[data-theme="dark"] .cat-pill-btn.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}

/* Kids Track Category Pill Variation */
.kids-theme .curriculum-category-bar {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

[data-theme="dark"] .kids-theme .curriculum-category-bar {
  background: #064e3b;
  border-color: #047857;
}

.kids-theme .cat-pill-btn:hover {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
}

.kids-theme .cat-pill-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.cat-count-badge {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 800;
}

.cat-pill-btn.active .cat-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Lesson Grid Item Card Enhancements */
.lesson-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: all 0.25s ease;
}

[data-theme="dark"] .lesson-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lesson-card:hover {
  transform: translateY(-4px);
  border-color: #ea580c;
  box-shadow: 0 16px 36px rgba(234, 88, 12, 0.15);
}

[data-theme="dark"] .lesson-card:hover {
  border-color: #fb923c;
  box-shadow: 0 16px 36px rgba(251, 146, 60, 0.2);
}

.lesson-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.lesson-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.lesson-card:hover .lesson-card-image img {
  transform: scale(1.05);
}

.lesson-card-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.lesson-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 3px 9px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 8px;
}

[data-theme="dark"] .lesson-category-tag {
  background: #334155;
  color: #fdba74;
  border-color: #475569;
}

.lesson-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 4px 0 6px;
  line-height: 1.3;
}

[data-theme="dark"] .lesson-card h3 {
  color: #f8fafc;
}

.lesson-chinese-title {
  font-family: var(--font-kaiti);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ea580c;
  margin-bottom: 2px;
}

[data-theme="dark"] .lesson-chinese-title {
  color: #fb923c;
}

.lesson-pinyin {
  font-size: 0.88rem;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 4px;
}

[data-theme="dark"] .lesson-pinyin {
  color: #38bdf8;
}

.lesson-meaning {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 10px;
}

[data-theme="dark"] .lesson-meaning {
  color: #94a3b8;
}

.lesson-description {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

[data-theme="dark"] .lesson-description {
  color: #cbd5e1;
}

.lesson-features-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.lesson-feature-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

[data-theme="dark"] .lesson-feature-pill {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* =========================================================
   DEDICATED LESSON WORKSPACE & 3 CORE SECTIONS
========================================================= */

.lesson-workspace-container {
  display: none;
  animation: fadeInWorkspace 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 30px 0 80px;
}

.lesson-workspace-container.active {
  display: block;
}

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

.workspace-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-back-to-curriculum {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

[data-theme="dark"] .btn-back-to-curriculum {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.btn-back-to-curriculum:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  transform: translateX(-3px);
}

.workspace-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 700;
}

[data-theme="dark"] .workspace-breadcrumbs {
  color: #94a3b8;
}

.workspace-breadcrumbs span.sep {
  color: #cbd5e1;
}

/* Workspace Lesson Header Card */
.workspace-lesson-hero {
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 24px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .workspace-lesson-hero {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.workspace-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.workspace-level-badge {
  background: #ea580c;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
}

.workspace-category-badge {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
}

[data-theme="dark"] .workspace-category-badge {
  background: #0f172a;
  color: #fdba74;
  border-color: #475569;
}

.workspace-lesson-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.25;
}

[data-theme="dark"] .workspace-lesson-title {
  color: #f8fafc;
}

.workspace-chinese-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.workspace-chinese-text {
  font-family: var(--font-kaiti);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ea580c;
}

[data-theme="dark"] .workspace-chinese-text {
  color: #fb923c;
}

.workspace-pinyin-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #d97706;
}

[data-theme="dark"] .workspace-pinyin-text {
  color: #38bdf8;
}

.workspace-meaning-text {
  font-size: 0.95rem;
  color: #475569;
  font-style: italic;
}

[data-theme="dark"] .workspace-meaning-text {
  color: #94a3b8;
}

.workspace-description {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
  margin: 10px 0 0;
  max-width: 820px;
}

[data-theme="dark"] .workspace-description {
  color: #cbd5e1;
}

/* 4 Core Section Switcher Tabs - Floating Sticky Bar */
.workspace-tabs-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 74px;
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 10px;
  border-radius: 18px;
  margin-bottom: 28px;
  border: 1.5px solid #fed7aa;
  box-shadow: 0 8px 24px -4px rgba(249, 115, 22, 0.12), 0 2px 8px -1px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #fed7aa transparent;
  transition: box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.workspace-tabs-bar::-webkit-scrollbar {
  height: 4px;
}

.workspace-tabs-bar::-webkit-scrollbar-track {
  background: transparent;
}

.workspace-tabs-bar::-webkit-scrollbar-thumb {
  background: #fed7aa;
  border-radius: 10px;
}

[data-theme="dark"] .workspace-tabs-bar {
  background: rgba(15, 23, 42, 0.94);
  border-color: #334155;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 2px 8px -1px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .workspace-tabs-bar::-webkit-scrollbar-thumb {
  background: #475569;
}

.workspace-tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid transparent;
  color: #475569;
  font-size: 0.94rem;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

[data-theme="dark"] .workspace-tab-btn {
  color: #94a3b8;
}

.workspace-tab-btn:hover {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

[data-theme="dark"] .workspace-tab-btn:hover {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
}

.workspace-tab-btn.active {
  background: #ffffff;
  color: #ea580c;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
  border: 1.5px solid #f97316;
}

[data-theme="dark"] .workspace-tab-btn.active {
  background: #1e293b;
  color: #fb923c;
  border-color: #ea580c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}


/* Workspace Panels */
.workspace-panel {
  display: none;
  animation: fadeInPanel 0.25s ease;
}

.workspace-panel.active {
  display: block;
}

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

/* ---------------------------------------------------------
   SECTION 1: VIDEO LESSON STYLES
--------------------------------------------------------- */
.video-lesson-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.video-player-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .video-player-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.video-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(520px, 68vh);
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-frame-wrap video {
  width: 100%;
  height: 100%;
  max-height: min(520px, 68vh);
  object-fit: contain;
  display: block;
}

.video-controls-toolbar {
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

[data-theme="dark"] .video-controls-toolbar {
  background: #0f172a;
  border-top-color: #334155;
}

.video-quick-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-video-control {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-video-control {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

.btn-video-control:hover,
.btn-video-control.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

/* Transcript & Dialogue Breakdown Box */
.transcript-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  margin-top: 24px;
}

[data-theme="dark"] .transcript-card {
  background: #1e293b;
  border-color: #334155;
}

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

.transcript-header h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .transcript-header h4 {
  color: #f8fafc;
}

.dialogue-lines-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialogue-line-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

[data-theme="dark"] .dialogue-line-item {
  background: #0f172a;
  border-color: #334155;
}

.dialogue-text-content {
  flex-grow: 1;
}

.dialogue-chinese {
  font-family: var(--font-kaiti);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ea580c;
  margin-bottom: 2px;
}

[data-theme="dark"] .dialogue-chinese {
  color: #fb923c;
}

.dialogue-pinyin {
  font-size: 0.95rem;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 2px;
}

[data-theme="dark"] .dialogue-pinyin {
  color: #38bdf8;
}

.dialogue-english {
  font-size: 0.9rem;
  color: #475569;
}

[data-theme="dark"] .dialogue-english {
  color: #cbd5e1;
}

.btn-speak-line {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #ea580c;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-speak-line {
  background: #334155;
  border-color: #475569;
  color: #fdba74;
}

.btn-speak-line:hover {
  background: #ea580c;
  color: #ffffff;
  transform: scale(1.08);
}

/* ---------------------------------------------------------
   SECTION 2: PRACTICE EXERCISES STYLES
--------------------------------------------------------- */
.exercises-workspace {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .exercises-workspace {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #f1f5f9;
  padding-bottom: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

[data-theme="dark"] .quiz-header-bar {
  border-bottom-color: #334155;
}

.quiz-score-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quiz-progress-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
}

[data-theme="dark"] .quiz-progress-counter {
  color: #94a3b8;
}

.quiz-questions-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.quiz-card-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .quiz-card-item {
  background: #0f172a;
  border-color: #334155;
}

.quiz-question-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

[data-theme="dark"] .quiz-question-number {
  background: #334155;
  color: #fdba74;
  border-color: #475569;
}

.quiz-question-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 16px;
  line-height: 1.4;
}

[data-theme="dark"] .quiz-question-text {
  color: #f8fafc;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.quiz-option-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .quiz-option-btn {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: #ea580c;
  background: #fff7ed;
  transform: translateY(-2px);
}

[data-theme="dark"] .quiz-option-btn:hover:not(:disabled) {
  border-color: #fb923c;
  background: #334155;
}

.quiz-option-btn.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
}

[data-theme="dark"] .quiz-option-btn.correct {
  background: #064e3b !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
}

.quiz-option-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

[data-theme="dark"] .quiz-option-btn.incorrect {
  background: #7f1d1d !important;
  border-color: #ef4444 !important;
  color: #fecaca !important;
}

.quiz-feedback-box {
  display: none;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 14px;
  animation: fadeInPanel 0.2s ease;
}

[data-theme="dark"] .quiz-feedback-box {
  background: #1e293b;
  border-color: #475569;
}

.quiz-feedback-box.active {
  display: block;
}

.quiz-feedback-status {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-feedback-status.correct {
  color: #16a34a;
}

.quiz-feedback-status.incorrect {
  color: #dc2626;
}

.quiz-explanation-text {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

[data-theme="dark"] .quiz-explanation-text {
  color: #cbd5e1;
}

.quiz-reset-bar {
  text-align: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1.5px solid #e2e8f0;
}

[data-theme="dark"] .quiz-reset-bar {
  border-top-color: #334155;
}

.quiz-audio-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.quiz-shared-row-text .quiz-audio-bar {
  margin: 8px 0 0;
}

.quiz-audio-player {
  height: 36px;
  max-width: 280px;
  border-radius: 999px;
}

.quiz-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-tts-btn:hover {
  border-color: #ea580c;
  background: #fff7ed;
  color: #c2410c;
}

[data-theme="dark"] .quiz-tts-btn {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

[data-theme="dark"] .quiz-tts-btn:hover {
  border-color: #fb923c;
  background: #334155;
  color: #fdba74;
}

.quiz-listening-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin: 10px 0 16px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
}

.quiz-listening-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-listening-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-listening-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
}

.quiz-listening-play-btn.is-playing,
.quiz-listening-slow-btn.is-playing {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

.quiz-transcript-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.quiz-transcript-toggle:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

.quiz-listening-transcript {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px dashed #fdba74;
  font-size: 1rem;
  line-height: 1.5;
  color: #0f172a;
}

.quiz-transcript-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: #9a3412;
  margin-right: 6px;
}

.quiz-opt-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.quiz-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.84rem;
  flex-shrink: 0;
}

[data-theme="dark"] .quiz-listening-card {
  background: rgba(154, 52, 18, 0.16);
  border-color: rgba(251, 146, 60, 0.4);
}

[data-theme="dark"] .quiz-transcript-toggle {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

[data-theme="dark"] .quiz-listening-transcript {
  background: #0f172a;
  border-color: rgba(251, 146, 60, 0.45);
  color: #f8fafc;
}

[data-theme="dark"] .quiz-transcript-kicker {
  color: #fdba74;
}

[data-theme="dark"] .quiz-opt-letter {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.quiz-image-options-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.quiz-image-options-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quiz-image-options-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-image-option-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 10px;
  gap: 10px;
  border-radius: 16px;
}

.quiz-image-option-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .quiz-image-option-frame {
  background: #0f172a;
  border-color: #334155;
}

.quiz-image-option-frame img,
.quiz-picture-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quiz-image-option-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 4px;
  min-height: 28px;
}

.quiz-image-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
}

[data-theme="dark"] .quiz-image-option-letter {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.quiz-image-option-card.correct .quiz-image-option-letter {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.quiz-image-option-card.incorrect .quiz-image-option-letter {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.quiz-image-option-caption {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.quiz-picture-fallback {
  width: 100%;
  height: 100%;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

[data-theme="dark"] .quiz-picture-fallback {
  background: #1e293b;
  color: #94a3b8;
}

.quiz-shared-top-images {
  display: grid;
  gap: 14px;
  margin: 14px 0 22px;
  padding: 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
}

[data-theme="dark"] .quiz-shared-top-images {
  background: #1e293b;
  border-color: #334155;
}

.quiz-shared-top-images.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-shared-top-images.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quiz-shared-picture-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px;
}

[data-theme="dark"] .quiz-shared-picture-tile {
  background: #0f172a;
  border-color: #334155;
}

.quiz-picture-letter-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.quiz-picture-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .quiz-picture-frame {
  background: #1e293b;
}

.quiz-picture-caption {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  text-align: center;
  line-height: 1.35;
}

[data-theme="dark"] .quiz-picture-caption {
  color: #e2e8f0;
}

.quiz-shared-questions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-shared-question-row {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .quiz-shared-question-row {
  background: #1e293b;
  border-color: #334155;
}

.quiz-shared-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.quiz-shared-row-prompt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 260px;
}

.quiz-shared-row-num {
  font-size: 1rem;
  font-weight: 800;
  color: #ea580c;
  min-width: 24px;
  padding-top: 2px;
}

[data-theme="dark"] .quiz-shared-row-num {
  color: #fdba74;
}

.quiz-shared-row-text {
  flex: 1;
}

.quiz-shared-prompt-line {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

[data-theme="dark"] .quiz-shared-prompt-line {
  color: #f8fafc;
}

.quiz-shared-prompt-line.muted {
  color: #64748b;
  font-weight: 600;
  font-size: 0.94rem;
}

[data-theme="dark"] .quiz-shared-prompt-line.muted {
  color: #94a3b8;
}

.quiz-letter-choices {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-letter-btn {
  min-width: 52px;
  padding: 10px 14px;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
}

.quiz-letter-label {
  font-size: 0.98rem;
  font-weight: 800;
}

.quiz-shared-top-textbank {
  margin: 14px 0 22px;
  padding: 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  display: flex;
  gap: 10px;
}

.quiz-shared-top-textbank.is-word-bank {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.quiz-shared-top-textbank.is-sentence-bank {
  flex-direction: column;
}

[data-theme="dark"] .quiz-shared-top-textbank {
  background: #1e293b;
  border-color: #334155;
}

.quiz-shared-text-tile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
}

.quiz-shared-top-textbank.is-sentence-bank .quiz-shared-text-tile {
  width: 100%;
  justify-content: flex-start;
}

[data-theme="dark"] .quiz-shared-text-tile {
  background: #0f172a;
  border-color: #334155;
}

.quiz-shared-text-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-shared-text-value {
  font-size: 1.04rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

[data-theme="dark"] .quiz-shared-text-value {
  color: #f8fafc;
}

.quiz-shared-row-pinyin {
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
}

[data-theme="dark"] .quiz-shared-row-pinyin {
  color: #94a3b8;
}

.quiz-pinyin-cue-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  margin: 0 0 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

[data-theme="dark"] .quiz-pinyin-cue-bar {
  background: rgba(234, 88, 12, 0.16);
  border-color: #9a3412;
}

.quiz-pinyin-cue-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quiz-pinyin-cue-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .quiz-pinyin-cue-label {
  color: #fdba74;
}

[data-theme="dark"] .quiz-pinyin-cue-value {
  color: #f8fafc;
}

.quiz-inline-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 2px 10px;
  margin: 0 4px;
  border-radius: 8px;
  background: #fff7ed;
  border-bottom: 2.5px solid #ea580c;
  color: #c2410c;
  font-size: 0.92rem;
  font-weight: 700;
  vertical-align: baseline;
}

[data-theme="dark"] .quiz-inline-blank {
  background: rgba(234, 88, 12, 0.2);
  border-bottom-color: #fb923c;
  color: #fdba74;
}

.quiz-fill-answer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.quiz-fill-input {
  flex: 1 1 220px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.18rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-fill-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

.quiz-fill-input.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

.quiz-fill-input.incorrect {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

[data-theme="dark"] .quiz-fill-input {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

[data-theme="dark"] .quiz-fill-input.correct {
  background: #064e3b;
  border-color: #10b981;
  color: #a7f3d0;
}

[data-theme="dark"] .quiz-fill-input.incorrect {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

.quiz-fill-submit-btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.quiz-fill-submit-btn:hover:not(:disabled) {
  background: #c2410c;
  transform: translateY(-1px);
}

.quiz-fill-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 680px) {
  .quiz-image-options-grid.cols-3,
  .quiz-shared-top-images.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quiz-shared-row-main {
    flex-direction: column;
    align-items: stretch;
  }
  .quiz-fill-answer-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .quiz-fill-input {
    max-width: none;
  }
}

@media (max-width: 460px) {
  .quiz-image-options-grid.cols-2,
  .quiz-image-options-grid.cols-3,
  .quiz-shared-top-images.cols-2,
  .quiz-shared-top-images.cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   SECTION 3: WRITING & STROKE ORDER STYLES
--------------------------------------------------------- */
.writing-workspace {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .writing-workspace {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.writing-char-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.writing-char-picker-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: #64748b;
}

[data-theme="dark"] .writing-char-picker-label {
  color: #94a3b8;
}

.writing-char-chip {
  font-family: var(--font-kaiti);
  font-size: 1.35rem;
  font-weight: 800;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .writing-char-chip {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.writing-char-chip:hover {
  border-color: #ea580c;
  transform: translateY(-2px);
}

.writing-char-chip.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
  transform: scale(1.06);
}

[data-theme="dark"] .writing-char-chip.active {
  background: #f97316;
  border-color: #f97316;
}

.writing-stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  box-sizing: border-box;
  max-width: 100%;
}

@media (max-width: 900px) {
  .writing-stage-grid {
    grid-template-columns: 1fr;
  }
}

.writing-info-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  box-sizing: border-box;
}

.writing-character-hero-card {
  background: #fff7ed;
  border: 2px solid #fed7aa;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .writing-character-hero-card {
  background: #0f172a;
  border-color: #334155;
}

.char-giant-display {
  font-family: var(--font-kaiti);
  font-size: 4.8rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1;
  margin-bottom: 8px;
}

[data-theme="dark"] .char-giant-display {
  color: #fb923c;
}

.char-pinyin-badge {
  font-size: 1.3rem;
  font-weight: 800;
  color: #d97706;
  margin-bottom: 4px;
}

[data-theme="dark"] .char-pinyin-badge {
  color: #38bdf8;
}

.char-meaning-badge {
  font-size: 1rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 12px;
}

[data-theme="dark"] .char-meaning-badge {
  color: #cbd5e1;
}

.char-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.char-stat-pill {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #fed7aa;
  color: #c2410c;
}

[data-theme="dark"] .char-stat-pill {
  background: #1e293b;
  border-color: #475569;
  color: #fdba74;
}

.stroke-steps-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  box-sizing: border-box;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .stroke-steps-card {
  background: #0f172a;
  border-color: #334155;
}

.stroke-steps-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
}

[data-theme="dark"] .stroke-steps-card h4 {
  color: #f8fafc;
}

.stroke-steps-text {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .stroke-steps-text {
  color: #cbd5e1;
}

/* Canvas Writing Area with Mi-Zi-Ge (米字格) */
.writing-canvas-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.canvas-mizige-box {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  background: #fffdfa;
  border: 3px solid #ea580c;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.12);
  touch-action: none;
  overflow: hidden;
}

[data-theme="dark"] .canvas-mizige-box {
  background: #0f172a;
  border-color: #f97316;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.canvas-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(234, 88, 12, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(234, 88, 12, 0.18) 1px, transparent 1px);
  background-size: 50% 50%;
}

.canvas-ghost-character,
.fallback-ghost-char {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-kaiti);
  font-size: 210px;
  font-weight: 900;
  color: rgba(234, 88, 12, 0.28);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  transition: opacity 0.2s ease;
  z-index: 2;
}

[data-theme="dark"] .canvas-ghost-character,
[data-theme="dark"] .fallback-ghost-char {
  color: rgba(251, 146, 60, 0.35);
}

.canvas-ghost-character.hidden,
.fallback-ghost-char.hidden {
  opacity: 0;
  display: none !important;
}

#hanziWriterTarget {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

#hanziWriterTarget svg {
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

#strokeDrawCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

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

.stroke-error-shake {
  animation: strokeErrorShake 0.35s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-canvas-action {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-canvas-action {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.btn-canvas-action:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

/* =========================================================
   PRACTICE SCORE MODAL & STROKE ORDER UI STYLES
   ========================================================= */

.stroke-order-indicator-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  background: rgba(234, 88, 12, 0.08);
  border: 1.5px solid rgba(234, 88, 12, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.84rem;
  color: #9a3412;
  font-weight: 600;
  line-height: 1.45;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stroke-order-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stroke-order-step-rule {
  font-size: 0.74rem;
  font-weight: 700;
  color: #78716c;
  white-space: nowrap;
}

.stroke-order-hint-line {
  font-size: 0.83rem;
  line-height: 1.45;
  color: #7c2d12;
  word-break: break-word;
}

.stroke-order-indicator-bar.is-error {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
}

.stroke-order-indicator-bar.is-error .stroke-order-step-rule {
  color: #dc2626;
}

.stroke-order-indicator-bar.is-error .stroke-order-hint-line {
  color: #b91c1c;
}

.stroke-order-indicator-bar.is-complete {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(5, 150, 105, 0.4);
  color: #065f46;
}

.stroke-order-indicator-bar.is-complete .stroke-order-step-badge {
  background: #059669;
}

.stroke-order-indicator-bar.is-complete .stroke-order-hint-line {
  color: #047857;
}

[data-theme="dark"] .stroke-order-indicator-bar {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.32);
  color: #fed7aa;
}

[data-theme="dark"] .stroke-order-step-rule {
  color: #94a3b8;
}

[data-theme="dark"] .stroke-order-hint-line {
  color: #fed7aa;
}

[data-theme="dark"] .stroke-order-indicator-bar.is-error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

[data-theme="dark"] .stroke-order-indicator-bar.is-error .stroke-order-hint-line {
  color: #fecaca;
}

[data-theme="dark"] .stroke-order-indicator-bar.is-complete {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

[data-theme="dark"] .stroke-order-indicator-bar.is-complete .stroke-order-hint-line {
  color: #a7f3d0;
}

.stroke-order-step-badge {
  background: #ea580c;
  color: #ffffff;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stroke-live-scores-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 28px;
}

.stroke-live-badge {
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  color: #c2410c;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: monospace, monospace;
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  animation: strokeBadgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .stroke-live-badge {
  background: #292524;
  border-color: #ea580c;
  color: #fb923c;
}

@keyframes strokeBadgePop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Practice Result Modal Overlay */
.practice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(18, 15, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: practiceModalFadeIn 0.3s ease;
}

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

.practice-modal-card {
  background: #1c1917;
  color: #f5f5f4;
  border: 1px solid #292524;
  border-radius: 24px;
  padding: 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: practiceModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes practiceModalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.practice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.practice-modal-title {
  font-family: var(--font-kaiti);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f5f5f4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-modal-close-btn {
  background: transparent;
  border: none;
  color: #a8a29e;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.practice-modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Inner Light Card Frame */
.practice-modal-inner-frame {
  background: #fafaf9;
  background-image: radial-gradient(circle at center, #ffffff 0%, #fafaf9 100%);
  color: #1c1917;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid #f5d0fe;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 8px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

/* Background watermark ghost character */
.practice-inner-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-kaiti);
  font-size: 210px;
  font-weight: 900;
  color: rgba(28, 25, 23, 0.04);
  pointer-events: none;
  user-select: none;
}

.practice-stroke-badges-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.stroke-badge-pill {
  background: #fff7ed;
  border: 1.5px solid #f97316;
  color: #c2410c;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  font-family: monospace, monospace;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.1);
}

.practice-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.5rem;
  color: #f59e0b;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

.practice-star-empty {
  color: #d6d3d1;
}

/* Circular Score Ring */
.practice-ring-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.practice-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.practice-ring-bg {
  fill: none;
  stroke: #fee2e2;
  stroke-width: 9;
}

.practice-ring-progress {
  fill: none;
  stroke: #ef4444;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.practice-ring-center-text {
  position: absolute;
  font-size: 2.6rem;
  font-weight: 900;
  color: #ef4444;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -1px;
}

.practice-verdict-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ef4444;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

/* Name Input Box */
.practice-name-input-wrap {
  position: relative;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.practice-name-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #78716c;
  font-size: 1rem;
  pointer-events: none;
}

.practice-name-input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #d6d3d1;
  border-radius: 12px;
  padding: 10px 14px 10px 38px;
  font-size: 0.95rem;
  color: #292524;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.practice-name-input:focus {
  border-color: #ef4444;
}

/* Action Buttons Grid */
.practice-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.btn-practice-save {
  background: #a8736e;
  background-image: linear-gradient(135deg, #b97a74 0%, #945f5a 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(168, 115, 110, 0.3);
}

.btn-practice-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(168, 115, 110, 0.4);
}

.btn-practice-again {
  background: #a8736e;
  background-image: linear-gradient(135deg, #945f5a 0%, #7d4d48 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(125, 77, 72, 0.3);
}

.btn-practice-again:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(125, 77, 72, 0.4);
}

/* Bottom "Try another" Section */
.practice-try-another-section {
  text-align: center;
}

.practice-try-another-label {
  font-size: 0.85rem;
  color: #a8a29e;
  margin-bottom: 10px;
  font-weight: 600;
}

.practice-try-another-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.try-another-char-box {
  width: 52px;
  height: 52px;
  background: #292524;
  border: 1.5px solid #44403c;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-kaiti);
  font-size: 1.4rem;
  font-weight: 800;
  color: #e7e5e4;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.try-another-char-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 50% 50%;
  pointer-events: none;
}

.try-another-char-box:hover {
  border-color: #ea580c;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

/* =========================================================
   CONTINUE LESSON ACTIVE BANNER & EXCEL DATA MANAGER STYLES
   ========================================================= */

/* Continue Active Lesson Hero Card */
.continue-lesson-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #fdba74;
  border-radius: 20px;
  padding: 20px 24px;
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.12);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

[data-theme="dark"] .continue-lesson-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
  border-color: #4f46e5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.continue-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.continue-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.continue-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #7c2d12;
  margin: 0;
}

[data-theme="dark"] .continue-title {
  color: #e0e7ff;
}

.continue-chinese-title {
  font-family: var(--font-kaiti);
  font-size: 1.1rem;
  font-weight: 700;
  color: #c2410c;
}

[data-theme="dark"] .continue-chinese-title {
  color: #818cf8;
}

.continue-meta {
  font-size: 0.88rem;
  color: #9a3412;
  margin-top: 4px;
  font-weight: 600;
}

[data-theme="dark"] .continue-meta {
  color: #93c5fd;
}

.continue-action-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-continue-primary {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  transition: all 0.2s ease;
}

.btn-continue-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
}

.btn-continue-clear {
  background: rgba(0, 0, 0, 0.06);
  color: #78716c;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-continue-clear:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Excel Data Manager Button & Bar */
.data-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 24px;
}

.btn-excel-manager {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 10px 22px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
  transition: all 0.2s ease;
}

.btn-excel-manager:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Excel Manager Modal Backdrop & Card */
.excel-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.25s ease-out forwards;
}

.excel-modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1.5px solid #e2e8f0;
  padding: 28px;
}

[data-theme="dark"] .excel-modal-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.excel-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid #f1f5f9;
}

[data-theme="dark"] .excel-modal-header {
  border-bottom-color: #334155;
}

.excel-modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .excel-modal-title {
  color: #f8fafc;
}

.excel-modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.excel-modal-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.excel-grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 16px;
}

.excel-option-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .excel-option-box {
  background: #0f172a;
  border-color: #334155;
}

.excel-option-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .excel-option-title {
  color: #f8fafc;
}

.excel-option-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}

[data-theme="dark"] .excel-option-desc {
  color: #94a3b8;
}

.excel-file-input {
  width: 100%;
  padding: 10px;
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  cursor: pointer;
}

[data-theme="dark"] .excel-file-input {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

.btn-excel-action {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-excel-download {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-excel-download:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-excel-upload {
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.btn-excel-upload:hover {
  background: #c2410c;
  transform: translateY(-1px);
}

.btn-excel-reset {
  background: #64748b;
  color: #ffffff;
}

.btn-excel-reset:hover {
  background: #475569;
}

/* =========================================================
   STROKE ORDER RULES UI STYLES (HanziStroke Standard)
   ========================================================= */

.stroke-rule-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stroke-rule-badge-pill {
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.3);
  color: #c2410c;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .stroke-rule-badge-pill {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.35);
  color: #fb923c;
}

.btn-stroke-rules-trigger {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-stroke-rules-trigger {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

.btn-stroke-rules-trigger:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.stroke-rule-explanation {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #475569;
  background: #f8fafc;
  border-left: 3px solid #ea580c;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}

[data-theme="dark"] .stroke-rule-explanation {
  background: #0f172a;
  color: #94a3b8;
}

.stroke-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 12px;
}

.stroke-rule-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .stroke-rule-card {
  background: #0f172a;
  border-color: #334155;
}

.stroke-rule-card.Highlight {
  border-color: #ea580c;
  background: #fff7ed;
}

[data-theme="dark"] .stroke-rule-card.Highlight {
  background: rgba(234, 88, 12, 0.12);
  border-color: #ea580c;
}

.stroke-rule-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

[data-theme="dark"] .stroke-rule-card-title {
  color: #f1f5f9;
}

.stroke-rule-card-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 6px;
}

[data-theme="dark"] .stroke-rule-card-desc {
  color: #94a3b8;
}

.stroke-rule-card-example {
  font-size: 0.82rem;
  color: #ea580c;
  font-weight: 700;
}

/* =========================================================
   FLUID RESPONSIVE BREAKPOINTS & ULTRA-COMPACT (<360px) FIX
   Prevents sidebar, flyout menu, modals, and grid overflow
   ========================================================= */

@media (max-width: 360px) {
  html, body {
    overflow-x: clip !important;
    width: 100%;
    max-width: 100vw;
  }

  .container,
  .nav-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 6px !important;
  }

  .logo-text {
    font-size: 1.05rem !important;
  }

  .site-brand-logo-img {
    height: 30px;
    max-width: 140px;
  }

  .main-nav {
    position: fixed !important;
    top: 56px !important;
    left: 6px !important;
    right: 6px !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    padding: 12px 10px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    z-index: 1005 !important;
  }

  .hide-menu-tools {
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .hide-menu-streak-card,
  .hide-menu-level-card,
  .hide-menu-reminder-wrap {
    padding: 8px 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .hide-menu-link {
    padding: 8px 10px !important;
    font-size: 0.88rem !important;
  }

  .writing-stage-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .canvas-mizige-box {
    width: 100% !important;
    max-width: 270px !important;
    height: 270px !important;
    margin: 0 auto !important;
  }

  .canvas-mizige-box canvas,
  #hanziWriterTarget,
  #hanziWriterTarget svg {
    width: 100% !important;
    max-width: 270px !important;
    height: 270px !important;
  }

  .lesson-grid,
  .curriculum-grid,
  .games-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .lesson-card,
  .embedded-game-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .modal-content,
  .quiz-modal-card,
  .reminder-modal-card,
  .practice-result-card,
  .writing-workspace {
    width: calc(100vw - 14px) !important;
    max-width: calc(100vw - 14px) !important;
    padding: 12px 8px !important;
    margin: 6px auto !important;
    box-sizing: border-box !important;
  }

  .theme-toggle-btn,
  .menu-toggle {
    width: 36px !important;
    height: 36px !important;
    padding: 0 6px !important;
  }

  .menu-toggle-label {
    display: none !important;
  }

  .char-giant-display {
    font-size: 3.8rem !important;
  }
}

/* =========================================================
   SECTION 4: PRONUNCIATION CHECK (Web Speech API)
   ========================================================= */

.pronunciation-workspace {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  margin-bottom: 30px;
  transition: all 0.25s ease;
}

[data-theme="dark"] .pronunciation-workspace {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.pron-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 24px;
}

[data-theme="dark"] .pron-top-bar {
  border-color: #334155;
}

.pron-badges-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pron-badge-topic {
  background: #ffedd5;
  color: #c2410c;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #fed7aa;
}

[data-theme="dark"] .pron-badge-topic {
  background: rgba(234, 88, 12, 0.2);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.3);
}

.pron-badge-step {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 9999px;
}

[data-theme="dark"] .pron-badge-step {
  background: #334155;
  color: #cbd5e1;
}

.pron-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pron-dot-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

[data-theme="dark"] .pron-dot-btn {
  background: #0f172a;
  border-color: #475569;
  color: #94a3b8;
}

.pron-dot-btn:hover {
  border-color: #ea580c;
  color: #ea580c;
  transform: translateY(-1px);
}

.pron-dot-btn.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.35);
}

.pron-dot-btn.completed {
  border-color: #10b981;
  color: #10b981;
  background: #ecfdf5;
}

[data-theme="dark"] .pron-dot-btn.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
}

/* Target Sentence Card */
.pron-target-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .pron-target-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: #334155;
}

.pron-target-pinyin {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ea580c;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .pron-target-pinyin {
  color: #fb923c;
}

.pron-target-chinese {
  font-size: 2.3rem;
  line-height: 1.4;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  font-family: 'KaiTi', 'STKaiti', '楷体', 'Kaiti SC', 'Ma Shan Zheng', serif;
  letter-spacing: 0.04em;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .pron-target-chinese {
  color: #f8fafc;
}

.pron-target-meaning {
  font-size: 1.1rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 20px;
}

[data-theme="dark"] .pron-target-meaning {
  color: #94a3b8;
}

.pron-audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-pron-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-pron-audio {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.btn-pron-audio:hover {
  border-color: #ea580c;
  color: #ea580c;
  background: #fff7ed;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-pron-audio:hover {
  background: rgba(234, 88, 12, 0.15);
  border-color: #fb923c;
  color: #fb923c;
}

/* Microphone & Recording Console */
.pron-mic-console {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: #fafaf9;
  border: 2px dashed #d6d3d1;
  border-radius: 20px;
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

[data-theme="dark"] .pron-mic-console {
  background: #141f32;
  border-color: #334155;
}

.pron-mic-console.is-recording {
  border-color: #ea580c;
  border-style: solid;
  background: #fff7ed;
}

[data-theme="dark"] .pron-mic-console.is-recording {
  background: rgba(234, 88, 12, 0.1);
  border-color: #ea580c;
}

.pron-mic-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.pron-mic-pulse-ring {
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  border: 3px solid rgba(234, 88, 12, 0.4);
  opacity: 0;
  pointer-events: none;
}

.is-recording .pron-mic-pulse-ring {
  animation: micPulse 1.6s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes micPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.pron-mic-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 20px -3px rgba(234, 88, 12, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 2;
}

.pron-mic-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 26px -3px rgba(234, 88, 12, 0.55);
}

.pron-mic-btn:active {
  transform: scale(0.96);
}

.is-recording .pron-mic-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.5);
  animation: recordingPulse 1.2s ease-in-out infinite alternate;
}

@keyframes recordingPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.pron-mic-status-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

[data-theme="dark"] .pron-mic-status-text {
  color: #f1f5f9;
}

.is-recording .pron-mic-status-text {
  color: #dc2626;
  font-weight: 800;
}

[data-theme="dark"] .is-recording .pron-mic-status-text {
  color: #f87171;
}

.pron-mic-hint {
  font-size: 0.9rem;
  color: #64748b;
  max-width: 440px;
}

[data-theme="dark"] .pron-mic-hint {
  color: #94a3b8;
}

/* Sound Wave Bars Animation */
.pron-sound-wave-bars {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  margin: 12px 0 6px;
}

.is-recording .pron-sound-wave-bars {
  display: flex;
}

.pron-wave-bar {
  width: 4px;
  background: #ea580c;
  border-radius: 9999px;
  height: 6px;
  animation: soundWaveBounce 1s ease-in-out infinite alternate;
}

.pron-wave-bar:nth-child(1) { animation-delay: 0.1s; height: 10px; }
.pron-wave-bar:nth-child(2) { animation-delay: 0.3s; height: 24px; }
.pron-wave-bar:nth-child(3) { animation-delay: 0.5s; height: 18px; }
.pron-wave-bar:nth-child(4) { animation-delay: 0.2s; height: 26px; }
.pron-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 12px; }

@keyframes soundWaveBounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.4); }
}

.pron-interim-box {
  display: none;
  margin-top: 14px;
  padding: 8px 16px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  font-size: 0.95rem;
  color: #ea580c;
  font-weight: 600;
  max-width: 90%;
}

[data-theme="dark"] .pron-interim-box {
  background: #0f172a;
  border-color: rgba(234, 88, 12, 0.4);
}

.is-recording .pron-interim-box {
  display: inline-block;
}

/* Feedback & Score Results Container */
.pron-feedback-container {
  display: none;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 26px;
  margin-top: 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  animation: fadeInFeedback 0.35s ease forwards;
}

[data-theme="dark"] .pron-feedback-container {
  background: #0f172a;
  border-color: #334155;
}

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

.pron-score-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 22px;
}

[data-theme="dark"] .pron-score-hero {
  border-color: #1e293b;
}

.pron-score-pill-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pron-score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 8px 20px;
  border-radius: 9999px;
  font-weight: 900;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pron-score-pill.score-excellent {
  background: #ecfdf5;
  color: #059669;
  border: 2px solid #10b981;
}

[data-theme="dark"] .pron-score-pill.score-excellent {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #10b981;
}

.pron-score-pill.score-good {
  background: #f0fdf4;
  color: #16a34a;
  border: 2px solid #22c55e;
}

[data-theme="dark"] .pron-score-pill.score-good {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: #22c55e;
}

.pron-score-pill.score-fair {
  background: #fffbeb;
  color: #d97706;
  border: 2px solid #f59e0b;
}

[data-theme="dark"] .pron-score-pill.score-fair {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: #f59e0b;
}

.pron-score-pill.score-needs-work {
  background: #fff1f2;
  color: #e11d48;
  border: 2px solid #f43f5e;
}

[data-theme="dark"] .pron-score-pill.score-needs-work {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border-color: #f43f5e;
}

.pron-score-pill .unit {
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.85;
}

.pron-score-details h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
}

[data-theme="dark"] .pron-score-details h3 {
  color: #f8fafc;
}

.pron-score-details p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

[data-theme="dark"] .pron-score-details p {
  color: #94a3b8;
}

/* Accuracy Progress Bar */
.pron-progress-meter {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 24px;
}

[data-theme="dark"] .pron-progress-meter {
  background: #334155;
}

.pron-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pron-progress-fill.fill-excellent { background: linear-gradient(90deg, #10b981 0%, #059669 100%); }
.pron-progress-fill.fill-good { background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); }
.pron-progress-fill.fill-fair { background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%); }
.pron-progress-fill.fill-needs-work { background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%); }

/* Word-by-Word Character Highlight Grid */
.pron-breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pron-breakdown-heading h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .pron-breakdown-heading h4 {
  color: #e2e8f0;
}

.pron-breakdown-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pron-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pron-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pron-legend-dot.green { background: #10b981; }
.pron-legend-dot.amber { background: #f59e0b; }
.pron-legend-dot.red { background: #f43f5e; }

.pron-char-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  justify-content: center;
}

.pron-char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 10px 8px 8px;
  border-radius: 12px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.pron-char-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.pron-char-pinyin {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1;
}

.pron-char-text {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  font-family: 'KaiTi', 'STKaiti', '楷体', 'Kaiti SC', 'Ma Shan Zheng', serif;
}

.pron-char-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  margin-top: 4px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Match Styles */
.pron-char-card.match {
  background: #ecfdf5;
  border-color: #10b981;
}

.pron-char-card.match .pron-char-pinyin { color: #047857; }
.pron-char-card.match .pron-char-text { color: #065f46; }
.pron-char-card.match .pron-char-badge {
  background: #d1fae5;
  color: #047857;
}

[data-theme="dark"] .pron-char-card.match {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}
[data-theme="dark"] .pron-char-card.match .pron-char-pinyin { color: #6ee7b7; }
[data-theme="dark"] .pron-char-card.match .pron-char-text { color: #a7f3d0; }
[data-theme="dark"] .pron-char-card.match .pron-char-badge {
  background: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Close / Near Match Styles */
.pron-char-card.close {
  background: #fffbeb;
  border-color: #f59e0b;
}

.pron-char-card.close .pron-char-pinyin { color: #b45309; }
.pron-char-card.close .pron-char-text { color: #92400e; }
.pron-char-card.close .pron-char-badge {
  background: #fef3c7;
  color: #b45309;
}

[data-theme="dark"] .pron-char-card.close {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
}
[data-theme="dark"] .pron-char-card.close .pron-char-pinyin { color: #fcd34d; }
[data-theme="dark"] .pron-char-card.close .pron-char-text { color: #fde68a; }
[data-theme="dark"] .pron-char-card.close .pron-char-badge {
  background: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Missed / Incorrect Styles */
.pron-char-card.miss {
  background: #fff1f2;
  border-color: #f43f5e;
}

.pron-char-card.miss .pron-char-pinyin { color: #be123c; }
.pron-char-card.miss .pron-char-text { color: #9f1239; }
.pron-char-card.miss .pron-char-badge {
  background: #ffe4e6;
  color: #be123c;
}

[data-theme="dark"] .pron-char-card.miss {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
}
[data-theme="dark"] .pron-char-card.miss .pron-char-pinyin { color: #fda4af; }
[data-theme="dark"] .pron-char-card.miss .pron-char-text { color: #fecdd3; }
[data-theme="dark"] .pron-char-card.miss .pron-char-badge {
  background: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* Comparison View */
.pron-compare-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 0.95rem;
  box-sizing: border-box;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

[data-theme="dark"] .pron-compare-box {
  background: #141f32;
  border-color: #334155;
}

.pron-compare-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.pron-compare-row:last-child {
  margin-bottom: 0;
}

.pron-compare-label {
  min-width: 130px;
  font-weight: 700;
  color: #64748b;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .pron-compare-label {
  color: #94a3b8;
}

.pron-compare-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
  overflow-wrap: break-word;
  flex: 1;
}

[data-theme="dark"] .pron-compare-val {
  color: #f8fafc;
}

/* Action Buttons */
.pron-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-pron-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .btn-pron-retry {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.btn-pron-retry:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="dark"] .btn-pron-retry:hover {
  background: #334155;
  color: #ffffff;
}

.btn-pron-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
  transition: all 0.2s ease;
}

.btn-pron-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
}

/* Manual Testing / Fallback Box */
.pron-manual-test-wrap {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: #64748b;
}

[data-theme="dark"] .pron-manual-test-wrap {
  border-color: #334155;
  color: #94a3b8;
}

.pron-manual-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 500px;
}

.pron-manual-input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
}

[data-theme="dark"] .pron-manual-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.pron-manual-input:focus {
  border-color: #ea580c;
}

.btn-pron-evaluate {
  padding: 8px 16px;
  border-radius: 8px;
  background: #ea580c;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pron-evaluate:hover {
  background: #c2410c;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Sticky Workspace Tabs on Mobile */
  .workspace-tabs-bar {
    top: 66px;
    padding: 6px 8px;
    border-radius: 14px;
    gap: 8px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .workspace-tab-btn {
    min-width: 145px;
    font-size: 0.88rem;
    padding: 10px 14px;
    gap: 6px;
    scroll-snap-align: start;
  }

  .pronunciation-workspace {
    padding: 20px 16px;
  }
  .pron-target-chinese {
    font-size: 1.8rem;
  }
  .pron-target-pinyin {
    font-size: 1.1rem;
  }
  .pron-char-card {
    min-width: 56px;
    padding: 6px 4px 6px;
  }
  .pron-char-text {
    font-size: 1.6rem;
  }
  .pron-score-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .workspace-tabs-bar {
    top: 64px;
    padding: 5px 6px;
    border-radius: 12px;
    gap: 6px;
  }
  .workspace-tab-btn {
    min-width: 135px;
    font-size: 0.82rem;
    padding: 8px 10px;
  }
}

/* =========================================================
   ACCOUNT BUTTON, AUTH MODAL, MEMBERSHIP & PRICING UI
   ========================================================= */

.account-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 12px 5px 6px;
  border-radius: 9999px;
  border: 1.5px solid #fed7aa;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.08);
  flex-shrink: 0;
}

.account-header-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  transform: translateY(-1px);
}

.account-header-btn:focus-visible {
  outline: 2.5px solid #ea580c;
  outline-offset: 2px;
}

[data-theme="dark"] .account-header-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .account-header-btn:hover {
  background: #334155;
  border-color: #fb923c;
}

.account-avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-avatar-guest {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

[data-theme="dark"] .account-avatar-guest {
  background: #0f172a;
  color: #fb923c;
  border-color: #475569;
}

.account-btn-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.account-btn-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: inherit;
}

.account-btn-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ea580c;
}

[data-theme="dark"] .account-btn-status {
  color: #fdba74;
}

.hide-menu-account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
  background: #fff7ed;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.hide-menu-account-btn:hover {
  border-color: #f97316;
}

[data-theme="dark"] .hide-menu-account-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

/* Modal Backdrop & Container */
body.lp-modal-open {
  overflow: hidden;
}

.lp-auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10020;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lp-auth-backdrop.is-open {
  display: flex;
}

.lp-auth-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 26px 28px;
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .lp-auth-card {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.lp-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.lp-modal-eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ea580c;
  margin-bottom: 4px;
}

[data-theme="dark"] .lp-modal-eyebrow {
  color: #fb923c;
}

.lp-modal-header h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
}

.lp-modal-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lp-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}

[data-theme="dark"] .lp-modal-close {
  background: #0f172a;
  color: #cbd5e1;
}

.lp-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 5px;
  background: #f1f5f9;
  border-radius: 12px;
  margin-bottom: 18px;
}

[data-theme="dark"] .lp-tabs-bar {
  background: #0f172a;
}

.lp-tab-btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lp-tab-btn.active {
  background: #ffffff;
  color: #ea580c;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .lp-tab-btn {
  color: #94a3b8;
}

[data-theme="dark"] .lp-tab-btn.active {
  background: #1e293b;
  color: #fb923c;
}

.lp-feedback {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 14px;
}

.lp-feedback-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.lp-feedback-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.lp-feedback-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

[data-theme="dark"] .lp-feedback-error {
  background: rgba(127, 29, 29, 0.4);
  color: #fecaca;
  border-color: #991b1b;
}

[data-theme="dark"] .lp-feedback-success {
  background: rgba(6, 78, 59, 0.4);
  color: #a7f3d0;
  border-color: #065f46;
}

[data-theme="dark"] .lp-feedback-info {
  background: rgba(30, 58, 138, 0.4);
  color: #bfdbfe;
  border-color: #1d4ed8;
}

.lp-context-callout {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

[data-theme="dark"] .lp-context-callout {
  background: rgba(234, 88, 12, 0.16);
  border-color: #9a3412;
  color: #fdba74;
}

/* Forms */
.lp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

[data-theme="dark"] .lp-field label {
  color: #cbd5e1;
}

.lp-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lp-age-readout {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ea580c;
}

[data-theme="dark"] .lp-age-readout {
  color: #fb923c;
}

.lp-field input,
.lp-field select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.lp-field input:disabled {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.lp-field input:focus,
.lp-field select:focus {
  border-color: #f97316;
}

[data-theme="dark"] .lp-field input,
[data-theme="dark"] .lp-field select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .lp-field input:disabled {
  background: #172033;
  color: #94a3b8;
}

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.lp-btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 0.84rem;
}

.lp-btn-full {
  width: 100%;
}

.lp-btn-primary {
  background: #ea580c;
  color: #ffffff;
}

.lp-btn-primary:hover {
  background: #c2410c;
}

.lp-btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.lp-btn-secondary:hover {
  background: #e2e8f0;
}

[data-theme="dark"] .lp-btn-secondary {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

.lp-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #ea580c;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

[data-theme="dark"] .lp-link-btn {
  color: #fb923c;
}

.lp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  font-size: 0.8rem;
  color: #64748b;
}

.lp-divider::before,
.lp-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

[data-theme="dark"] .lp-divider::before,
[data-theme="dark"] .lp-divider::after {
  background: #334155;
}

.lp-btn-google {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.lp-btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

[data-theme="dark"] .lp-btn-google {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.lp-btn-google-top {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lp-btn-google-top:hover:not(:disabled) {
  border-color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}

.lp-btn-google:disabled {
  opacity: 0.65;
  cursor: wait;
}

.lp-console-guide {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  font-weight: 500;
}

[data-theme="dark"] .lp-console-guide {
  border-top-color: rgba(248, 250, 252, 0.14);
}

.lp-console-guide-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.lp-console-guide-list {
  margin: 0 0 10px 18px;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.lp-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lp-domain-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .lp-domain-copy-row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(248, 250, 252, 0.16);
}

.lp-domain-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

[data-theme="dark"] .lp-domain-pill {
  color: #f8fafc;
}

/* Membership Card & Providers */
.lp-membership-card {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}

.lp-membership-card.lp-membership-active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #064e3b;
}

.lp-membership-card.lp-membership-pending {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

.lp-membership-card.lp-membership-expired {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

[data-theme="dark"] .lp-membership-card {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .lp-membership-card.lp-membership-active {
  background: rgba(6, 78, 59, 0.45);
  border-color: #059669;
  color: #ecfdf5;
}

[data-theme="dark"] .lp-membership-card.lp-membership-pending {
  background: rgba(120, 53, 15, 0.4);
  border-color: #d97706;
  color: #fef3c7;
}

.lp-membership-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.lp-membership-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
  margin-bottom: 3px;
}

.lp-membership-card h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 800;
}

.lp-membership-card p {
  margin: 0;
  font-size: 0.86rem;
  opacity: 0.9;
}

.lp-membership-extra {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.15);
  font-size: 0.82rem;
  font-weight: 600;
}

.lp-verify-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: #b45309;
}

.lp-verify-tag.is-verified {
  color: #059669;
}

.lp-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lp-btn-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-providers-box,
.lp-history-box,
.lp-qr-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

[data-theme="dark"] .lp-providers-box,
[data-theme="dark"] .lp-history-box,
[data-theme="dark"] .lp-qr-box {
  background: #0f172a;
  border-color: #334155;
}

.lp-providers-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.lp-providers-header span,
.lp-muted {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}

[data-theme="dark"] .lp-providers-header span,
[data-theme="dark"] .lp-muted {
  color: #94a3b8;
}

.lp-providers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.lp-provider-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lp-provider-state {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 700;
}

.lp-provider-state.is-connected {
  color: #059669;
}

.lp-account-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

[data-theme="dark"] .lp-account-footer {
  border-top-color: #334155;
}

/* Plan Cards & Contact QR Step */
.lp-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 600px) {
  .lp-plan-grid {
    grid-template-columns: 1fr;
  }
}

.lp-plan-card {
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-plan-card.is-selected {
  border-color: #ea580c;
  background: #fff7ed;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.14);
}

.lp-plan-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.lp-plan-price {
  font-weight: 800;
  color: #ea580c;
  font-size: 0.95rem;
}

.lp-plan-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

[data-theme="dark"] .lp-plan-card {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .lp-plan-card.is-selected {
  background: rgba(234, 88, 12, 0.16);
  border-color: #fb923c;
}

[data-theme="dark"] .lp-plan-card p {
  color: #94a3b8;
}

.lp-qr-box h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.lp-contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.lp-contact-card {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

[data-theme="dark"] .lp-contact-card {
  background: #1e293b;
  border-color: #334155;
}

.lp-contact-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
}

.lp-contact-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.lp-pending-banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
  font-size: 0.84rem;
}

[data-theme="dark"] .lp-pending-banner {
  background: rgba(120, 53, 15, 0.35);
  color: #fef3c7;
  border-color: #d97706;
}

/* Request History & Admin Lists */
.lp-request-list,
.lp-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.lp-request-item,
.lp-admin-req-card,
.lp-admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

[data-theme="dark"] .lp-request-item,
[data-theme="dark"] .lp-admin-req-card,
[data-theme="dark"] .lp-admin-user-row {
  background: #0f172a;
  border-color: #334155;
}

.lp-request-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.lp-request-meta {
  font-size: 0.78rem;
  color: #64748b;
}

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

.lp-status-text {
  font-size: 0.76rem;
  font-weight: 800;
}

.lp-status-pending {
  color: #d97706;
}

.lp-status-approved {
  color: #059669;
}

.lp-status-rejected {
  color: #dc2626;
}

.lp-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .lp-admin-toolbar {
  background: rgba(234, 88, 12, 0.14);
  border-color: #9a3412;
}

.lp-admin-section {
  margin-top: 18px;
}

.lp-admin-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
}

.lp-admin-req-info,
.lp-admin-user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.84rem;
}

.lp-admin-req-note {
  font-style: italic;
  color: #64748b;
}

.lp-admin-req-actions,
.lp-admin-user-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lp-inline-select,
.lp-inline-date,
.lp-inline-price {
  min-height: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.82rem;
}

[data-theme="dark"] .lp-inline-select,
[data-theme="dark"] .lp-inline-date,
[data-theme="dark"] .lp-inline-price {
  background: #1e293b;
  border-color: #475569;
  color: #f8fafc;
}

/* Lesson Card Pricing & Gating UI */
.curriculum-manage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: 14px;
  border: 1px solid var(--border-card, #fed7aa);
  background: var(--bg-surface, #ffffff);
  flex-wrap: wrap;
}

[data-theme="dark"] .curriculum-manage-bar {
  background: #1e293b;
  border-color: #334155;
}

.curriculum-access-summary {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.curriculum-manage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-manage-inline {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-manage-inline:hover {
  border-color: #f97316;
  color: #ea580c;
}

.btn-manage-upgrade {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}

.btn-manage-upgrade:hover {
  background: #c2410c;
  color: #ffffff;
}

[data-theme="dark"] .btn-manage-inline:not(.btn-manage-upgrade) {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}

.lesson-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.lesson-access-tag {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lesson-access-tag.is-free {
  color: #059669;
}

.lesson-access-tag.is-paid {
  color: #b45309;
}

.lesson-access-tag.is-unlocked {
  color: #0284c7;
}

.lesson-access-tag.is-practice {
  color: #7c3aed;
}

[data-theme="dark"] .lesson-access-tag.is-free {
  color: #34d399;
}

[data-theme="dark"] .lesson-access-tag.is-paid {
  color: #fbbf24;
}

[data-theme="dark"] .lesson-access-tag.is-unlocked {
  color: #38bdf8;
}

[data-theme="dark"] .lesson-access-tag.is-practice {
  color: #c4b5fd;
}

.lesson-features-line {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin: 10px 0 14px;
}

.lesson-button-locked {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1.5px solid #334155 !important;
}

.lesson-button-locked:hover {
  background: #ea580c !important;
  border-color: #ea580c !important;
}

/* Excel Upload Pricing Table */
.excel-option-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.excel-pricing-table {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.excel-pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

[data-theme="dark"] .excel-pricing-row {
  background: #0f172a;
  border-color: #334155;
}

.excel-pricing-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
}

.excel-pricing-info span {
  font-size: 0.76rem;
  color: #64748b;
}

.excel-pricing-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.excel-price-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.lp-inline-price {
  width: 90px;
  min-width: 84px;
}

/* Toast Notifications */
.lp-toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lp-toast-success {
  background: #059669;
}

.lp-toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

@media (max-width: 600px) {
  .lp-auth-card {
    padding: 20px 16px;
  }
  .lp-form-grid-2,
  .lp-contact-cards {
    grid-template-columns: 1fr;
  }
  .account-btn-text-wrap {
    max-width: 92px;
  }
  .account-btn-status {
    display: none;
  }
}

/* Logged-in Only Menu Tools Wrapper */
#hideMenuMemberTools[hidden] {
  display: none !important;
}

/* Lesson Review Popup Modal (Open to all visitors after finishing a lesson) */
.lp-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10025;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.lp-review-backdrop.is-open {
  display: flex;
}

.lp-review-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 26px;
}

[data-theme="dark"] .lp-review-card {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

.lp-review-lesson-subtitle {
  margin: 0 0 14px;
  font-size: 0.94rem;
  color: #475569;
}

[data-theme="dark"] .lp-review-lesson-subtitle {
  color: #cbd5e1;
}

.lp-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-review-rating-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ea580c;
}

.lp-star-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-star-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lp-star-btn:hover,
.lp-star-btn.is-active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: #fffbeb;
}

.lp-star-btn:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

[data-theme="dark"] .lp-star-btn {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
}

[data-theme="dark"] .lp-star-btn:hover,
[data-theme="dark"] .lp-star-btn.is-active {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

.lp-form textarea {
  width: 100%;
  min-height: 104px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  resize: vertical;
}

.lp-form textarea:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

[data-theme="dark"] .lp-form textarea {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.lp-review-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.lp-review-sent-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 10px 4px 4px;
}

.lp-review-sent-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

[data-theme="dark"] .lp-review-sent-icon {
  background: rgba(234, 88, 12, 0.16);
  border-color: rgba(251, 146, 60, 0.35);
}

.lp-review-sent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

/* Lesson Finish & Review Bars */
.workspace-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-workspace-finish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid #ea580c;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-workspace-finish:hover {
  background: #ea580c;
  color: #ffffff;
}

[data-theme="dark"] .btn-workspace-finish {
  background: rgba(234, 88, 12, 0.16);
  color: #fdba74;
  border-color: #fb923c;
}

[data-theme="dark"] .btn-workspace-finish:hover {
  background: #ea580c;
  color: #ffffff;
}

.workspace-complete-bar,
.story-complete-review-bar {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.workspace-complete-bar > div,
.story-complete-review-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workspace-complete-bar strong,
.story-complete-review-copy strong {
  font-size: 0.98rem;
  color: #0f172a;
}

.workspace-complete-bar span,
.story-complete-review-copy span {
  font-size: 0.86rem;
  color: #64748b;
}

[data-theme="dark"] .workspace-complete-bar,
[data-theme="dark"] .story-complete-review-bar {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .workspace-complete-bar strong,
[data-theme="dark"] .story-complete-review-copy strong {
  color: #f8fafc;
}

[data-theme="dark"] .workspace-complete-bar span,
[data-theme="dark"] .story-complete-review-copy span {
  color: #cbd5e1;
}

@media (max-width: 600px) {
  .lp-review-card {
    padding: 20px 16px;
  }
  .lp-review-footer-actions {
    flex-direction: column-reverse;
  }
  .lp-review-footer-actions .lp-btn {
    width: 100%;
  }
}

/* =========================================================
   ADMIN PORTAL HEADER LINK & HOMEPAGE FEATURED STORIES
========================================================= */

.header-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1.5px solid #ea580c;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.header-admin-btn:hover {
  background: #ea580c;
  color: #ffffff;
}

.header-admin-btn[hidden],
.hide-menu-admin-link[hidden] {
  display: none !important;
}

[data-theme="dark"] .header-admin-btn {
  background: rgba(234, 88, 12, 0.18);
  color: #fdba74;
  border-color: #fb923c;
}

[data-theme="dark"] .header-admin-btn:hover {
  background: #ea580c;
  color: #ffffff;
}

@media (max-width: 720px) {
  .header-admin-btn span:last-child {
    display: none;
  }
  .header-admin-btn {
    padding: 7px 10px;
  }
}

.featured-stories-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.featured-stories-strip.stories-count-1 {
  grid-template-columns: minmax(280px, 540px);
  justify-content: center;
}

.featured-stories-strip.stories-count-2 {
  grid-template-columns: repeat(2, minmax(280px, 480px));
  justify-content: center;
}

.featured-stories-strip[hidden] {
  display: none !important;
}

.home-featured-story-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.home-featured-story-card:hover {
  border-color: #ea580c;
  transform: translateY(-2px);
}

.home-featured-story-thumb {
  width: 96px;
  min-width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff7ed;
}

.home-featured-story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-featured-story-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.home-featured-story-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ea580c;
  margin-bottom: 4px;
}

.home-featured-story-body h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px;
}

.home-featured-story-body .zh-sub {
  color: #c2410c;
  font-weight: 700;
}

.home-featured-story-pinyin {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0284c7;
  margin-bottom: 4px;
}

.home-featured-story-body p {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .home-featured-story-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .home-featured-story-body h3 {
  color: #f8fafc;
}

[data-theme="dark"] .home-featured-story-body .zh-sub {
  color: #fdba74;
}

[data-theme="dark"] .home-featured-story-body p {
  color: #94a3b8;
}

/* =========================================================
   ADMIN CMS PORTAL WORKSPACE (admin.html)
========================================================= */

body.admin-page {
  background: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
}

[data-theme="dark"] body.admin-page {
  background: #0b1120;
  color: #f8fafc;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
  align-items: start;
}

.admin-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 71px;
  max-height: calc(100vh - 71px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 40;
  scrollbar-width: thin;
}

[data-theme="dark"] .admin-sidebar {
  background: #0f172a;
  border-right-color: #1e293b;
  border-bottom-color: #1e293b;
}

.admin-sidebar-header {
  padding: 0 10px;
}

.admin-sidebar-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ea580c;
  display: block;
  margin-bottom: 4px;
}

.admin-sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

[data-theme="dark"] .admin-sidebar-title {
  color: #f8fafc;
}

.admin-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-nav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.admin-nav-btn.active {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
  font-weight: 700;
}

[data-theme="dark"] .admin-nav-btn {
  color: #94a3b8;
}

[data-theme="dark"] .admin-nav-btn:hover {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .admin-nav-btn.active {
  background: rgba(234, 88, 12, 0.16);
  border-color: rgba(251, 146, 60, 0.45);
  color: #fdba74;
}

.admin-nav-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .admin-topbar {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
}

.admin-breadcrumb strong {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="dark"] .admin-breadcrumb strong {
  color: #f8fafc;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-content-area {
  padding: 24px 28px 60px;
  max-width: 1220px;
  width: 100%;
}

.admin-panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}

[data-theme="dark"] .admin-panel-card {
  background: #0f172a;
  border-color: #1e293b;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-panel-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: #0f172a;
}

[data-theme="dark"] .admin-panel-head h2 {
  color: #f8fafc;
}

.admin-panel-head p {
  font-size: 0.86rem;
  color: #64748b;
  margin: 0;
}

[data-theme="dark"] .admin-panel-head p {
  color: #94a3b8;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

[data-theme="dark"] .admin-field label {
  color: #cbd5e1;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.88rem;
}

.admin-textarea {
  min-height: 82px;
  resize: vertical;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

[data-theme="dark"] .admin-input,
[data-theme="dark"] .admin-select,
[data-theme="dark"] .admin-textarea {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-btn-primary {
  background: #ea580c;
  color: #ffffff;
}

.admin-btn-primary:hover {
  background: #c2410c;
}

.admin-btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.admin-btn-secondary:hover {
  background: #e2e8f0;
}

[data-theme="dark"] .admin-btn-secondary {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .admin-btn-secondary:hover {
  background: #334155;
}

.admin-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.admin-btn-danger:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
}

.admin-btn-danger:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
}

[data-theme="dark"] .admin-btn-danger {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .admin-btn-danger:disabled {
  background: #1e293b;
  color: #64748b;
  border-color: #334155;
}

.admin-btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

[data-theme="dark"] .admin-table-wrap {
  border-color: #1e293b;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.admin-table th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #fffaf5;
}

.admin-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .admin-table th {
  background: #1e293b;
  color: #94a3b8;
  border-bottom-color: #334155;
}

[data-theme="dark"] .admin-table td {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .admin-table tr:hover td {
  background: rgba(30, 41, 59, 0.65);
}

.admin-media-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-media-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-media-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  min-width: 0;
  overflow: hidden;
}

[data-theme="dark"] .admin-media-preview {
  background: #1e293b;
  border-color: #334155;
}

.admin-media-preview img {
  width: 64px;
  height: 44px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .admin-media-preview img {
  border-color: #334155;
}

.admin-media-preview video {
  width: 88px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #000000;
}

.admin-media-preview-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #64748b;
}

[data-theme="dark"] .admin-media-preview-label {
  color: #94a3b8;
}

.admin-media-recovery {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-media-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

[data-theme="dark"] .admin-media-recovery {
  background: rgba(154, 52, 18, 0.2);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fed7aa;
}

.admin-media-library {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  max-height: 140px;
  overflow-y: auto;
}

.admin-media-library[hidden] {
  display: none;
}

.admin-media-chip {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-media-chip:hover {
  border-color: #f97316;
  background: #fff7ed;
  color: #ea580c;
}

[data-theme="dark"] .admin-media-library {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .admin-media-chip {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.admin-check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-featured-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.admin-featured-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
}

[data-theme="dark"] .admin-featured-item {
  background: #1e293b;
  border-color: #334155;
}

.admin-sublist-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="dark"] .admin-sublist-box {
  border-color: #334155;
}

.admin-subrow {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .admin-subrow {
  background: #1e293b;
  border-color: #334155;
}

.admin-gate-box {
  max-width: 580px;
  margin: 70px auto;
  padding: 28px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  text-align: center;
}

[data-theme="dark"] .admin-gate-box {
  background: #0f172a;
  border-color: #1e293b;
}

.admin-status-active {
  color: #16a34a;
  font-weight: 800;
}

.admin-status-pending {
  color: #d97706;
  font-weight: 800;
}

.admin-status-expired {
  color: #dc2626;
  font-weight: 800;
}

.admin-status-free {
  color: #64748b;
  font-weight: 700;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-backdrop.is-open {
  display: flex;
}

.admin-modal-dialog {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
}

[data-theme="dark"] .admin-modal-dialog {
  background: #0f172a;
  border-color: #334155;
}

.admin-submodal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(15, 23, 42, 0.68);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-submodal-backdrop.is-open {
  display: flex;
}

.admin-submodal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
}

[data-theme="dark"] .admin-submodal-dialog {
  background: #0f172a;
  border-color: #334155;
}

.admin-logo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.admin-logo-preview-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-logo-preview-card.is-dark {
  background: #0f172a;
  border-color: #1e293b;
}

.admin-logo-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.admin-logo-preview-card.is-dark .admin-logo-preview-label {
  color: #94a3b8;
}

.admin-logo-preview-stage {
  min-height: 48px;
  display: flex;
  align-items: center;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 60px;
    max-height: none;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 14px;
    z-index: 50;
    background: #ffffff;
    gap: 8px;
  }
  [data-theme="dark"] .admin-sidebar {
    background: #0f172a;
    border-bottom-color: #1e293b;
  }
  .admin-sidebar-header {
    display: none;
  }
  .admin-nav-list {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 8px;
  }
  .admin-nav-list::-webkit-scrollbar {
    display: none;
  }
  .admin-nav-btn {
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.84rem;
  }
  .admin-grid-2,
  .admin-grid-3 {
    grid-template-columns: 1fr;
  }
  .admin-content-area {
    padding: 16px;
  }
}

.admin-backend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

.admin-backend-badge.is-connected {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.admin-backend-badge.is-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

[data-theme="dark"] .admin-backend-badge {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .admin-backend-badge.is-connected {
  background: rgba(6, 78, 59, 0.36);
  border-color: #065f46;
  color: #a7f3d0;
}

[data-theme="dark"] .admin-backend-badge.is-warning {
  background: rgba(234, 88, 12, 0.18);
  border-color: #9a3412;
  color: #fdba74;
}

.admin-backend-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
}

.admin-backend-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.45;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.admin-backend-status.is-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.admin-backend-status.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

[data-theme="dark"] .admin-backend-status {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .admin-backend-status.is-success {
  background: rgba(6, 78, 59, 0.36);
  border-color: #065f46;
  color: #a7f3d0;
}

[data-theme="dark"] .admin-backend-status.is-error {
  background: rgba(127, 29, 29, 0.38);
  border-color: #991b1b;
  color: #fecaca;
}

@media (max-width: 900px) {
  .admin-backend-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   UNIFIED HOMEPAGE LESSONS GATEWAY CARD
   ========================================================= */

.lesson-single-portal-wrap {
  max-width: 920px;
  margin: 10px auto 0;
}

.category-card-unified {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
  gap: 32px;
  align-items: center;
  padding: 36px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #fffaf5 65%, #fff7ed 100%);
  border: 1px solid #fed7aa;
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.08);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-card-unified:hover {
  transform: translateY(-4px);
  border-color: #f97316;
  box-shadow: 0 18px 44px rgba(249, 115, 22, 0.15);
}

.category-card-unified-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-card-unified-left h3 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.category-card-unified-left p {
  color: #475569;
  font-size: 0.96rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.category-card-unified-left .category-features {
  margin-bottom: 0;
}

.category-card-unified-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 26px 22px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #ffedd5;
}

.unified-portal-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.unified-hanzi {
  font-family: var(--font-kaiti);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.05;
  color: #ea580c;
}

.unified-levels {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .category-card-unified {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border-color: #334155;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .category-card-unified:hover {
  border-color: #f97316;
}

[data-theme="dark"] .category-card-unified-left h3 {
  color: #f8fafc;
}

[data-theme="dark"] .category-card-unified-left p {
  color: #cbd5e1;
}

[data-theme="dark"] .category-card-unified-left .category-features li {
  color: #e2e8f0;
}

[data-theme="dark"] .category-card-unified-left .category-features li span {
  background: rgba(234, 88, 12, 0.2);
  color: #fdba74;
}

[data-theme="dark"] .category-card-unified-right {
  background: rgba(15, 23, 42, 0.75);
  border-color: #334155;
}

[data-theme="dark"] .unified-hanzi {
  color: #fb923c;
}

[data-theme="dark"] .unified-levels {
  background: rgba(234, 88, 12, 0.16);
  border-color: #9a3412;
  color: #fdba74;
}

@media (max-width: 820px) {
  .category-card-unified {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 22px;
  }
}

/* =========================================================
   LESSONS PAGE: LEFT COURSE SIDEBAR + MAIN STAGE
   ========================================================= */

.lessons-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.lessons-sidebar {
  position: sticky;
  top: 90px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.lessons-sidebar-header {
  padding: 2px 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.lessons-sidebar-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ea580c;
  margin-bottom: 4px;
}

.lessons-sidebar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.lessons-course-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.course-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.course-nav-btn:hover {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.course-nav-btn.active {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  color: #9a3412;
  box-shadow: inset 3px 0 0 #ea580c;
}

.course-nav-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.course-nav-name {
  font-size: 0.94rem;
  font-weight: 800;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-nav-meta {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.course-nav-btn.active .course-nav-meta {
  color: #c2410c;
}

.course-nav-count {
  flex-shrink: 0;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.course-nav-btn.active .course-nav-count {
  background: #ea580c;
  color: #ffffff;
}

.lessons-main-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.lessons-main-stage .lesson-grid {
  min-height: auto;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 22px;
}

.course-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #fed7aa;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.06);
}

.course-banner-info {
  flex: 1 1 320px;
  min-width: 0;
}

.course-banner-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ea580c;
  margin-bottom: 4px;
}

.course-banner-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.course-banner-desc {
  margin: 0;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
}

.course-banner-desc .tabular-nums {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0f172a;
}

.course-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.course-unlocked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.88rem;
  font-weight: 800;
}

.course-practice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 0.86rem;
  font-weight: 800;
}

.practice-only-workspace-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  line-height: 1.45;
}

.practice-only-workspace-banner .btn-upgrade-video {
  background: #ea580c;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.practice-only-workspace-banner .btn-upgrade-video:hover {
  background: #c2410c;
}

.course-empty-box {
  grid-column: 1 / -1;
  padding: 44px 28px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  text-align: center;
  color: #475569;
}

.course-empty-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.course-empty-box p {
  margin: 0;
  font-size: 0.92rem;
}

[data-theme="dark"] .lessons-sidebar {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .lessons-sidebar-header {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .lessons-sidebar-title {
  color: #f8fafc;
}

[data-theme="dark"] .course-nav-btn {
  color: #cbd5e1;
}

[data-theme="dark"] .course-nav-btn:hover {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(251, 146, 60, 0.35);
  color: #fdba74;
}

[data-theme="dark"] .course-nav-btn.active {
  background: rgba(234, 88, 12, 0.2);
  border-color: #ea580c;
  color: #fed7aa;
}

[data-theme="dark"] .course-nav-meta {
  color: #94a3b8;
}

[data-theme="dark"] .course-nav-btn.active .course-nav-meta {
  color: #fdba74;
}

[data-theme="dark"] .course-nav-count {
  background: #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] .course-banner-card {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .course-banner-title,
[data-theme="dark"] .course-banner-desc .tabular-nums {
  color: #f8fafc;
}

[data-theme="dark"] .course-banner-desc {
  color: #cbd5e1;
}

[data-theme="dark"] .course-unlocked-badge {
  background: rgba(6, 78, 59, 0.4);
  border-color: #065f46;
  color: #a7f3d0;
}

[data-theme="dark"] .course-practice-badge,
[data-theme="dark"] .practice-only-workspace-banner {
  background: rgba(76, 29, 149, 0.35);
  border-color: #6d28d9;
  color: #ede9fe;
}

[data-theme="dark"] .course-empty-box {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .course-empty-box h3 {
  color: #f8fafc;
}

@media (max-width: 900px) {
  .lessons-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .lessons-sidebar {
    position: static;
    padding: 14px;
  }
  .lessons-course-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  .course-nav-btn {
    width: auto;
    min-width: 148px;
    flex: 0 0 auto;
  }
  .course-banner-card {
    padding: 18px;
  }
}

/* =========================================================
   STORIES PAGE: LEFT SIDEBAR STORY MENU + MAIN STAGE
   ========================================================= */

.stories-workspace-section {
  padding: 32px 0 64px;
}

.stories-workspace-container {
  width: min(1220px, calc(100% - 40px));
}

.stories-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.stories-sidebar {
  position: sticky;
  top: 90px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.stories-sidebar-header {
  padding: 2px 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.stories-sidebar-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ea580c;
  margin-bottom: 4px;
}

.stories-sidebar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.stories-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-sidebar-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.story-sidebar-btn:hover {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.story-sidebar-btn:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

.story-sidebar-btn.active {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #f97316;
  color: #9a3412;
}

.story-sidebar-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.story-sidebar-index {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ea580c;
  font-variant-numeric: tabular-nums;
}

.story-sidebar-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.story-sidebar-status.is-progress {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.story-sidebar-status.is-done {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.story-sidebar-title-cn {
  font-family: var(--font-kaiti);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
}

.story-sidebar-title-en {
  font-size: 0.79rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}

.story-sidebar-btn.active .story-sidebar-title-en {
  color: #c2410c;
}

.stories-main-stage {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

@keyframes storyStageSwitchFade {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}

.stories-main-stage.is-switching {
  animation: storyStageSwitchFade 0.18s ease-out;
}

.stories-main-stage .container {
  width: 100%;
  max-width: 100%;
  padding: 0 32px;
}

.stories-main-stage > .lesson-navigation {
  border-top-left-radius: 17px;
  border-top-right-radius: 17px;
}

.stories-main-stage > .story-hero {
  padding: 46px 0 40px;
}

.stories-main-stage > .story-section,
.stories-main-stage > .story-images-section,
.stories-main-stage > .story-reading,
.stories-main-stage > .story-vocabulary,
.stories-main-stage > .story-quiz {
  padding: 52px 0;
}

.stories-main-stage > .story-pagination-section {
  padding: 40px 0 48px;
  border-bottom-left-radius: 17px;
  border-bottom-right-radius: 17px;
}

[data-theme="dark"] .stories-sidebar,
[data-theme="dark"] .stories-main-stage {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .stories-sidebar-header {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .stories-sidebar-title {
  color: #f8fafc;
}

[data-theme="dark"] .story-sidebar-btn {
  background: #111c33;
  border-color: #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] .story-sidebar-btn:hover {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fdba74;
}

[data-theme="dark"] .story-sidebar-btn.active {
  background: rgba(234, 88, 12, 0.22);
  border-color: #ea580c;
  color: #fed7aa;
}

[data-theme="dark"] .story-sidebar-index {
  color: #fb923c;
}

[data-theme="dark"] .story-sidebar-status {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

[data-theme="dark"] .story-sidebar-status.is-progress {
  background: rgba(180, 83, 9, 0.3);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .story-sidebar-status.is-done {
  background: rgba(6, 78, 59, 0.45);
  color: #a7f3d0;
  border-color: #065f46;
}

[data-theme="dark"] .story-sidebar-title-en {
  color: #94a3b8;
}

[data-theme="dark"] .story-sidebar-btn.active .story-sidebar-title-en {
  color: #fdba74;
}

@media (max-width: 900px) {
  .stories-workspace-section {
    padding: 20px 0 48px;
  }
  .stories-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .stories-sidebar {
    position: static;
    padding: 14px;
  }
  .stories-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  .story-sidebar-btn {
    width: auto;
    min-width: 176px;
    flex: 0 0 auto;
  }
  .stories-main-stage .container {
    padding: 0 20px;
  }
  .stories-main-stage > .story-hero {
    padding: 36px 0 32px;
  }
  .stories-main-stage > .story-section,
  .stories-main-stage > .story-images-section,
  .stories-main-stage > .story-reading,
  .stories-main-stage > .story-vocabulary,
  .stories-main-stage > .story-quiz {
    padding: 40px 0;
  }
}

/* Chunked Media Upload Progress & Inline Worker Connect */
.admin-btn.is-disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed !important;
}

.admin-media-progress {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

[data-theme="dark"] .admin-media-progress {
  background: #0f172a;
  border-color: #334155;
}

.admin-media-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .admin-media-progress-head {
  color: #cbd5e1;
}

.admin-media-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

[data-theme="dark"] .admin-media-progress-track {
  background: #1e293b;
}

.admin-media-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #0ea5e9);
  transition: width 0.2s ease;
}

.admin-media-recovery-connect {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.admin-media-recovery-connect .admin-input {
  flex: 1 1 240px;
  min-width: 200px;
}

.admin-feat-count-pill {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.admin-feat-warn {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
  margin-left: 4px;
}

[data-theme="dark"] .admin-feat-count-pill {
  background: rgba(234, 88, 12, 0.2);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.4);
}

/* Exercise Sub-Tabs (Reading vs Listening) */
.admin-ex-tabs,
.quiz-ex-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

[data-theme="dark"] .admin-ex-tabs,
[data-theme="dark"] .quiz-ex-subtabs {
  border-bottom-color: #334155;
}

.admin-ex-tab,
.quiz-ex-subtab {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .admin-ex-tab,
[data-theme="dark"] .quiz-ex-subtab {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

.admin-ex-tab:hover,
.quiz-ex-subtab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="dark"] .admin-ex-tab:hover,
[data-theme="dark"] .quiz-ex-subtab:hover {
  background: #334155;
  color: #f8fafc;
}

.admin-ex-tab.active,
.quiz-ex-subtab.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

[data-theme="dark"] .admin-ex-tab.active,
[data-theme="dark"] .quiz-ex-subtab.active {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff;
}

/* Full-Screen Registration Waiting & Retry Card */
.lp-auth-backdrop.is-fullscreen {
  background: #f8fafc;
  backdrop-filter: none;
  padding: 24px;
}

[data-theme="dark"] .lp-auth-backdrop.is-fullscreen {
  background: #0f172a;
}

.lp-reg-fullscreen-card {
  max-width: 580px;
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 28px 30px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .lp-reg-fullscreen-card {
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.lp-reg-identity-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 18px;
}

.lp-reg-identity-line strong {
  color: #0f172a;
  font-weight: 700;
}

[data-theme="dark"] .lp-reg-identity-line {
  color: #cbd5e1;
}

[data-theme="dark"] .lp-reg-identity-line strong {
  color: #f8fafc;
}

.lp-reg-notice {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.lp-reg-notice-pending {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

.lp-reg-notice-success {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #064e3b;
}

.lp-reg-notice-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

[data-theme="dark"] .lp-reg-notice-pending {
  background: rgba(120, 53, 15, 0.35);
  border-color: #b45309;
  color: #fef3c7;
}

[data-theme="dark"] .lp-reg-notice-success {
  background: rgba(6, 78, 59, 0.38);
  border-color: #059669;
  color: #d1fae5;
}

[data-theme="dark"] .lp-reg-notice-error {
  background: rgba(127, 29, 29, 0.38);
  border-color: #dc2626;
  color: #fee2e2;
}

.lp-reg-notice-title {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.lp-reg-notice-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.lp-reg-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

[data-theme="dark"] .lp-reg-steps {
  border-color: #334155;
  background: #0f172a;
}

.lp-reg-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.lp-reg-step:last-child {
  border-bottom: none;
}

[data-theme="dark"] .lp-reg-step {
  border-bottom-color: #334155;
}

.lp-reg-step-marker {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #475569;
}

[data-theme="dark"] .lp-reg-step-marker {
  background: #1e293b;
  color: #94a3b8;
}

.lp-reg-step-done .lp-reg-step-marker {
  background: #059669;
  color: #ffffff;
}

.lp-reg-step-active .lp-reg-step-marker {
  background: #ea580c;
  color: #ffffff;
}

.lp-reg-step-error .lp-reg-step-marker {
  background: #dc2626;
  color: #ffffff;
}

.lp-reg-step-body {
  flex: 1;
  min-width: 0;
}

.lp-reg-step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .lp-reg-step-title {
  color: #f8fafc;
}

.lp-reg-step-desc {
  font-size: 0.79rem;
  color: #64748b;
  margin-top: 2px;
}

[data-theme="dark"] .lp-reg-step-desc {
  color: #94a3b8;
}

.lp-reg-step-status {
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  color: #64748b;
}

.lp-reg-step-done .lp-reg-step-status {
  color: #059669;
}

.lp-reg-step-active .lp-reg-step-status {
  color: #ea580c;
}

.lp-reg-step-error .lp-reg-step-status {
  color: #dc2626;
}

.lp-reg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-reg-actions > button {
  flex: 1;
  min-width: 170px;
}

