/* Môn Học Tiếng Việt (Lớp 1–5 Kết nối tri thức) — Đồng bộ thẩm mỹ Góc Học Tập */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #dff1ff 0%, #eef7ff 380px, #f7fbff 100%);
  color: #162642;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  line-height: 1.65;
}
button, input, select { font-family: inherit; }
a { color: inherit; }

/* ---------- Header kính trắng đồng bộ ---------- */
.tv-top {
  position: sticky;
  top: 0;
  z-index: 45;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid #d4e6ff;
  box-shadow: 0 4px 18px rgba(22, 104, 227, .07);
}
.tv-top-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tv-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.tv-brand svg { width: 40px; height: 40px; flex-shrink: 0; }
.tv-brand b {
  display: block;
  font: 800 22px/1 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}
.tv-brand b i { color: #f97316; font-style: normal; }
.tv-brand small {
  display: block;
  font: 700 10px/1.1 'Be Vietnam Pro', sans-serif;
  letter-spacing: .08em;
  color: #4f6792;
  margin-top: 2px;
}
.tv-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tv-nav::-webkit-scrollbar { display: none; }
.tv-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  font: 700 13.5px/1 'Be Vietnam Pro', sans-serif;
  color: #203760;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .15s;
}
.tv-nav a:hover { background: #eef5ff; color: #1668e3; transform: translateY(-1px); }
.tv-nav a.active {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 29, 72, .24);
}
.tv-nav-ic { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; }
.tv-nav-ic svg { width: 100%; height: 100%; }

/* ---------- Khung chính ---------- */
.tv-wrap {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 18px 48px;
}
.tv-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #53698f;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tv-crumb a { color: #1668e3; font-weight: 700; text-decoration: none; }
.tv-crumb a:hover { text-decoration: underline; }

/* ---------- Thanh chọn lớp + Tập ---------- */
.tv-grade-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .95);
  border: 2px solid #f9cbd8;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(225, 29, 72, .06);
}
.tv-grade-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tv-gtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  font: 800 14.5px/1 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #1e293b;
  text-decoration: none;
  transition: transform .13s, background .13s, color .13s;
}
.tv-gtab i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  color: #fff;
  background: #64748b;
}
.tv-gtab.g1 i { background: #2563eb; }
.tv-gtab.g2 i { background: #10b981; }
.tv-gtab.g3 i { background: #f59e0b; }
.tv-gtab.g4 i { background: #8b5cf6; }
.tv-gtab.g5 i { background: #e11d48; }
.tv-gtab:hover { transform: translateY(-1px); border-color: #fda4af; }
.tv-gtab.active {
  background: linear-gradient(135deg, #e11d48, #fb7185);
  color: #fff;
  border-color: #e11d48;
  box-shadow: 0 4px 12px rgba(225, 29, 72, .22);
}
.tv-gtab.active i { background: rgba(255, 255, 255, .28); }
.tv-print-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1d4ed8;
  font: 700 13.5px/1 'Be Vietnam Pro', sans-serif;
  text-decoration: none;
}
.tv-print-link:hover { background: #dbeafe; }

/* ---------- Layout Hub /tieng-viet ---------- */
.tv-hero {
  background: linear-gradient(135deg, #fff1f5 0%, #ffffff 55%, #eff6ff 100%);
  border: 2px solid #fecdd3;
  border-radius: 26px;
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px rgba(225, 29, 72, .07);
}
.tv-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffe4e6;
  color: #be123c;
  font: 700 12.5px/1.2 'Be Vietnam Pro', sans-serif;
  margin-bottom: 10px;
}
.tv-hero h1 {
  margin: 0 0 8px;
  font: 800 clamp(24px, 3vw, 34px)/1.2 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}
.tv-hero p { margin: 0 0 14px; color: #334155; max-width: 820px; }
.tv-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.tv-hub-card {
  background: #fff;
  border: 2px solid #dbeafe;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(22, 104, 227, .07);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tv-hub-card:hover {
  transform: translateY(-3px);
  border-color: #fb7185;
  box-shadow: 0 14px 28px rgba(225, 29, 72, .12);
}
.tv-hub-num {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font: 800 22px/1 'Baloo 2', sans-serif;
  color: #fff;
}
.tv-hub-card.g1 .tv-hub-num { background: #2563eb; }
.tv-hub-card.g2 .tv-hub-num { background: #10b981; }
.tv-hub-card.g3 .tv-hub-num { background: #f59e0b; }
.tv-hub-card.g4 .tv-hub-num { background: #8b5cf6; }
.tv-hub-card.g5 .tv-hub-num { background: #e11d48; }
.tv-hub-card h2 {
  margin: 0;
  font: 800 21px/1.2 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}
.tv-hub-card p { margin: 0; font-size: 13.5px; color: #475569; flex: 1; }
.tv-hub-cta {
  display: inline-flex;
  align-items: center;
  font: 700 14px/1 'Be Vietnam Pro', sans-serif;
  color: #e11d48;
  margin-top: 4px;
}

/* ---------- Workspace 2 cột trang học ---------- */
.tv-app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.tv-sidebar {
  background: #fff;
  border: 2px solid #d5e6ff;
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(22, 104, 227, .07);
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}
.tv-vol-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.tv-vol-btn {
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font: 700 14px/1 'Be Vietnam Pro', sans-serif;
  cursor: pointer;
  transition: all .14s;
}
.tv-vol-btn.active {
  background: linear-gradient(135deg, #1668e3, #3b82f6);
  color: #fff;
  border-color: #1668e3;
  box-shadow: 0 4px 10px rgba(22, 104, 227, .24);
}
.tv-search {
  width: 100%;
  height: 36px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 11px;
  font-size: 13.5px;
  margin-bottom: 10px;
  outline: none;
}
.tv-search:focus { border-color: #3b82f6; }
.tv-tree {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tv-theme-box {
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
}
.tv-theme-head {
  width: 100%;
  text-align: left;
  border: 0;
  background: #eff6ff;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tv-theme-head b {
  display: block;
  font: 800 13.5px/1.3 'Be Vietnam Pro', sans-serif;
  color: #1e3a8a;
}
.tv-theme-head small {
  display: block;
  font-size: 11.5px;
  color: #475569;
}
.tv-lesson-list {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 4px;
}
.tv-theme-box.collapsed .tv-lesson-list { display: none; }
.tv-ls-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #1e293b;
  transition: background .12s, border-color .12s;
}
.tv-ls-btn:hover { background: #fff1f2; border-color: #fecdd3; }
.tv-ls-btn.active {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border-color: #f43f5e;
  font-weight: 700;
  color: #9f1239;
}
.tv-ls-btn.pending { opacity: .78; }
.tv-ls-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tv-ls-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-ls-sub { font-size: 11px; color: #64748b; }
.tv-ls-badge {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.tv-ls-badge.ok { background: #fef3c7; color: #b45309; }
.tv-ls-badge.wait { background: #f1f5f9; color: #64748b; font-weight: 600; }

/* ---------- Mobile Drawer Toggle ---------- */
.tv-mob-bar {
  display: none;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tv-mob-toggle {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid #fda4af;
  background: #fff;
  color: #be123c;
  font: 700 14px/1 'Be Vietnam Pro', sans-serif;
  cursor: pointer;
}

/* ---------- Main Lesson Stage ---------- */
.tv-stage {
  background: #fff;
  border: 2px solid #d5e6ff;
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: 0 10px 28px rgba(22, 104, 227, .07);
}
.tv-ls-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1.5px dashed #dbeafe;
  margin-bottom: 18px;
}
.tv-ls-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffe4e6;
  color: #be123c;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tv-ls-header h2 {
  margin: 0 0 6px;
  font: 800 clamp(22px, 2.6vw, 28px)/1.2 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}
.tv-ls-header p { margin: 0; font-size: 14px; color: #475569; }
.tv-ls-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  font: 700 13.5px/1 'Be Vietnam Pro', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all .14s;
}
.tv-btn:hover { transform: translateY(-1px); background: #f8fafc; }
.tv-btn.primary {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  border-color: #e11d48;
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 29, 72, .22);
}
.tv-btn.blue {
  background: linear-gradient(135deg, #1668e3, #3b82f6);
  border-color: #1668e3;
  color: #fff;
}
.tv-btn.speaking {
  background: linear-gradient(135deg, #059669, #10b981);
  border-color: #059669;
  color: #fff;
}

/* ---------- 4 Phần bài học ---------- */
.tv-section {
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  background: #fbfdff;
}
.tv-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.tv-section-title h3 {
  margin: 0;
  font: 800 19px/1.25 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}
.tv-phonics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.tv-phonic-chip {
  min-width: 54px;
  padding: 8px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 2px solid #fda4af;
  font: 800 22px/1.1 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #be123c;
  text-align: center;
}
.tv-recog-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 12px;
}
.tv-reading-body {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15.5px;
  line-height: 1.75;
}
.tv-reading-body p { margin: 0 0 8px; }
.tv-reading-body p:last-child { margin-bottom: 0; }
.tv-kw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.tv-kw-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 10px 12px;
}
.tv-kw-card b { display: block; color: #0369a1; font-size: 15px; }
.tv-kw-card span { display: block; font-size: 12px; color: #64748b; }
.tv-kw-card small { display: block; font-size: 12.5px; color: #334155; margin-top: 3px; }
.tv-glossary {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  font-size: 13.5px;
}
.tv-glossary ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Câu hỏi tương tác ---------- */
.tv-q-list { display: flex; flex-direction: column; gap: 14px; }
.tv-q-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 15px;
  padding: 14px 16px;
}
.tv-q-card.correct { border-color: #22c55e; background: #f0fdf4; }
.tv-q-card.wrong { border-color: #ef4444; background: #fef2f2; }
.tv-q-stem { font-weight: 700; font-size: 15px; color: #0f172a; margin-bottom: 10px; }
.tv-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.tv-opt {
  text-align: left;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all .12s;
}
.tv-opt:hover { border-color: #3b82f6; background: #eff6ff; }
.tv-opt.picked { border-color: #2563eb; background: #dbeafe; font-weight: 700; color: #1e3a8a; }
.tv-opt.is-right { border-color: #16a34a; background: #dcfce7; font-weight: 700; color: #14532d; }
.tv-opt.is-wrong { border-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.tv-fill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tv-fill-in {
  flex: 1;
  min-width: 200px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  padding: 0 12px;
  font-size: 14.5px;
}
.tv-q-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.tv-hint-btn {
  border: 0;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.tv-hint-box, .tv-exp-box {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
}
.tv-hint-box { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.tv-exp-box { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ---------- Góc Viết & Kết quả ---------- */
.tv-steps { margin: 0 0 10px; padding-left: 20px; }
.tv-steps li { margin-bottom: 5px; font-size: 14.5px; }
.tv-bank { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tv-bank span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12.5px;
  font-weight: 700;
}
.tv-sample-box {
  background: #fff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: #334155;
}
.tv-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff1f2, #eff6ff);
  border: 2px solid #fecdd3;
}
.tv-score-res { font: 800 18px/1.3 'Baloo 2', sans-serif; color: #10326b; }
.tv-pending-box {
  text-align: center;
  padding: 36px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
}
.tv-pending-box h3 { margin: 0 0 8px; color: #10326b; font: 800 22px/1.2 'Baloo 2', sans-serif; }
.tv-seo-box {
  margin-top: 24px;
  background: #fff;
  border: 1.5px solid #d5e6ff;
  border-radius: 22px;
  padding: 20px 24px;
}
.tv-seo-box h2 {
  margin: 0 0 10px;
  font: 800 21px/1.3 'Baloo 2', 'Be Vietnam Pro', sans-serif;
  color: #10326b;
}

/* ---------- Footer ---------- */
.tv-foot {
  background: #072973;
  color: rgba(255, 255, 255, .88);
  padding: 18px 16px;
  text-align: center;
  font-size: 13.5px;
}
.tv-foot-nav {
  display: flex;
  justify-content: center;
  gap: 10px 20px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.tv-foot-nav a { color: #93c5fd; text-decoration: none; font-weight: 600; }
.tv-foot-nav a:hover { text-decoration: underline; }

@media (max-width: 920px) {
  .tv-app-shell { grid-template-columns: 1fr; }
  .tv-mob-bar { display: flex; }
  .tv-sidebar {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 66px;
    bottom: 16px;
    z-index: 60;
    max-height: none;
    display: none;
  }
  .tv-sidebar.open { display: flex; }
}
@media (max-width: 600px) {
  .tv-wrap { padding: 12px 12px 40px; }
  .tv-stage { padding: 16px 14px; }
}
