/* Giáo trình
   Tự động scope: mọi selector nằm dưới .book-textbook để không đụng khung chung (css/shell.css)
   và bản còn lại. :root / body / html được đổi thành .book-textbook. */

.book-textbook {
  --red: #d94b45;
  --red-deep: #b5322d;
  --red-soft: #f08a84;
  --pink-bg: #fdf3f1;
  --pink-card: #fbe3df;
  --pink-line: #f3c4be;
  --paper: #ffffff;
  --ink: #3b2c2a;
  --muted: #8a716d;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(181, 50, 45, 0.10);
  --zh-font: "Times New Roman", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --en-font: "Times New Roman", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.book-textbook * {
  box-sizing: border-box;
}
.book-textbook {
  margin: 0;
  padding: 0;
}
.book-textbook {
  color: var(--ink);
  font-family: "Times New Roman", var(--en-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.book-textbook .zh {
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook [hidden] {
  display: none !important;
}
.book-textbook :focus-visible {
  outline: 3px solid var(--red-soft);
  outline-offset: 2px;
}
.book-textbook .app {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "nav main";
  min-height: 100vh;
}
.book-textbook .topbar {
  grid-area: top;
  background: var(--red);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 0 var(--red-deep);
}
.book-textbook .brand {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.book-textbook .brand-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .5px;
}
.book-textbook .brand-en {
  font-size: 13px;
  opacity: .9;
}
.book-textbook .lesson-nav {
  grid-area: nav;
  background: var(--paper);
  border-right: 1px solid var(--pink-line);
  padding: 16px 12px 24px;
  overflow-y: auto;
  max-height: calc(100vh - 62px);
  position: sticky;
  top: 0;
  align-self: start;
}
.book-textbook .nav-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 4px 10px 10px;
}
.book-textbook .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.book-textbook .nav-item a, .book-textbook .nav-item span.nav-link {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}
.book-textbook .nav-item a:hover {
  background: var(--pink-card);
}
.book-textbook .nav-item[aria-current="page"] a {
  background: var(--red);
  color: #fff;
}
.book-textbook .nav-item[aria-current="page"] .nav-no {
  color: #fff;
}
.book-textbook .nav-item.is-pending span.nav-link {
  opacity: .45;
  cursor: default;
}
.book-textbook .nav-no {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  text-align: center;
  line-height: 1;
}
.book-textbook .nav-zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 15px;
  font-weight: 600;
}
.book-textbook .nav-en {
  display: block;
  font-size: 12px;
  opacity: .8;
}
.book-textbook .nav-soon {
  font-size: 11px;
  color: var(--muted);
}
.book-textbook .main {
  grid-area: main;
  padding: 28px clamp(16px, 4vw, 40px) 56px;
  max-width: 1040px;
  width: 100%;
}
.book-textbook .main:focus {
  outline: none;
}
.book-textbook .hero {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  margin-bottom: 28px;
}
.book-textbook .hero-num {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: 18px 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 140px;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow);
  min-height: 170px;
}
.book-textbook .hero-num::before {
  content: "Bài";
  position: absolute;
  top: -12px;
  left: 14px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
}
.book-textbook .hero-body {
  background: var(--red);
  color: #fff;
  border-radius: 0 18px 18px 0;
  padding: 26px 30px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.book-textbook .hero-pinyin {
  font-size: 16px;
  opacity: .92;
  letter-spacing: .3px;
}
.book-textbook .hero-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}
/* Tiêu đề dạng cụm: pinyin canh ngay phía trên chữ Hán của từng cụm */
.book-textbook .hero-chunks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 16px;
  row-gap: 8px;
}
.book-textbook .hero-chunk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.book-textbook .hero-chunk .hero-py {
  font-family: "Times New Roman", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .3px;
  margin-bottom: 4px;
  white-space: nowrap;
  opacity: .92;
}
.book-textbook .hero-chunk .hero-hanzi {
  white-space: nowrap;
}
.book-textbook .hero-en {
  font-size: 18px;
  margin: 0;
  opacity: .95;
}
.book-textbook .card {
  background: var(--paper);
  border: 2px solid var(--pink-line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.book-textbook .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
}
.book-textbook .card-title .zh {
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.book-textbook .check-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
}
.book-textbook .check-box {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 2px solid var(--red);
  border-radius: 3px;
}
.book-textbook .check-zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 16px;
}
.book-textbook .check-en {
  display: block;
  color: var(--muted);
  font-size: 15px;
}
.book-textbook .hl {
  color: var(--red);
  font-weight: 700;
  font-style: normal;
}
.book-textbook mark.hl {
  background: transparent;
}
.book-textbook .section {
  margin: 40px 0 0;
  scroll-margin-top: 16px;
}
.book-textbook .section-head {
  display: inline-flex;
  align-items: stretch;
  margin-bottom: 18px;
  border-radius: 12px 0 12px 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.book-textbook .section-head .section-zh {
  background: var(--red);
  color: #fff;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 26px;
  font-weight: 800;
  padding: 6px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.book-textbook .section-head .section-en {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
  border-left: 0;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
  display: flex;
  align-items: center;
  letter-spacing: .3px;
}
/* Hàng tiêu đề + nút nghe bên cạnh (nút không nằm trong .section-head vì .section-head có overflow:hidden) */
.book-textbook .section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.book-textbook .section-title-row .section-head {
  margin-bottom: 0;
}
.book-textbook .scene {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 14px;
}
.book-textbook .scene-pin {
  color: var(--red);
  margin-top: 3px;
}
.book-textbook .scene-zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .scene-en {
  display: block;
  color: var(--muted);
  font-size: 15px;
}
.book-textbook .instruction {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin: 0 0 16px;
}
.book-textbook .instruction::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--red);
  flex: 0 0 10px;
}
.book-textbook .instruction .en {
  color: var(--muted);
  font-weight: 400;
}
/* Nút ▶ 4-3 nằm trong dòng hướng dẫn (Bài 4, audioInline) */
.book-textbook .instruction .btn.audio-inline {
  flex: 0 0 auto;
  padding: 4px 14px;
  font-size: 14px;
  white-space: nowrap;
}
.book-textbook .instruction .btn.audio-inline svg {
  width: 10px;
  height: 10px;
}
/* Bài nghe kiểu sách (rich: true, Bài 4): pinyin canh trên từng cụm chữ; đáp án là chữ cái đỏ, không nền pill */
/* Pinyin từng chữ: mỗi ký tự là một cột, âm tiết canh giữa phía trên chữ; các cột cùng cấu trúc nên thẳng hàng */
.book-textbook .py-ch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
  padding: 0 3px;
  line-height: 1.5;
}
.book-textbook .py-s {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  min-height: 1.2em;
  color: var(--ink);
  white-space: nowrap;
}
.book-textbook .py-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: 100%;
  min-width: 0;
}
.book-textbook .opt-vi {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  align-self: center;
}
@media (max-width: 560px) {
  .book-textbook .listening.rich .ex-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .book-textbook .listening.rich .ex-options li {
    font-size: 18px;
  }
}
.book-textbook .listening.rich .choice-q {
  display: block;
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}
.book-textbook .listening.rich .ex-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 12px;
  margin: 0 0 14px;
}
.book-textbook .listening.rich .ex-options li {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 600;
}
.book-textbook .listening.rich .opt-letter {
  flex: 0 0 auto;
  background: none;
  color: var(--red);
  width: auto;
  height: auto;
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}
.book-textbook .dialogue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.book-textbook .line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.book-textbook .avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--red);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-family: "Times New Roman", var(--zh-font);
  font-size: 26px;
  font-weight: 800;
  flex-direction: column;
  text-align: center;
  line-height: 1.1;
}
.book-textbook .avatar.is-xiaoyu {
  background: var(--red-soft);
  color: #fff;
  border-color: var(--red-soft);
}
.book-textbook .avatar.is-group {
  color: var(--red);
}
.book-textbook .avatar svg {
  width: 34px;
  height: 34px;
  fill: var(--red);
}
.book-textbook .speaker-name {
  display: block;
  margin-top: 4px;
  text-align: center;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  line-height: 1.2;
}
.book-textbook .speaker-py {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.book-textbook .bubble {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--red);
  border-radius: 14px;
  padding: 10px 16px 12px 16px;
  box-shadow: var(--shadow);
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}
.book-textbook .bubble::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 22px;
  width: 16px;
  height: 16px;
  background: var(--paper);
  border-left: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(45deg);
}
.book-textbook .bubble-py {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .2px;
}
.book-textbook .bubble-zh {
  font-family: "Times New Roman", "Noto Sans SC", var(--zh-font);
  font-size: 26px;
  font-weight: bold;
  line-height: 1.5;
  letter-spacing: .03em;
}
/* Các cụm pinyin + chữ Hán: pinyin canh ngay phía trên chữ của cụm đó */
.book-textbook .bubble-chunks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 10px;
  row-gap: 6px;
}
.book-textbook .chunk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.book-textbook .chunk .bubble-py {
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
}
.book-textbook .chunk .bubble-zh {
  white-space: nowrap;
}
.book-textbook .bubble-vi {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--red-soft);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
.book-textbook .btn {
  font: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 0 var(--red-deep);
}
.book-textbook .btn:hover {
  background: var(--red-deep);
}
.book-textbook .btn:active {
  transform: translateY(2px);
  box-shadow: none;
}
.book-textbook .btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
/* Nút phát âm (data-track): pill đỏ, chữ to hơn, tam giác nhỏ như mẫu */
.book-textbook .btn[data-track],
.book-textbook .btn[data-speak-all] {
  font-size: 16px;
  padding: 8px 22px;
  gap: 8px;
}
.book-textbook .btn[data-track] svg,
.book-textbook .btn[data-speak-all] svg {
  width: 10px;
  height: 10px;
}
/* Icon nút data-track: mặc định tam giác (phát); khi đang phát (audio.js thêm .is-playing) đổi thành 2 vạch (tạm dừng) */
.book-textbook [data-track] .ic-pause { display: none; }
.book-textbook [data-track].is-playing .ic-play { display: none; }
.book-textbook [data-track].is-playing .ic-pause { display: inline; }
.book-textbook .btn.ghost {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
  box-shadow: none;
}
.book-textbook .btn.ghost:hover {
  background: var(--pink-card);
}
.book-textbook .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}
.book-textbook .text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.book-textbook .tip {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  margin: 22px 0;
}
.book-textbook .tip-who {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--red);
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
}
.book-textbook .tip-who small {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 11px;
  font-weight: 600;
}
.book-textbook .tip-body {
  background: var(--pink-card);
  border-radius: 12px;
  padding: 12px 16px;
  border-left: 5px solid var(--red);
}
.book-textbook .tip-body .zh {
  display: block;
  font-size: 16px;
}
.book-textbook .tip-body .en {
  display: block;
  font-size: 15px;
  color: var(--muted);
}
.book-textbook .tip-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--red-soft);
  color: #fff;
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 800;
  font-size: 22px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--red-soft);
}
.book-textbook .summary {
  background: var(--pink-card);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--ink);
  font-size: 15px;
  margin-top: 4px;
}
.book-textbook .summary p {
  margin: 2px 0;
}
.book-textbook .words-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.book-textbook .words {
  background: var(--pink-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.book-textbook .words-head {
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 2px solid var(--red);
  border-left: 0;
  border-top: 0;
  color: var(--red);
  font-weight: 800;
  font-size: 17px;
  border-bottom-right-radius: 12px;
}
.book-textbook .words-head .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 20px;
}
.book-textbook .words-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}
/* Audio từ vựng (生词): cùng layout nút pill đỏ với .btn[data-track], chỉ canh chỉnh vị trí trong thanh tiêu đề */
.book-textbook .words-audio {
  margin: 4px 12px 4px 0;
}
.book-textbook .words-table {
  width: 100%;
  border-collapse: collapse;
}
.book-textbook .words-table td {
  padding: 9px 14px;
  border-top: 1px dashed var(--red-soft);
  vertical-align: top;
}
.book-textbook .words-table tr:first-child td {
  border-top: 0;
}
.book-textbook .w-no {
  color: var(--red);
  font-weight: 700;
  width: 44px;
  font-size: 17px;
}
.book-textbook button.audio-tag {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 2px 10px 2px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.book-textbook button.audio-tag:hover {
  background: var(--red);
  color: #fff;
}
.book-textbook button.audio-tag.is-playing {
  background: var(--red);
  color: #fff;
}
.book-textbook button.audio-tag svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.book-textbook .w-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
  padding-right: 22px;
}
.book-textbook .w-py {
  white-space: nowrap;
  width: 1%;
  padding-right: 18px;
}
.book-textbook .w-pos {
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
  width: 1%;
  padding-right: 16px;
}
.book-textbook .w-en {
  font-size: 15px;
}
.book-textbook .words-table .w-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.book-textbook .proper-title {
  margin: 0;
  padding: 8px 14px;
  background: var(--red-soft);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.book-textbook .proper-title .zh {
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .tasks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.book-textbook .tasks li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
}
.book-textbook .tasks li::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--red);
  margin-top: 7px;
}
.book-textbook .tasks .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 600;
}
.book-textbook .tasks .en {
  display: block;
  color: var(--muted);
  font-size: 15px;
}
.book-textbook .tongue {
  background: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  border: 2px dashed var(--red-soft);
}
.book-textbook .tongue-line {
  margin: 0 0 14px;
}
.book-textbook .tongue-line:last-child {
  margin-bottom: 0;
}
.book-textbook .tongue-py {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: .3px;
}
.book-textbook .tongue-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
}
/* Câu líu lưỡi tách cụm: pinyin canh ngay phía trên chữ Hán của cụm đó */
.book-textbook .tongue-chunks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 12px;
  row-gap: 6px;
}
.book-textbook .tongue-chunk {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.book-textbook .tongue-chunk .tongue-py {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
}
.book-textbook .tongue-chunk .tongue-zh {
  white-space: nowrap;
}
.book-textbook .tongue-en {
  color: var(--muted);
  font-size: 15px;
  margin-top: 8px;
}
.book-textbook .bonus {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.book-textbook .video-card {
  background: var(--red-soft);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  color: #fff;
}
.book-textbook .video-screen {
  background: linear-gradient(160deg, #f6a39e, #e56a64);
  border-radius: 12px;
  min-height: 230px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
}
.book-textbook .video-screen .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 34px;
  font-weight: 800;
  display: block;
}
.book-textbook .video-screen .en {
  font-size: 18px;
  opacity: .95;
}
.book-textbook .video-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.book-textbook .video-note {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: .95;
}
.book-textbook .bonus-tip {
  margin: 0;
}
.book-textbook .classroom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.book-textbook .point {
  min-width: 0;
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.book-textbook .point-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--ink);
}
.book-textbook .point-title .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 800;
  color: var(--red);
}
.book-textbook .point-en {
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
}
.book-textbook .point-no {
  background: var(--red);
  color: #fff;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
}
.book-textbook .point-body {
  margin: 0 0 12px;
  background: var(--pink-bg);
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  gap: 4px;
}
.book-textbook .point-body .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
}
.book-textbook .point-body .en {
  color: var(--muted);
  font-size: 15px;
}
.book-textbook .examples {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.book-textbook .examples li {
  border: 2px solid var(--red-soft);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 18px;
  font-weight: 600;
}
.book-textbook .point-note {
  margin: 18px 0 12px;
  background: #fff7f6;
  border: 1px dashed var(--red-soft);
  border-radius: 10px;
  padding: 8px 12px;
  display: grid;
  gap: 2px;
}
.book-textbook .point-note .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 15px;
}
.book-textbook .point-note .en {
  color: var(--muted);
  font-size: 14px;
}
.book-textbook .card-plain {
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}
.book-textbook .exercise {
  display: grid;
  gap: 8px;
}
.book-textbook .ex-task {
  margin: 0;
  font-weight: 700;
}
.book-textbook .ex-task .zh {
  font-family: "Times New Roman", var(--zh-font);
  color: var(--red);
  font-size: 17px;
}
.book-textbook .ex-task .en {
  color: var(--muted);
  font-weight: 400;
  font-size: 15px;
  margin-left: 6px;
}
.book-textbook .ex-items {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  display: grid;
  gap: 6px;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 18px;
}
.book-textbook .ex-items li {
  line-height: 1.6;
}
/* Đánh số (1), (2)… và chia 2 cột, bật bằng "numbered" / "columns: 2" trong dữ liệu bài */
.book-textbook .ex-items--numbered {
  counter-reset: exi;
}
.book-textbook .ex-items--numbered li {
  counter-increment: exi;
  position: relative;
  padding-left: 3em; /* dòng sau của cùng mục thẳng hàng với dòng đầu */
}
.book-textbook .ex-items--numbered li::before {
  content: "（" counter(exi) "）";
  position: absolute;
  left: 0;
  top: 0;
}
.book-textbook .ex-items--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 8px;
  padding-left: 16px;
}
@media (max-width: 560px) {
  .book-textbook .ex-items--grid {
    grid-template-columns: 1fr;
  }
}
/* Mục "(n) …" nhiều dòng: số ở cột riêng để dòng sau thẳng hàng với dòng đầu */
.book-textbook .ex-items--hanging li {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  align-items: start;
}
/* Khung tranh + câu điền chỗ trống (用本课新学的词语和语言点描述图片) */
.book-textbook .pic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.book-textbook .pic-card {
  margin: 0;
  min-width: 0;
  background: #fff;
  border: 2px solid var(--red-soft);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.book-textbook .pic-frame {
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  background: var(--pink-bg);
  border-radius: 10px;
}
.book-textbook .pic-vi {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 0 4px;
}
.book-textbook .pic-text {
  display: grid;
  gap: 4px;
  padding: 0 6px 6px;
}
.book-textbook .pic-line {
  margin: 0;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 19px;
  line-height: 2.1;
}
.book-textbook .blank {
  display: inline-block;
  width: 3em;
  border-bottom: 1.5px solid var(--ink);
  margin: 0 2px;
}
@media (max-width: 560px) {
  .book-textbook .pic-grid {
    grid-template-columns: 1fr;
  }
}
.book-textbook .ex-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.book-textbook .ex-options li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--pink-card);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
}
.book-textbook .opt-letter {
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.book-textbook .ex-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.book-textbook .activity-body {
  margin: 0;
  display: grid;
  gap: 4px;
}
.book-textbook .activity-body .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
}
.book-textbook .activity-body .en {
  color: var(--muted);
}
/* 课堂活动 kiểu hội thoại (Bài 8): tiêu đề nhóm, từ gợi ý, bong bóng lời thoại */
.book-textbook .act-pair {
  gap: 14px;
}
.book-textbook .pair-head {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
}
.book-textbook .pair-mark {
  width: 12px;
  height: 12px;
  background: var(--red);
  border-radius: 2px;
  flex: none;
}
.book-textbook .pair-head .zh {
  font-family: "Times New Roman", var(--zh-font);
  color: var(--ink);
}
.book-textbook .pair-head .en {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}
.book-textbook .act-pair .activity-body {
  margin-top: -4px;
}
.book-textbook .act-words {
  list-style: none;
  margin: 6px 0 4px;
  padding: 0 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 10px 18px;
}
.book-textbook .act-words li {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.book-textbook .act-tip {
  margin: 14px 0 0;
}
.book-textbook .act-tip .tip-who {
  font-size: 14px;
}
.book-textbook .dlg-bubble {
  position: relative;
  background: #f7b3ac;
  border-radius: 18px;
  padding: 16px 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 26px;
  align-items: start;
  color: var(--ink);
}
.book-textbook .dlg-bubble::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%);
  border-style: solid;
  border-width: 10px 12px 10px 0;
  border-color: transparent #f7b3ac transparent transparent;
}
.book-textbook .dlg-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.book-textbook .dlg-line--more {
  grid-column: 1 / -1;
}
.book-textbook .dlg-role {
  flex: none;
  font-family: "Times New Roman", var(--en-font);
  font-weight: 800;
  color: var(--ink);
}
.book-textbook .dlg-line .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}
@media (max-width: 560px) {
  .book-textbook .act-pair {
    padding: 16px 16px;
  }
  .book-textbook .act-words li {
    font-size: 21px;
  }
  .book-textbook .act-tip {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .book-textbook .act-tip .tip-who {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
  .book-textbook .dlg-bubble {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
    margin-left: 6px;
  }
  .book-textbook .dlg-bubble::before {
    left: 30px;
    top: -10px;
    transform: none;
    border-width: 0 10px 12px 10px;
    border-color: transparent transparent #f7b3ac transparent;
  }
}

/* Lưới đáp án A–D (课堂活动, Bài 6): phiên âm trên, chữ cái đỏ + từ dưới */
.book-textbook .act-options {
  list-style: none;
  margin: 14px 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}
.book-textbook .act-options li {
  display: grid;
  gap: 2px;
  justify-items: center;
}
.book-textbook .act-py {
  font-family: "Times New Roman", var(--en-font);
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
}
.book-textbook .act-word {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.book-textbook .act-word .zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 18px;
  color: var(--ink);
}
.book-textbook .act-letter {
  color: var(--red);
  font-weight: 800;
  font-size: 17px;
}
/* Bảng điền (课堂活动): kẻ đỏ, nền hồng nhạt, cột đầu để trống cho tên người điền */
.book-textbook .act-scroll {
  margin: 6px 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.book-textbook .act-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
}
.book-textbook .act-table th,
.book-textbook .act-table td {
  border: 1px solid var(--red);
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
}
.book-textbook .act-table thead th {
  background: transparent;
  line-height: 1.25;
}
.book-textbook .act-table thead .act-py {
  display: block;
}
.book-textbook .act-table thead .zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.book-textbook .act-corner {
  width: 22%;
}
.book-textbook .act-table tbody td {
  height: 48px;
  background: var(--pink-bg);
}
.book-textbook .act-label {
  font-family: "Times New Roman", var(--zh-font);
  font-weight: 600;
  color: var(--ink);
  text-align: left !important;
  padding-left: 8px !important;
}
.book-textbook .act-table--example tbody td {
  background: transparent;
  height: auto;
}
.book-textbook .act-table--example .act-letter {
  font-size: 18px;
}
/* Giá trị không phải chữ cái (vd. giờ 12:00~13:00) trong bảng ví dụ: chữ đen, không đỏ */
.book-textbook .act-ans {
  font-family: "Times New Roman", var(--en-font);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .book-textbook .act-ans {
    font-size: 13px;
    letter-spacing: -0.2px;
    white-space: nowrap;
  }
}
/* Chú thích trong ngoặc của tiêu đề cột / nhãn hàng (vd. 午饭 (wǔfàn, bữa trưa)) */
.book-textbook .act-gloss {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}
.book-textbook .act-gloss--inline {
  display: inline;
  font-size: 14px;
}
@media (max-width: 560px) {
  .book-textbook .act-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }
  .book-textbook .act-table {
    min-width: 300px;
  }
  .book-textbook .act-table thead .zh {
    font-size: 16px;
  }
}
.book-textbook .summary-sub {
  margin: 0;
  font-weight: 700;
  color: var(--red);
}
.book-textbook .summary-sub .zh {
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .form-table {
  width: 100%;
  border-collapse: collapse;
}
.book-textbook .form-table th, .book-textbook .form-table td {
  border: 1px solid var(--pink-line);
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}
.book-textbook .form-table th {
  background: var(--pink-bg);
  font-weight: 600;
  width: 46%;
}
.book-textbook .form-table th .zh, .book-textbook .form-table td .zh {
  font-family: "Times New Roman", var(--zh-font);
  display: block;
  font-size: 16px;
}
.book-textbook .form-table th .en, .book-textbook .form-table td .en {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}
.book-textbook .form-table .chk {
  width: 90px;
  text-align: center;
}
.book-textbook .form-table .chk-head .zh {
  color: var(--red);
  font-weight: 800;
}
.book-textbook .form-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
}
.book-textbook textarea {
  width: 100%;
  font: inherit;
  border: 2px solid var(--pink-line);
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
  background: #fff;
  color: var(--ink);
}
.book-textbook textarea:focus {
  border-color: var(--red);
  outline: none;
}
.book-textbook .point-sub {
  margin: 14px 0 4px;
  color: var(--red);
  font-size: 16px;
  font-weight: 800;
}
.book-textbook .point-sub .zh {
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .point-sub .en {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  margin-left: 6px;
}
.book-textbook .num-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}
.book-textbook .num-card {
  background: var(--pink-bg);
  border: 1px solid var(--pink-line);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.book-textbook .num-card .zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 18px;
  font-weight: 700;
}
.book-textbook .num-card .num-n {
  display: block;
  color: var(--red);
  font-weight: 700;
  font-size: 15px;
}
.book-textbook .num-py {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
/* Bảng số 0–99 (theo ảnh mẫu trong sách): nền hồng đào, kẻ đỏ, ô vuông */
.book-textbook .num-chart-wrap {
  margin: 6px 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.book-textbook .num-chart {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #f6b1a6;
  border: 2px solid #d9382f;
  color: #2b1714;
}
.book-textbook .num-chart td {
  border: 1px solid #d9382f;
  height: 68px;
  padding: 3px 2px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
}
.book-textbook .num-chart .nc-py {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 12px;
  color: #3b2c2a;
}
.book-textbook .num-chart .nc-zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
}
.book-textbook .num-chart .nc-n {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 15px;
}
/* Bảng nhiều cột (ảnh mẫu phần 百以上 và "2"): kẻ đỏ mảnh, nền trong suốt */
.book-textbook .cells-wrap {
  margin: 6px 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.book-textbook .cells-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
}
.book-textbook .cells-table td {
  border: 1px solid var(--red);
  padding: 6px 4px 8px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
}
.book-textbook .cells-table .ce-py {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 12px;
  color: var(--muted);
}
.book-textbook .cells-table .ce-zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
}
.book-textbook .cells-table .ce-n {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 15px;
  margin-top: 2px;
}
.book-textbook .cells-table .ce-en {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
/* Hội thoại điền chỗ trống (ảnh mẫu "完成对话") */
.book-textbook .dlg-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 4px;
  display: grid;
  gap: 16px;
}
/* Tùy chọn (viên thuốc) đứng trên danh sách điền từ: cách ra một khoảng như ảnh mẫu */
.book-textbook .ex-options + .dlg-list {
  margin-top: 16px;
}
.book-textbook .dlg {
  display: grid;
  grid-template-columns: 2.8em 1fr;
  align-items: start;
}
.book-textbook .dlg-no {
  font-family: "Times New Roman", var(--en-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  padding-top: 2px;
}
.book-textbook .dlg-lines {
  display: grid;
  gap: 10px;
}
.book-textbook .dlg-line {
  margin: 0;
  display: flex;
  align-items: baseline;
}
.book-textbook .dlg-nonum {
  grid-template-columns: 1fr;
}
.book-textbook .dlg-plain .dlg-sp {
  display: none;
}
.book-textbook .dlg-sp {
  flex: 0 0 var(--dlg-sp, 2.4em);
  font-family: "Times New Roman", var(--en-font);
  font-weight: 600;
  color: var(--ink);
}
.book-textbook .dlg-tx {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.book-textbook .dlg-blank {
  display: inline-block;
  width: 3.4em;
  border-bottom: 1px solid var(--ink);
  margin: 0 0.1em;
}
.book-textbook .questions {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}
.book-textbook .questions .zh {
  display: block;
  font-family: "Times New Roman", var(--zh-font);
}
.book-textbook .questions .en {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.book-textbook .listening {
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.book-textbook .choice-q {
  margin: 0 0 6px;
  font-family: "Times New Roman", var(--zh-font);
  font-size: 18px;
  font-weight: 600;
}
/* Khởi động (热身): lưới 3 cột như ảnh mẫu — khung tranh, bên dưới là phiên âm và "A 手机" */
.book-textbook .warm-task {
  margin: 0 0 18px;
}
.book-textbook .warm-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 18px;
}
.book-textbook .warm-cell {
  margin: 0;
  min-width: 0;
}
.book-textbook .warm-photo {
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f4f4; /* khung trống khi chưa có ảnh */
  overflow: hidden;
}
.book-textbook .warm-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Dãy đáp án A–F bên dưới lưới tranh: 6 ô thẳng hàng, phiên âm trên, "A 手机" dưới */
.book-textbook .warm-answers {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
}
.book-textbook .warm-ans {
  min-width: 0;
}
.book-textbook .warm-py {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}
.book-textbook .warm-line {
  display: inline-flex;
  align-items: flex-end; /* chữ cái thẳng hàng với dòng chữ Hán */
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}
.book-textbook .warm-ans.is-long .warm-zh {
  font-size: 16px;
}
/* Cột phiên âm + chữ Hán: phiên âm nằm đúng trên chữ Hán */
.book-textbook .warm-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.book-textbook .warm-letter {
  color: var(--red);
  font-size: 20px;
  font-weight: 800;
}
.book-textbook .warm-zh {
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .book-textbook .warm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }
  .book-textbook .warm-answers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 8px;
  }
  .book-textbook .warm-letter,
  .book-textbook .warm-zh {
    font-size: 18px;
  }
}
.book-textbook .pending-card {
  background: #fff;
  border: 2px dashed var(--red-soft);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.book-textbook .pending-card strong {
  color: var(--red);
  font-family: "Times New Roman", var(--zh-font);
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}
@media (max-width: 900px) {
  .book-textbook .app {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "nav" "main";
  }
  .book-textbook .lesson-nav {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--pink-line);
    padding: 10px 12px;
  }
  .book-textbook .nav-title {
    display: none;
  }
  .book-textbook .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 180px);
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .book-textbook .nav-item {
    scroll-snap-align: start;
  }
  .book-textbook .nav-item a, .book-textbook .nav-item span.nav-link {
    grid-template-columns: 26px 1fr;
    padding: 6px 8px;
  }
  .book-textbook .nav-no {
    font-size: 18px;
  }
  .book-textbook .nav-zh {
    font-size: 14px;
  }
  .book-textbook .nav-en {
    display: none;
  }
  .book-textbook .nav-soon {
    display: none;
  }
}
@media (max-width: 640px) {
  .book-textbook .main {
    padding: 20px 0px 48px;
  }
  .book-textbook .hero {
    grid-template-columns: 1fr;
  }
  .book-textbook .hero-num {
    border-radius: 18px 18px 0 0;
    min-height: 110px;
    font-size: 90px;
    justify-content: flex-start;
    padding-left: 22px;
  }
  .book-textbook .hero-body {
    border-radius: 0 0 18px 18px;
    padding: 18px 20px 20px;
  }
  .book-textbook .hero-zh {
    font-size: 30px;
  }
  .book-textbook .hero-chunks {
    column-gap: 12px;
  }
  .book-textbook .hero-chunk .hero-py {
    font-size: 14px;
  }
  .book-textbook .section-head .section-zh {
    font-size: 22px;
    padding: 6px 16px;
  }
  .book-textbook .section-head .section-en {
    font-size: 12px;
    padding: 0 10px;
  }
  .book-textbook .line {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
  }
  .book-textbook .avatar {
    width: 52px;
    height: 52px;
    font-size: 20px;
    border-width: 2px;
  }
  .book-textbook .avatar svg {
    width: 26px;
    height: 26px;
  }
  .book-textbook .speaker-name {
    font-size: 11px;
  }
  .book-textbook .speaker-py {
    display: none;
  }
  .book-textbook .bubble {
    padding: 10px 12px 12px 12px;
  }
  .book-textbook .bubble-zh {
    font-size: 21px;
  }
  .book-textbook .bubble::before {
    left: -9px;
  }
  .book-textbook .words-table td {
    padding: 8px 10px;
  }
  .book-textbook .w-pos, .book-textbook .w-py {
    display: none;
  }
  .book-textbook .w-zh {
    font-size: 17px;
  }
  .book-textbook .tip {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .book-textbook .tip-who {
    flex-direction: row;
    gap: 8px;
  }
  .book-textbook .card {
    padding: 16px 18px;
  }
  .book-textbook .card-title {
    font-size: 19px;
  }
  .book-textbook .tongue {
    padding: 16px 18px;
  }
  .book-textbook .tongue-zh {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .book-textbook * {
    transition: none !important;
    animation: none !important;
  }
}
.book-textbook .nav-appendix {
  display: block;
  margin: 14px 4px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--pink-bg);
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  border: 1px dashed var(--red-soft);
}
.book-textbook .nav-appendix:hover, .book-textbook .nav-appendix.is-current {
  background: var(--red);
  color: #fff;
  border-style: solid;
}
.book-textbook .ap-scroll {
  overflow-x: auto;
}
.book-textbook .ap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.book-textbook .ap-table th, .book-textbook .ap-table td {
  padding: 7px 10px;
  border-top: 1px dashed var(--pink-line);
  text-align: left;
  vertical-align: top;
}
.book-textbook .ap-table thead th {
  background: var(--red);
  color: #fff;
  border-top: 0;
  font-weight: 700;
}
.book-textbook .ap-table td.zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
}
.book-textbook .ap-table .ap-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}
.book-textbook .ap-table .ap-py {
  color: var(--muted);
}
.book-textbook .ap-table .ap-les {
  width: 1%;
  white-space: nowrap;
}
.book-textbook .ap-abbr {
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}
.book-textbook .ap-star {
  color: var(--red);
  font-weight: 800;
  margin-right: 4px;
}
.book-textbook .ap-letter-row th {
  background: var(--pink-card);
  color: var(--red);
  font-size: 18px;
  font-weight: 800;
  border-top: 0;
}
.book-textbook .ap-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.book-textbook .ap-search {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 2px solid var(--pink-line);
  border-radius: 10px;
  background: #fff;
}
.book-textbook .ap-search:focus {
  border-color: var(--red);
  outline: none;
}
/* Tiêu đề bài tập kiểu sách (ảnh mẫu "■ 大声朗读。Read aloud."): zh và en cùng một dòng */
.book-textbook .tasks--inline li {
  align-items: center;
}
.book-textbook .tasks--inline li::before {
  margin-top: 0;
}
.book-textbook .tasks--inline .zh {
  font-size: 17px;
}
.book-textbook .tasks--inline .en {
  display: inline;
  margin-left: 6px;
}
/* Khung đỏ kiểu sách (ảnh mẫu 大声朗读): kẻ đỏ, nền trắng, các khung cách nhau */
.book-textbook .read-box {
  background: #fff;
  border: 2px solid var(--red);
  border-radius: 4px;
  margin: 14px 0 0;
  overflow: hidden;
}
/* Dòng đọc số/ngày: phiên âm nhỏ phía trên, chữ Hán và nghĩa cùng dòng */
.book-textbook .read-line {
  padding: 10px 16px;
}
.book-textbook .read-line + .read-line {
  padding-top: 0;
}
.book-textbook .read-py {
  display: block;
  font-family: "Times New Roman", var(--en-font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
}
.book-textbook .read-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2px 16px;
}
/* Các cụm pinyin + chữ Hán: pinyin canh ngay phía trên chữ của cụm đó (giống .bubble-chunks) */
.book-textbook .read-chunks {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 6px;
  row-gap: 4px;
  min-width: 0;
}
.book-textbook .read-chunk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.book-textbook .read-chunk .read-py {
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
}
.book-textbook .read-chunk .read-zh {
  white-space: nowrap;
}
.book-textbook .read-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.book-textbook .read-n {
  font-size: 16px;
  color: var(--ink);
}
/* Lưới tháng / thứ: 6 cột (tháng) hoặc 4 cột (thứ); hàng cách nhau bằng kẻ ngang đỏ */
.book-textbook .rg-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}
.book-textbook .rg-row + .rg-row {
  border-top: 2px solid var(--red);
}
.book-textbook .rg-cell {
  min-width: 0;
  padding: 12px 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.book-textbook .rg-py {
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
}
.book-textbook .rg-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
}
.book-textbook .rg-n {
  font-size: 15px;
  color: var(--ink);
}
@media (max-width: 560px) {
  .book-textbook .read-zh {
    font-size: 19px;
  }
  /* Điện thoại: cụm dài không vượt khung; phiên âm của cụm xuống dòng trong chính cột của cụm, không tách khỏi chữ */
  .book-textbook .read-chunk {
    max-width: 100%;
  }
  .book-textbook .read-chunk .read-py {
    white-space: normal;
  }
  .book-textbook .read-n {
    font-size: 15px;
  }
  .book-textbook .rg-row {
    grid-template-columns: repeat(var(--cols-sm), minmax(0, 1fr));
  }
  .book-textbook .rg-py {
    font-size: 12px;
  }
  .book-textbook .rg-zh {
    font-size: 19px;
  }
  .book-textbook .rg-n {
    font-size: 14px;
  }
}
/* Bảng kẻ đỏ có tiêu đề (kind "table", ảnh mẫu "大声朗读" bài 7: 点 | 分 | 数字写法) */
.book-textbook .grid-table-wrap {
  margin: 12px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.book-textbook .grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  border: 1.5px solid var(--red);
}
.book-textbook .grid-table th,
.book-textbook .grid-table td {
  border: 1.5px solid var(--red);
  padding: 10px 10px;
  text-align: center;
  vertical-align: middle;
  min-width: 0;
}
.book-textbook .grid-table thead th {
  padding: 8px 10px;
  font-weight: 600;
}
.book-textbook .grid-table .gt-zh {
  font-family: "Times New Roman", var(--zh-font);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
}
.book-textbook .grid-table thead .gt-zh {
  font-weight: 600;
}
.book-textbook .grid-table .gt-n {
  font-family: "Times New Roman", var(--en-font);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
}
.book-textbook .grid-table .gt-en {
  font-family: "Times New Roman", var(--en-font);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  white-space: normal;
}
@media (max-width: 560px) {
  .book-textbook .grid-table th,
  .book-textbook .grid-table td {
    padding: 8px 4px;
  }
  .book-textbook .grid-table .gt-zh {
    font-size: 17px;
    white-space: normal;
  }
  .book-textbook .grid-table .gt-n {
    font-size: 17px;
  }
  .book-textbook .grid-table .gt-en {
    display: block;
    font-size: 12px;
  }
}
