:root {
  --bg-page: #f5f7f6;
  --bg-page-alt: #f5f7f6;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f8f4;
  --primary-900: #0f4c2e;
  --primary-800: #125c38;
  --primary-700: #157347;
  --primary-600: #198754;
  --primary-500: #209e63;
  --primary-400: #40b87d;
  --primary-100: #e3f2ea;
  --primary-50: #f2faf5;
  --brand-orange: #157347;
  --brand-orange-dark: #0f4c2e;
  --brand-orange-light: #e3f2ea;
  --accent-gold: #198754;
  --text-main: #182920;
  --text-secondary: #425c4e;
  --text-muted: #667d70;
  --border-color: #d3e5da;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --shadow-sm: 0 2px 8px rgba(15, 76, 46, 0.06);
  --shadow-md: 0 8px 22px rgba(15, 76, 46, 0.09);
  --shadow-lg: 0 14px 36px rgba(15, 76, 46, 0.13);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

body.theme-deep-green {
  --bg-page: #062e18;
  --bg-page-alt: #0a3d20;
  --bg-card: #0e4a28;
  --bg-card-subtle: #125c32;
  --text-main: #f0fdf4;
  --text-secondary: #bbf7d0;
  --text-muted: #86efac;
  --border-color: #1e7a44;
  --primary-50: #115730;
  --primary-100: #16693b;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.38);
}

body.theme-royal-red {
  --bg-page: #fffaf0;
  --bg-page-alt: #fef3c7;
  --bg-card: #ffffff;
  --bg-card-subtle: #fffbeb;
  --primary-900: #5c0a0a;
  --primary-800: #7f1d1d;
  --primary-700: #991b1b;
  --primary-600: #b91c1c;
  --primary-500: #dc2626;
  --primary-400: #f87171;
  --primary-100: #fee2e2;
  --primary-50: #fef2f2;
  --brand-orange: #d97706;
  --brand-orange-light: #fef3c7;
  --accent-gold: #eab308;
  --text-main: #450a0a;
  --text-secondary: #7f1d1d;
  --text-muted: #9a3412;
  --border-color: #fcd34d;
  --shadow-sm: 0 4px 14px rgba(153, 27, 27, 0.08);
  --shadow-md: 0 12px 32px rgba(153, 27, 27, 0.14);
  --shadow-lg: 0 20px 48px rgba(92, 10, 10, 0.22);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-alt) 50%, var(--bg-page) 100%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.zh-text {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* TOP BAR */
.topbar {
  background: var(--primary-900);
  color: #dcfce7;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.topbar a {
  color: #fde047;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}

.topbar a:hover {
  opacity: 0.88;
  text-decoration: underline;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 84, 42, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--brand-orange);
  box-shadow: 0 4px 20px rgba(7, 59, 30, 0.24);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  display: block;
}

.brand-title span {
  color: #fb923c;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #bbf7d0;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  color: #ecfdf5;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 0.91rem;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-fb-header {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.38);
  transition: transform 0.2s;
}

.btn-fb-header:hover {
  transform: translateY(-1px);
}

.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 13px;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* HERO SECTION */
.hero {
  background: radial-gradient(circle at 85% 20%, rgba(52, 199, 112, 0.28) 0%, transparent 45%),
              linear-gradient(135deg, #07381c 0%, #0e582d 48%, #15793f 100%);
  color: #ffffff;
  padding: 48px 0 56px;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--brand-orange);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(187, 247, 208, 0.45);
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fde047;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.45rem;
  line-height: 1.22;
  font-weight: 800;
  margin-bottom: 14px;
}

.hero h1 .hl-orange {
  color: #fb923c;
}

.hero h1 .hl-green {
  color: #86efac;
  text-decoration: underline;
  text-decoration-color: rgba(134, 239, 172, 0.4);
  text-underline-offset: 6px;
}

.hero-desc {
  font-size: 1.04rem;
  color: #dcfce7;
  margin-bottom: 22px;
  max-width: 650px;
}

.hero-commitments {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.commit-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f0fdf4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.38);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.52);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 14px;
  border-radius: 14px;
  backdrop-filter: blur(6px);
}

.stat-num {
  font-size: 1.48rem;
  font-weight: 800;
  color: #fde047;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: #dcfce7;
}

.hero-card {
  background: #ffffff;
  color: #0c2918;
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  border: 3px solid #f97316;
  position: relative;
}

.hero-logo-large {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(19, 111, 58, 0.22));
}

.hero-card h2 {
  font-size: 1.25rem;
  color: #136f3a;
  margin-bottom: 2px;
  font-weight: 800;
}

.hero-card .sub-org {
  font-size: 1.1rem;
  color: #ea580c;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-info-list {
  text-align: left;
  font-size: 0.86rem;
  background: #edfcf3;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid #b7e4c7;
  margin-bottom: 14px;
}

.hero-info-list div {
  margin-bottom: 7px;
  color: #0d542a;
}

.hero-info-list div:last-child {
  margin-bottom: 0;
}

/* BANNER SHOWCASE RIBBON */
.official-banner-wrap {
  margin-top: 28px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

.official-banner-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* SECTION HEADERS */
.section {
  padding: 52px 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 32px;
}

.section-tag {
  display: inline-block;
  background: var(--primary-700);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

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

/* LESSON PILLS / SELECTOR */
.lesson-grid-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.lesson-pill {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-pill:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lesson-pill.active {
  background: linear-gradient(135deg, #0d542a 0%, #168344 100%);
  color: #ffffff;
  border-color: #f97316;
  box-shadow: 0 8px 20px rgba(13, 84, 42, 0.28);
}

.lesson-pill-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-700);
}

.lesson-pill.active .lesson-pill-top {
  color: #fde047;
}

.lesson-pill-zh {
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-pill-vi {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-pill.active .lesson-pill-vi {
  color: #dcfce7;
}

/* LESSON DETAIL BANNER */
.lesson-banner {
  background: linear-gradient(135deg, #0b4623 0%, #136f3a 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--brand-orange);
}

.lesson-banner h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.lesson-banner p {
  color: #dcfce7;
  font-size: 0.95rem;
  max-width: 780px;
}

.lesson-meta-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.badge-chip {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  color: #fde047;
  font-weight: 600;
}

/* SUB-TABS FOR LESSON CONTENT */
.subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.subtab-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.91rem;
  cursor: pointer;
  transition: all 0.2s;
}

.subtab-btn:hover {
  border-color: var(--primary-500);
}

.subtab-btn.active {
  background: var(--primary-700);
  color: #ffffff;
  border-color: var(--primary-700);
}

/* VOCABULARY CONTROLS & CARDS */
.vocab-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 260px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
}

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

.vocab-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vocab-card:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vocab-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.vocab-hz {
  font-size: 1.68rem;
  font-weight: 700;
  color: var(--primary-700);
}

body.theme-deep-green .vocab-hz {
  color: #86efac;
}

.vocab-py {
  font-size: 0.95rem;
  color: var(--brand-orange);
  font-weight: 700;
}

body.theme-deep-green .vocab-py {
  color: #fdba74;
}

.vocab-pos {
  background: var(--primary-100);
  color: var(--primary-800);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
}

body.theme-deep-green .vocab-pos {
  color: #dcfce7;
}

.vocab-meaning {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.vocab-notes {
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: var(--bg-card-subtle);
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 3px solid var(--primary-500);
  white-space: pre-line;
  max-height: 150px;
  overflow-y: auto;
}

.btn-speak {
  background: var(--primary-50);
  border: 1.5px solid var(--border-color);
  color: var(--primary-700);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-speak:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
  transform: scale(1.08);
}

/* FLASHCARD MODE */
.flashcard-stage {
  max-width: 580px;
  margin: 12px auto 24px;
  text-align: center;
}

.flashcard-box {
  background: var(--bg-card);
  border: 2.5px solid var(--primary-500);
  border-radius: 22px;
  padding: 40px 28px;
  min-height: 290px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.flashcard-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* GRAMMAR CARDS */
.grammar-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.grammar-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.grammar-card h4 {
  font-size: 1.15rem;
  color: var(--primary-700);
  margin-bottom: 10px;
}

body.theme-deep-green .grammar-card h4 {
  color: #86efac;
}

.grammar-formula {
  background: linear-gradient(90deg, var(--primary-50) 0%, transparent 100%);
  border-left: 4px solid var(--brand-orange);
  padding: 9px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 6px;
  margin-bottom: 10px;
}

.grammar-exp {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.grammar-examples {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grammar-examples li {
  background: var(--bg-card-subtle);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px dashed var(--border-color);
}

/* PROGRESS BAR IN EXERCISE SECTION */
.progress-banner {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 22px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.progress-track {
  flex: 1;
  min-width: 200px;
  height: 12px;
  background: var(--primary-50);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #168344 0%, #f97316 100%);
  width: 0%;
  transition: width 0.35s ease;
}

/* INTERACTIVE EXERCISES SECTION */
.exercise-filter-bar {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

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

.ex-type-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ex-type-btn.active {
  background: linear-gradient(135deg, #0d542a 0%, #168344 100%);
  color: #ffffff;
  border-color: #f97316;
}

.lesson-select-dropdown {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--primary-500);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
}

/* EXERCISE BLOCK */
.ex-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.ex-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

.ex-card-title {
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--primary-800);
}

body.theme-deep-green .ex-card-title {
  color: #86efac;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--primary-50);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px dashed var(--primary-500);
  margin-bottom: 20px;
}

.word-bank-item {
  background: var(--bg-card);
  border: 1.5px solid var(--primary-600);
  color: var(--primary-800);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.15s;
}

body.theme-deep-green .word-bank-item {
  color: #bbf7d0;
}

.word-bank-item:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
}

.fill-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card-subtle);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.fill-sentence {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fill-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 2px solid var(--primary-500);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
}

.fill-select.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: #065f46;
}

.fill-select.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: #991b1b;
}

.feedback-box {
  font-size: 0.87rem;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
}

.feedback-box.show {
  display: block;
}

.feedback-box.ok {
  background: var(--success-bg);
  color: #065f46;
  border-left: 4px solid var(--success);
}

.feedback-box.err {
  background: var(--danger-bg);
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

/* SENTENCE ORDERING CHIPS */
.order-item {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.chip-pool, .chip-target {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.chip-pool {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
}

.chip-target {
  background: var(--primary-50);
  border: 2px solid var(--primary-500);
}

.word-chip {
  background: var(--bg-card);
  border: 1.5px solid var(--primary-600);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.word-chip:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
  transform: translateY(-1px);
}

/* MCQ CARDS */
.mcq-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mcq-opt-btn {
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.15s;
}

.mcq-opt-btn:hover {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.mcq-opt-btn.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: #065f46;
  font-weight: 700;
}

.mcq-opt-btn.wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #991b1b;
}

/* TRANSLATION CARDS */
.trans-item {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.trans-source {
  font-weight: 700;
  font-size: 1.03rem;
  margin-bottom: 10px;
  white-space: pre-line;
}

.trans-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 10px;
  resize: vertical;
}

.trans-answer-box {
  background: var(--primary-50);
  border-left: 4px solid var(--brand-orange);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 10px;
  display: none;
  white-space: pre-line;
}

.trans-answer-box.show {
  display: block;
}

/* CENTER ABOUT / 3 CAMPUSES SECTION */
.campus-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.campus-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-top: 5px solid var(--brand-orange);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.campus-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.campus-num {
  display: inline-block;
  background: var(--primary-700);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.center-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.center-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

.branch-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary-600);
  padding: 15px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
}

/* FLOATING CONTACT WIDGET */
.floating-contact {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.float-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s;
}

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

.float-btn.hotline {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.float-btn.fb {
  background: linear-gradient(135deg, #136f3a 0%, #0d542a 100%);
  border: 1.5px solid #86efac;
}

/* FOOTER */
.footer {
  background: #052915;
  color: #dcfce7;
  padding: 52px 0 28px;
  border-top: 4px solid var(--brand-orange);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}

.footer h4 {
  color: #fb923c;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.footer a {
  color: #fde047;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
  color: #86efac;
}

@media (max-width: 992px) {
  .hero-grid, .center-grid, .footer-grid, .campus-strip {
    grid-template-columns: 1fr;
  }
  .lesson-grid-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .grammar-list {
    grid-template-columns: 1fr;
  }
  .mcq-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.85rem;
  }
  .hero-stats, .hero-commitments {
    grid-template-columns: 1fr;
  }
  .lesson-grid-nav {
    grid-template-columns: 1fr;
  }
  .floating-contact {
    display: none;
  }
}

/* =========================================================================
   NÂNG CẤP GIAO DIỆN EDTECH, ĐĂNG NHẬP HỌC VIÊN & CHẤM ĐIỂM HSK 4
   ========================================================================= */

body.theme-royal-red .hero {
  background: radial-gradient(circle at top right, #b91c1c 0%, #7f1d1d 55%, #450a0a 100%);
}

body.theme-royal-red .footer {
  background: #450a0a;
  border-top-color: #eab308;
}

/* Nút chọn 3 Theme và Hồ sơ học viên trên Navbar */
.theme-switcher-group {
  display: inline-flex;
  align-items: center;
  background: var(--primary-50);
  border: 1.5px solid var(--border-color);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}

.theme-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-pill-btn.active {
  background: var(--primary-700);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.user-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 99px;
  padding: 7px 15px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.28);
  transition: all 0.2s ease;
  font-family: inherit;
}

.user-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.38);
}

.user-nav-btn.logged-in {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
  border-color: #fde047;
}

.user-score-badge {
  background: #fde047;
  color: #0c2918;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
}

/* BẢNG CHẤM ĐIỂM & TIẾN ĐỘ NÂNG CAO */
.score-dashboard-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.score-dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-600), var(--brand-orange), var(--accent-gold));
}

.score-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.student-badge-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-700), var(--brand-orange));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
  border: 2px solid #fde047;
}

.score-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.score-metric-box {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  transition: transform 0.2s ease;
}

.score-metric-box:hover {
  transform: translateY(-2px);
}

.score-metric-val {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-700);
  display: block;
  line-height: 1.2;
}

.score-metric-val.highlight {
  color: var(--brand-orange);
}

.score-metric-lbl {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

.score-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

/* BẢNG VINH DANH & QUẢN LÝ ĐIỂM HỌC VIÊN */
.leaderboard-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-top: 28px;
}

.leaderboard-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.leaderboard-table th {
  background: var(--primary-800);
  color: #ffffff;
  text-align: left;
  padding: 13px 16px;
  font-weight: 700;
  white-space: nowrap;
}

.leaderboard-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.leaderboard-table tr:nth-child(even) td {
  background: var(--bg-card-subtle);
}

.leaderboard-table tr:hover td {
  background: var(--primary-50);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}

.rank-1 { background: #fef08a; color: #854d0e; border: 2px solid #eab308; }
.rank-2 { background: #e2e8f0; color: #334155; border: 2px solid #94a3b8; }
.rank-3 { background: #ffedd5; color: #9a3412; border: 2px solid #f97316; }

.grade-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
}

.grade-excellent { background: #dcfce7; color: #166534; border: 1px solid #4ade80; }
.grade-good { background: #dbeafe; color: #1e40af; border: 1px solid #60a5fa; }
.grade-fair { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.grade-practice { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* MODAL ĐĂNG NHẬP & PHIẾU BÁO ĐIỂM */
.hn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 32, 16, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hn-modal-overlay.show {
  display: flex;
  animation: fadeInModal 0.25s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.hn-modal-box {
  background: var(--bg-card);
  color: var(--text-main);
  width: 100%;
  max-width: 540px;
  border-radius: 24px;
  border: 2.5px solid var(--border-color);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  max-height: 92vh;
  overflow-y: auto;
}

.hn-modal-header {
  background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-900) 100%);
  color: #ffffff;
  padding: 22px 26px;
  text-align: center;
  position: relative;
  border-bottom: 3px solid var(--brand-orange);
}

.hn-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
}

.hn-modal-body {
  padding: 24px 26px;
}

.hn-form-group {
  margin-bottom: 16px;
}

.hn-form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.hn-form-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.96rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.hn-form-input:focus {
  outline: none;
  border-color: var(--brand-orange);
}

/* PHIẾU CHỨNG NHẬN KẾT QUẢ HỌC TẬP */
.certificate-frame {
  border: 3px double var(--brand-orange);
  background: linear-gradient(180deg, var(--bg-card-subtle) 0%, var(--bg-card) 100%);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  margin-bottom: 18px;
}

.cert-score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 12px auto;
  background: linear-gradient(135deg, var(--primary-700), var(--brand-orange));
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid #fde047;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.cert-score-big {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.lesson-score-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.lesson-score-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 4px;
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 768px) {
  .score-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lesson-score-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================================
   HỆ THỐNG LMS 4 CẤP: HỌC SINH NỘP BÀI - GIÁO VIÊN CHẤM CHỮA - QUẢN LÝ USER
   ========================================================================= */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
}
.role-admin { background: #fef08a; color: #854d0e; border: 1.5px solid #eab308; }
.role-manager { background: #dbeafe; color: #1e40af; border: 1.5px solid #60a5fa; }
.role-teacher { background: #ffedd5; color: #9a3412; border: 1.5px solid #f97316; }
.role-student { background: #dcfce7; color: #166534; border: 1.5px solid #4ade80; }

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}
.status-graded { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.status-submitted { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.status-redo { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

.teacher-feedback-banner {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-card-subtle) 100%);
  border: 2px solid var(--brand-orange);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.lms-tabs-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.lms-tab-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.lms-tab-btn.active {
  background: var(--primary-700);
  color: #ffffff;
  border-color: var(--primary-700);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.lms-panel {
  display: none;
}

.lms-panel.active {
  display: block;
}

.grade-written-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.quick-demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-demo-chip {
  border: 1.5px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.quick-demo-chip:hover {
  border-color: var(--brand-orange);
  background: var(--primary-50);
}

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

@media (max-width: 768px) {
  .user-create-grid {
    grid-template-columns: 1fr;
  }
  .lms-tab-btn {
    width: 100%;
    text-align: left;
  }
}

/* ==========================================================================
   MULTI-LEVEL SUPER APP BAR (HSK 1 -> HSK 5 + KHẨU NGỮ) & SPEAKING LAB
   ========================================================================== */
.super-app-level-strip {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  padding: 12px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.level-tabs-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.level-tabs-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.level-tab-pill {
  padding: 8px 15px;
  border-radius: 99px;
  border: 2px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.level-tab-pill:hover {
  border-color: var(--brand-orange);
  transform: translateY(-1px);
}

.level-tab-pill.active {
  background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-600) 100%);
  color: #ffffff;
  border-color: var(--brand-orange);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.28);
}

.level-tab-pill.speaking-pill {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff;
  border-color: #fde047;
}

.speaking-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.speaking-card:hover {
  border-color: var(--primary-500);
}

.speaking-zh-large {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-800);
  line-height: 1.5;
  margin-bottom: 6px;
}

body.theme-deep-green .speaking-zh-large {
  color: #86efac;
}

.btn-mic-record {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff;
  border: 2px solid #fde047;
  padding: 9px 18px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
  transition: all 0.2s;
}

.btn-mic-record:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-mic-record.recording {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  animation: pulseMic 1.1s infinite;
}

@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.65); }
  70% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.char-diff-box {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 12px;
}

.char-ok {
  color: #15803d;
  background: #dcfce7;
  padding: 2px 5px;
  border-radius: 6px;
  margin: 0 1px;
  font-weight: 800;
  display: inline-block;
}

.char-err {
  color: #b91c1c;
  background: #fee2e2;
  padding: 2px 5px;
  border-radius: 6px;
  margin: 0 1px;
  font-weight: 800;
  text-decoration: underline wavy #ef4444;
  display: inline-block;
}

.dialogue-row {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 1.5px solid var(--border-color);
}

.dialogue-row.partner {
  background: var(--primary-50);
  border-left: 5px solid var(--primary-600);
}

.dialogue-row.student {
  background: var(--bg-card-subtle);
  border-left: 5px solid var(--brand-orange);
}

.audio-playback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--primary-50);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.audio-playback-bar audio {
  height: 36px;
  max-width: 260px;
}



/* MENU DROPDOWN CHỌN CẤP ĐỘ HSK TRÊN HEADER */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(253, 224, 71, 0.55);
  border-radius: 99px;
  padding: 6px 14px;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background: rgba(253, 224, 71, 0.22);
  border-color: #fde047;
  color: #fde047;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 285px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  border: 2px solid var(--primary-600);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  padding: 8px;
  z-index: 1200;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

.nav-dd-header {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-700);
  padding: 6px 10px 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

.nav-dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.16s ease;
}

.nav-dd-item:hover:not(.disabled) {
  background: #ecfdf5;
  border-color: #86efac;
  color: #065f46;
}

.nav-dd-item.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #fef3c7 100%);
  border-color: var(--brand-orange);
  color: #065f46;
}

.nav-dd-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav-dd-badge {
  background: #065f46;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.nav-dd-item.active .nav-dd-badge {
  background: var(--brand-orange);
}

.nav-dd-badge.muted {
  background: #94a3b8;
}

/* NÚT LÊN ĐẦU TRANG & TỐI ƯU MOBILE */
#btn-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fde047;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btn-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#btn-back-to-top:hover {
  transform: translateY(-3px);
  background: var(--brand-orange);
}

@media (max-width: 768px) {
  .nav-dropdown-menu {
    position: fixed;
    top: 72px;
    left: 4vw;
    right: 4vw;
    min-width: auto;
    max-width: 92vw;
  }
}

/* TRÁNH HEADER CHE KHUẤT KHI CUỘN XUỐNG CÁC MỤC */
section[id],
div[id="khau-ngu"],
div[id="bang-vinh-danh"] {
  scroll-margin-top: 96px;
}

/* =========================================================================
   PHÒNG GAME NHỚ MẶT CHỮ HÁN (HSK 1 - HSK 4)
   ========================================================================= */
.game-panel-card {
  background: var(--bg-card);
  border: 2px solid var(--primary-600);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--border-color);
}

.game-level-pill {
  background: linear-gradient(135deg, var(--primary-700), var(--brand-orange));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--bg-card-subtle);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.game-stat-pill {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
}

.game-win-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(135deg, #ecfdf5, #fef3c7);
  border: 2px solid #10b981;
  color: #065f46;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 1rem;
}

/* Game 1: Memory Match Grid */
.hm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hm-card {
  perspective: 900px;
  height: 112px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.hm-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.36s ease;
  transform-style: preserve-3d;
}

.hm-card.flipped .hm-card-inner,
.hm-card.matched .hm-card-inner {
  transform: rotateY(180deg);
}

.hm-card-front,
.hm-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hm-card-front {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: #fde047;
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid rgba(253, 224, 71, 0.45);
}

.hm-card-front span {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

.hm-card-back {
  transform: rotateY(180deg);
  background: #ffffff;
  color: #0f172a;
  border: 2px solid var(--primary-500);
}

.hm-card.type-hz .hm-card-back {
  background: #fffbeb;
  border-color: var(--brand-orange);
}

.hm-card.matched .hm-card-back {
  background: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hm-hz {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-800);
  line-height: 1.2;
}

.hm-py {
  font-size: 0.78rem;
  color: var(--brand-orange);
  font-weight: 700;
  margin-top: 3px;
}

.hm-vi {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

/* Game 2: Speed Quiz */
.speed-intro-box,
.speed-card,
.builder-card {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 26px 20px;
  text-align: center;
}

.speed-hz {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-800);
  line-height: 1.2;
}

.speed-fb {
  min-height: 26px;
  margin: 10px 0 14px;
  font-size: 0.96rem;
}

.speed-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.speed-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
}

.speed-opt-btn:hover {
  border-color: var(--brand-orange);
  background: #fff7ed;
  color: #9a3412;
  transform: translateY(-2px);
}

.speed-opt-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-700);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Game 3: Hanzi Character Builder */
.builder-slots-row,
.builder-tiles-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.builder-slot {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 2.5px dashed var(--primary-500);
  background: #ffffff;
  color: var(--primary-800);
  font-size: 1.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.builder-slot.filled {
  border-style: solid;
  border-color: var(--brand-orange);
  background: #fff7ed;
}

.builder-slot.ok {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.builder-tile {
  min-width: 58px;
  height: 58px;
  padding: 0 12px;
  border-radius: 12px;
  border: 2px solid var(--primary-600);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.16s ease;
}

.builder-tile:hover:not(:disabled) {
  background: var(--primary-700);
  color: #ffffff;
  transform: translateY(-2px);
}

.builder-tile.used {
  opacity: 0.3;
  cursor: default;
}

@media (max-width: 768px) {
  .hm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .hm-card { height: 96px; }
  .hm-hz { font-size: 1.35rem; }
  .speed-options-grid { grid-template-columns: 1fr; }
  .speed-hz { font-size: 2.3rem; }
}

/* =========================================================================
   CHỦ ĐỀ ĐƠN SẮC THỐNG NHẤT (XANH NGỌC DỊU MẮT - DỄ NHÌN & DỄ SỬ DỤNG NHẤT)
   ========================================================================= */
body {
  background: var(--bg-page) !important;
}

.navbar {
  background: var(--primary-800) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.nav-dropdown-toggle {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background: rgba(255, 255, 255, 0.24) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

.user-nav-btn,
.user-nav-btn.logged-in {
  background: #ffffff !important;
  color: var(--primary-800) !important;
  border: 2px solid var(--primary-100) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
}

.user-score-badge {
  background: var(--primary-700) !important;
  color: #ffffff !important;
}

.hero {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 100%) !important;
}

.hero h1 span,
.hero h1 .highlight-green {
  color: #d1fae5 !important;
}

.btn-primary {
  background: var(--primary-700) !important;
  border-color: var(--primary-700) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(21, 115, 71, 0.24) !important;
}

.btn-primary:hover {
  background: var(--primary-800) !important;
  border-color: var(--primary-800) !important;
}

.score-dashboard-card::before {
  background: var(--primary-600) !important;
}

.level-tab-pill.active,
.level-tab-pill.speaking-pill,
.game-level-pill {
  background: var(--primary-700) !important;
  border-color: var(--primary-700) !important;
  color: #ffffff !important;
}

.hm-card-front {
  background: var(--primary-800) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.hm-card.type-hz .hm-card-back {
  background: var(--primary-50) !important;
  border-color: var(--primary-600) !important;
}

.game-win-banner {
  background: var(--primary-50) !important;
  border-color: var(--primary-600) !important;
  color: var(--primary-900) !important;
}

.nav-dd-item.active {
  background: var(--primary-50) !important;
  border-color: var(--primary-600) !important;
  color: var(--primary-900) !important;
}

#btn-back-to-top {
  background: var(--primary-800) !important;
  border: 2px solid #ffffff !important;
}

#btn-back-to-top:hover {
  background: var(--primary-700) !important;
}
