/* ==========================================================================
   HÁN NGỮ LUYỆN THI & 50 BỘ ĐỀ CHUẨN (TTTH4 & TTTH8) - MODERN DESIGN SYSTEM
   ========================================================================== */

:root, [data-theme="ieltsmate"] {
  /* IELTS Mate Signature Brand (Warm Cream, Espresso Ink & Terracotta Coral) */
  --primary: #dd6552;
  --primary-hover: #c54f3c;
  --primary-light: #fdf2f0;
  --primary-glow: rgba(221, 101, 82, 0.22);
  
  --accent: #b5733a;
  --accent-light: #fbf3e8;
  
  --success: #2e7d32;
  --success-light: #edf7ee;
  --success-glow: rgba(46, 125, 50, 0.2);
  
  --warning: #d8a33a;
  --warning-light: #fef9ed;
  
  --danger: #dd6552;
  --danger-light: #fdf0ed;
  
  --bg-main: #fbf7f1; /* IELTS Mate Canvas */
  --bg-card: #ffffff; /* Warm Ivory Paper */
  --bg-card-hover: #faf4eb;
  --bg-elevated: #f4ece0; /* Soft warm surface */
  --border-color: #e8ded2; /* Soft warm border */
  --border-subtle: rgba(51, 33, 15, 0.08);
  
  --text-main: #33210f; /* Deep Warm Espresso Ink */
  --text-muted: #6f5e48; /* Warm Taupe Ink */
  --text-dim: #9f8c75; /* Faint Ink */
  
  --hanzi-font: 'Noto Serif SC', 'Songti SC', 'STKaiti', serif;
  --ui-font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --shadow-sm: 0 1px 3px rgba(51, 33, 15, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(51, 33, 15, 0.08), 0 2px 4px -2px rgba(51, 33, 15, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(51, 33, 15, 0.12);
  --shadow-glow: 0 0 20px rgba(221, 101, 82, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* IELTS Mate Dark (Mực Đêm Sand Dark) */
[data-theme="ieltsmate-dark"] {
  --primary: #dd6552;
  --primary-hover: #ea6f59;
  --primary-light: #3a211c;
  --primary-glow: rgba(221, 101, 82, 0.35);
  
  --accent: #deb75f;
  --accent-light: #2f2616;
  
  --success: #88d295;
  --success-light: #1b2a1e;
  
  --warning: #deb75f;
  --warning-light: #2f2616;
  
  --danger: #dd6552;
  --danger-light: #3a211c;
  
  --bg-main: #17120e; /* IELTS Mate Sand Dark */
  --bg-card: #211b15; /* Cream-1 Dark */
  --bg-card-hover: #29221b; /* Cream-2 Dark */
  --bg-elevated: #2c241c; /* Tan-1 */
  --border-color: #362d23;
  --border-subtle: rgba(248, 239, 226, 0.08);
  
  --text-main: #f8efe2; /* Cream Ink */
  --text-muted: #cfbfac;
  --text-dim: #9f8c75;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(221, 101, 82, 0.35);
}

[data-theme="light"] {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --accent: #0ea5e9;
  --accent-light: #e0f2fe;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-glow: rgba(16, 185, 129, 0.25);
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --border-color: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.06);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

[data-theme="dark"] {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #1e1b4b;
  --primary-glow: rgba(99, 102, 241, 0.3);
  
  --accent: #38bdf8;
  --accent-light: #082f49;
  
  --success: #34d399;
  --success-light: #064e3b;
  
  --warning: #fbbf24;
  --warning-light: #451a03;
  
  --danger: #f87171;
  --danger-light: #450a0a;
  
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #24344d;
  --bg-elevated: #334155;
  --border-color: #334155;
  --border-subtle: rgba(255, 255, 255, 0.08);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);
}

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

body {
  font-family: var(--ui-font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* App Header */
.app-header {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
}
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.88);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hanzi-font);
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-info h1 {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Volume Switcher Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.volume-selector-group {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.vol-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.vol-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.vol-btn:hover:not(.active) {
  color: var(--text-main);
  background: var(--bg-elevated);
}

.theme-toggle-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle-btn:hover {
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

/* Navigation Tabs */
.app-nav-tabs {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.nav-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--primary);
}

.nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -2px 8px var(--primary-glow);
}

.nav-badge {
  font-size: 0.72rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.nav-tab-btn.active .nav-badge {
  background: var(--primary-light);
  color: var(--primary);
}
[data-theme="dark"] .nav-tab-btn.active .nav-badge {
  background: rgba(79, 70, 229, 0.25);
  color: #a5b4fc;
}

/* Main Content Area */
.main-layout {
  max-width: 1400px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

/* Tab Panels */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Banner Alert Box */
.volume-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(14, 165, 233, 0.15));
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.volume-banner-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   TAB 1: CURRICULUM (BÀI HỌC, TỪ VỰNG & NGỮ PHÁP)
   ========================================================================== */
.curriculum-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 450px;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.8;
}

.lesson-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.lesson-number-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(14, 165, 233, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.lesson-hanzi-title {
  font-family: var(--hanzi-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.lesson-pinyin-title {
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.35rem;
}

.lesson-vi-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.lesson-stats-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.lesson-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal View for Detailed Lesson */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.modal-overlay.active {
  display: flex;
}

.lesson-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s ease;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-main);
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.modal-body-scroll {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  color: var(--text-main);
}
.detail-section-title:first-child {
  margin-top: 0;
}

/* Grammar Block */
.grammar-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.grammar-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #818cf8;
  margin-bottom: 0.5rem;
}
[data-theme="light"] .grammar-card-title {
  color: #4f46e5;
}

.grammar-structure-box {
  background: rgba(79, 70, 229, 0.1);
  border-left: 3px solid var(--primary);
  padding: 0.6rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.grammar-explanation-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  white-space: pre-line;
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.example-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.example-text-group .ex-hanzi {
  font-family: var(--hanzi-font);
  font-size: 1.1rem;
  font-weight: 600;
}
.example-text-group .ex-pinyin {
  font-size: 0.85rem;
  color: var(--accent);
}
.example-text-group .ex-vi {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.speak-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}
.speak-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Vocabulary Table */
.vocab-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.vocab-table th {
  background: var(--bg-main);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
}

.vocab-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.vocab-table tr:last-child td {
  border-bottom: none;
}

.vocab-table tr:hover td {
  background: var(--bg-card-hover);
}

.vocab-hanzi {
  font-family: var(--hanzi-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.vocab-pinyin {
  color: var(--accent);
  font-weight: 500;
}

.vocab-type-tag {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* ==========================================================================
   TAB 2: 50 BỘ ĐỀ THI (EXAM RUNNER & AUTO-GRADING)
   ========================================================================== */
.exam-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .exam-layout-grid {
    grid-template-columns: 1fr;
  }
}

.exam-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-list-scroll {
  max-height: 550px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 4px;
}

.exam-select-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exam-select-item:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.exam-select-item.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(14, 165, 233, 0.2));
  border-color: var(--primary);
}

.exam-item-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.exam-item-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-dim);
}
.exam-select-item.done .exam-item-status {
  background: var(--success-light);
  color: var(--success);
}
[data-theme="dark"] .exam-select-item.done .exam-item-status {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* Exam Active Workspace */
.exam-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.exam-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.exam-header-info h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.exam-header-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
}

.timer-display {
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}
.timer-display.danger {
  color: var(--danger);
  animation: pulse 1s infinite;
}

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

.timer-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: var(--transition);
}
.timer-btn:hover {
  color: var(--text-main);
}

.btn-submit-exam {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px var(--success-glow);
}
.btn-submit-exam:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--success-glow);
}

/* Exam Section Container */
.exam-section-block {
  margin-bottom: 2rem;
}

.section-badge-header {
  background: var(--bg-main);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.25rem;
}

.section-badge-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Question Item */
.question-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.question-item:hover {
  border-color: rgba(79, 70, 229, 0.4);
}

.question-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.q-badge {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
}

.q-score {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Pinyin Input Field */
.pinyin-input-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.q-hanzi-prompt {
  font-family: var(--hanzi-font);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 120px;
}

.pinyin-input-field {
  flex: 1;
  min-width: 220px;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
}
.pinyin-input-field:focus {
  border-color: var(--primary);
}

/* Sentence Reorder Interactive Area */
.reorder-pool-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.75rem 0;
  min-height: 48px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.reorder-result-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  background: rgba(79, 70, 229, 0.08);
  border: 2px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  align-items: center;
}

.word-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--hanzi-font);
  font-size: 1.15rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

.word-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.word-chip.selected {
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.reorder-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-small-tool {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-small-tool:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.btn-check-q {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: var(--transition);
  user-select: none;
}
.btn-check-q:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669, #047857);
}

.single-q-feedback {
  margin: 0.65rem 0 0.35rem 0;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.5;
  display: none;
  animation: expSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.single-q-feedback.correct {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}
.single-q-feedback.incorrect {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Question Action Bar & Instant Explanation Reveal */
.q-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.btn-toggle-explanation {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.btn-toggle-explanation:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.btn-toggle-explanation.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.explanation-box {
  margin-top: 0.85rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
  animation: expSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}
@keyframes expSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.explanation-box.show {
  display: block;
}

.exp-row-item {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exp-row-item:last-child {
  margin-bottom: 0;
}

.exp-tag {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.exp-tag.success { color: var(--success); }
.exp-tag.danger { color: var(--danger); }
.exp-tag.info { color: var(--accent); }
.exp-tag.grammar { color: var(--primary); }
.exp-tag.alt { color: var(--warning); }

.exp-val.hanzi-hl {
  font-family: var(--hanzi-font);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
}
.exp-val.pinyin-hl {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.explanation-box.wrong-alert {
  background: rgba(221, 101, 82, 0.08);
  border-left-color: var(--danger);
}

/* Exam Header Tools */
.exam-tools-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-tool-secondary {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-tool-secondary:hover, .btn-tool-secondary.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Pinyin Tone Helper Toolbar */
.pinyin-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding: 6px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.pinyin-toolbar span {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-right: 4px;
}
.pinyin-char-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.pinyin-char-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Score Summary Modal */
.score-summary-modal {
  text-align: center;
  padding: 2rem;
}

.score-badge-circle {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4f46e5, #10b981);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 25px var(--primary-glow);
}

.score-number {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}
.score-scale {
  font-size: 0.85rem;
  opacity: 0.85;
}

.score-verdict {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.score-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
  text-align: left;
}

.score-part-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-md);
}

.score-part-card .part-name {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.score-part-card .part-pts {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

/* ==========================================================================
   TAB 3: CHUYÊN ĐỀ VIẾT VĂN & BÀI MẪU (WRITING WORKSHOP)
   ========================================================================== */
.writing-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .writing-layout-grid {
    grid-template-columns: 1fr;
  }
}

.writing-topic-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.topic-item-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  cursor: pointer;
  transition: var(--transition);
}

.topic-item-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.topic-item-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(14, 165, 233, 0.2));
  border-color: var(--primary);
}

.topic-item-btn .t-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.topic-item-btn .t-req {
  font-size: 0.78rem;
  color: var(--accent);
}

/* Writing Pad Details */
.writing-detail-view {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.topic-header-banner {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.topic-header-banner h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.req-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Outline Cards */
.outline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .outline-grid {
    grid-template-columns: 1fr;
  }
}

.outline-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.outline-card h4 {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.outline-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Vocab & Structure Tags */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.vocab-badge-chip {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.vocab-badge-chip b {
  font-family: var(--hanzi-font);
  color: var(--text-main);
  font-size: 0.95rem;
}
.vocab-badge-chip span {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: 4px;
}

/* Interactive Textarea & Live Hanzi Counter */
.writing-pad-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.writing-pad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.writing-pad-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.counter-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.counter-pill {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: var(--transition);
}
.counter-pill.under {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.counter-pill.target {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.counter-pill.over {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.chinese-textarea {
  width: 100%;
  min-height: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-main);
  font-family: var(--hanzi-font);
  font-size: 1.15rem;
  line-height: 1.8;
  resize: vertical;
  outline: none;
}
.chinese-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Multi-Style Sample Essay Section (IELTS Mate Card Style) */
.style-switcher-bar {
  margin-bottom: 1.25rem;
}

.style-tabs-group {
  display: inline-flex;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 4px;
  flex-wrap: wrap;
}

.style-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.style-tab-btn:hover {
  color: var(--text-main);
}
.style-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.sample-essay-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.sample-essay-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.sample-essay-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sample-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.style-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.style-desc-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.sample-hanzi-content {
  font-family: var(--hanzi-font);
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
  background: var(--bg-main);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.sample-pinyin-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--accent);
  margin-bottom: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0.75rem;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.sample-vi-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
}

/* Side-by-side comparison grid */
.sample-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ==========================================================================
   ENHANCED LESSON MODAL FULLSCREEN & EXPORT TOOLBAR
   ========================================================================== */

.modal-overlay.is-fullscreen {
  padding: 0 !important;
}

.lesson-modal-content.fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-modal-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-modal-action:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-modal-action.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Master Curriculum Toolbar */
.curriculum-master-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.master-bar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.master-bar-title .icon {
  font-size: 1.75rem;
  background: rgba(221, 101, 82, 0.12);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.master-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-master-export {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-master-export:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-master-export.gold {
  background: linear-gradient(135deg, #a8791f, #c5932e);
  color: #fff;
  border-color: #a8791f;
}

.btn-master-export.gold:hover {
  background: linear-gradient(135deg, #8a6216, #a8791f);
}

/* Lesson Texts & Dialogues */
.lesson-text-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.lesson-text-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-text-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}

.dialogue-turn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.dialogue-turn:hover {
  background: var(--bg-elevated);
}

.turn-speaker {
  font-weight: 700;
  color: var(--primary);
  min-width: 50px;
  background: rgba(221, 101, 82, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.turn-content {
  flex: 1;
}

.turn-hanzi {
  font-family: var(--hanzi-font);
  font-size: 1.2rem;
  color: var(--text-main);
  line-height: 1.5;
}

.turn-pinyin {
  font-size: 0.88rem;
  color: var(--accent);
  font-style: italic;
  margin: 2px 0;
}

.turn-vi {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   COFFEE BROWN HEADER & BANNER (NÂU CAFE CAO CẤP)
   ========================================================================== */

.app-header {
  background: linear-gradient(135deg, #2b170c 0%, #3e2213 50%, #4a2b19 100%) !important;
  border-bottom: 2px solid #5d3822 !important;
  color: #fff8f0 !important;
  box-shadow: 0 4px 20px rgba(43, 23, 12, 0.35) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
}

[data-theme="light"] .app-header,
[data-theme="ieltsmate"] .app-header,
[data-theme="ieltsmate-dark"] .app-header,
[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #2b170c 0%, #3e2213 50%, #4a2b19 100%) !important;
  border-bottom: 2px solid #5d3822 !important;
}

.brand-logo,
.brand-logo-badge {
  background: linear-gradient(135deg, #d97706, #92400e) !important;
  color: #fff8f0 !important;
  border: 1px solid rgba(255, 248, 240, 0.25) !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
  font-family: var(--hanzi-font) !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
}

.brand-text h1,
.brand-info h1 {
  color: #fff8f0 !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45) !important;
}

.brand-text p,
.brand-info p {
  color: #e8d5c4 !important;
}

/* Volume switcher in header */
.volume-switch-pills {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 248, 240, 0.2) !important;
  border-radius: var(--radius-full) !important;
  padding: 3px !important;
}

.vol-btn {
  color: #e8d5c4 !important;
  background: transparent !important;
  border: none !important;
}

.vol-btn:hover {
  color: #ffffff !important;
}

.vol-btn.active {
  background: #dd6552 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(221, 101, 82, 0.45) !important;
}

/* Tab buttons in header */
.nav-tab-btn {
  color: #e8d5c4 !important;
}

.nav-tab-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.nav-tab-btn.active {
  color: #ffffff !important;
  border-bottom: 3px solid #dd6552 !important;
  background: rgba(221, 101, 82, 0.16) !important;
}

.nav-tab-btn .nav-badge {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff8f0 !important;
}

.nav-tab-btn.active .nav-badge {
  background: #dd6552 !important;
  color: #ffffff !important;
}

/* Theme button in header */
.theme-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 248, 240, 0.25) !important;
  color: #fff8f0 !important;
}
.theme-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

/* Coffee Brown Volume Banner */
.volume-banner {
  background: linear-gradient(135deg, #f7efe6 0%, #ebe0d1 100%) !important;
  border: 1px solid #d8c7b3 !important;
  border-left: 6px solid #4a2b19 !important;
  box-shadow: var(--shadow-sm) !important;
}

.volume-banner-text h2 {
  color: #3e2213 !important;
  font-weight: 800 !important;
}

.volume-banner-text p {
  color: #5c4033 !important;
}

.volume-banner .badge-tag {
  background: #4a2b19 !important;
  color: #fff8f0 !important;
}

/* ==========================================================================
   OCR PREVIEW & SCANNER LASER STYLES
   ========================================================================== */
.ocr-preview-panel {
  background: var(--bg-card);
  border: 2px dashed #d97706;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  animation: modalScale 0.25s ease;
}

.ocr-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.ocr-preview-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .ocr-preview-body {
    grid-template-columns: 1fr;
  }
}

.ocr-img-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  max-height: 260px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ocr-img-wrap img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.scanner-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ef4444, #f59e0b, #ef4444, transparent);
  box-shadow: 0 0 12px #ef4444;
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 95%; }
  100% { top: 0%; }
}

.ocr-result-wrap {
  display: flex;
  flex-direction: column;
}

.ocr-text-result {
  min-height: 140px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--hanzi-font);
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-main);
  outline: none;
}
.ocr-text-result:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
