/* RQX Reader bản chính thức (11/11/2026), lên từ bản demo 10/11/2026
   Bảng màu: trời #CFE6F5, giấy #FFFDF8, mực #1F2A44, son RQX #D7261E, nắng #FFB627, lá #2E9E6A, đêm đọc #22324F */
:root {
  --troi: #CFE6F5;
  --troi-sang: #EAF5FC;
  --giay: #FFFDF8;
  --giay-2: #F6F1E6;
  --muc: #1F2A44;
  --muc-2: #55607A;
  --muc-3: #8B93A7;
  --do: #D7261E;
  --do-dam: #A81B15;
  --nang: #FFB627;
  --la: #2E9E6A;
  --dem: #22324F;
  --dem-2: #182439;
  --vien: rgba(31, 42, 68, .12);
  --bong-sach: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 3px rgba(31,42,68,.18), 0 14px 28px -10px rgba(31,42,68,.35);
  --ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --han: var(--zh);
  --tua: var(--zh);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--ui);
  color: var(--muc);
  background: var(--troi-sang);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[lang="zh"] { font-family: var(--han); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 1em; height: 1em; display: block; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--nang); outline-offset: 2px; border-radius: 10px; }

/* ===== màn chờ ===== */
.tai { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muc-2); text-align: center; padding: 24px; background: var(--troi); }
.tai-sach { width: 54px; height: 40px; border-radius: 4px 4px 6px 6px; background: var(--giay); box-shadow: var(--bong-sach); position: relative; animation: mo 1.2s ease-in-out infinite alternate; }
.tai-sach::after { content: ""; position: absolute; inset: 0 50% 0 auto; width: 2px; background: var(--vien); }
@keyframes mo { to { transform: translateY(-6px) rotate(-3deg); } }

/* ===== nút chung ===== */
.nut { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.nut svg { font-size: 20px; }
.nut:active { transform: translateY(1px) scale(.98); }
.nut-do { background: var(--do); color: #fff; box-shadow: 0 6px 0 -1px var(--do-dam), 0 12px 22px -8px rgba(215,38,30,.6); }
.nut-do:hover { background: #E23129; }
.nut-vien { background: var(--giay); color: var(--muc); box-shadow: inset 0 0 0 2px var(--muc); }
.nut-nhat { color: var(--muc-2); }
.nut-nhat:hover { color: var(--muc); }
.nut-tron { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--giay); color: var(--muc); box-shadow: 0 2px 8px rgba(31,42,68,.12); font-size: 22px; flex: none; }
.nut-tron.toi { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.nut-tron.toi:hover { background: rgba(255,255,255,.18); }

/* ===== THƯ VIỆN ===== */
.tv { min-height: 100dvh; display: grid; grid-template-columns: 96px 1fr; background:
  radial-gradient(1200px 420px at 70% -120px, #fff 0%, rgba(255,255,255,0) 70%),
  linear-gradient(180deg, var(--troi) 0, var(--troi-sang) 420px, var(--giay) 100%); }
.ray { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0; border-right: 1px solid rgba(31,42,68,.06); }
.ray-logo { display: grid; justify-items: center; gap: 4px; margin-bottom: 18px; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.ray-logo img { width: 46px; height: 46px; object-fit: contain; }
.ray-muc { width: 72px; display: grid; justify-items: center; gap: 4px; padding: 10px 0 8px; border-radius: 18px; color: var(--muc-2); font-size: 12px; font-weight: 600; }
.ray-muc svg { font-size: 26px; }
.ray-muc:hover { color: var(--muc); background: rgba(255,255,255,.5); }
.ray-muc.on { color: var(--do); background: var(--giay); box-shadow: 0 4px 14px -6px rgba(31,42,68,.3); }
.tv-than { min-width: 0; padding: 34px clamp(18px, 4vw, 56px) 40px; max-width: 1240px; }

.tv-dau { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.tv-dau h1 { margin: 0 0 6px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.tv-dau p { margin: 0; color: var(--muc-2); max-width: 56ch; line-height: 1.55; }
.chuoi { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 16px 10px 12px; border-radius: 18px; background: var(--giay); box-shadow: 0 6px 18px -10px rgba(31,42,68,.4); flex: none; }
.chuoi svg { grid-row: span 2; font-size: 30px; color: #F08A24; }
.chuoi b { font-size: 22px; line-height: 1; }
.chuoi span { font-size: 12px; color: var(--muc-2); }

/* thẻ nổi bật: một cuốn sách mở trên bàn */
.noi-bat { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(18px, 3vw, 40px); padding: clamp(14px, 2vw, 22px); border-radius: 30px; background: var(--giay); box-shadow: 0 30px 60px -36px rgba(31,42,68,.55), 0 0 0 1px rgba(31,42,68,.05); margin-bottom: 40px; }
.nb-anh { display: block; position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--bong-sach); transform: rotate(-1.2deg); transition: transform .3s ease; }
.noi-bat:hover .nb-anh { transform: rotate(0); }
.nb-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-anh::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0)); z-index: 1; }
.nb-chu { display: grid; gap: 8px; justify-items: start; padding-right: 10px; }
.nb-chu small { font-size: 14px; font-weight: 700; color: var(--la); }
.nb-chu b { font-family: var(--tua); font-weight: 400; font-size: clamp(40px, 5.6vw, 72px); line-height: 1.05; letter-spacing: .04em; }
.nb-chu i { font-style: normal; font-size: 18px; color: var(--muc-2); }
.nb-meta { font-size: 14px; color: var(--muc-3); margin-bottom: 10px; }

/* kệ sách */
.ke { margin-bottom: 34px; }
.ke-dau { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.ke-dau h2 { margin: 0; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ke-dau h2 [lang="zh"] { font-family: var(--tua); font-weight: 400; font-size: 24px; }
.ke-dau > span { font-size: 13px; color: var(--muc-3); text-align: right; }
.ke-so { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--cap); color: #fff; font-size: 15px; }
.ke-hang { display: flex; gap: 20px; overflow-x: auto; padding: 4px 4px 22px; margin: 0 -4px; scroll-snap-type: x proximity; scrollbar-width: thin; position: relative; }
.ke-hang::-webkit-scrollbar { height: 6px; }
.ke-hang::-webkit-scrollbar-thumb { background: rgba(31,42,68,.18); border-radius: 3px; }

.cuon { flex: none; width: 212px; scroll-snap-align: start; display: grid; gap: 9px; }
.cuon-mat { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 5px 12px 12px 5px; overflow: hidden; background: var(--giay-2); box-shadow: var(--bong-sach), 5px 5px 0 -1px #fff, 5px 5px 0 0 rgba(31,42,68,.12); transition: transform .2s ease, box-shadow .2s ease; }
.cuon-mat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 60%, rgba(0,0,0,0)); z-index: 2; }
.cuon:hover .cuon-mat { transform: translateY(-4px) rotate(-.6deg); }
.cuon-mat img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bia-ten-dai { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 9px 18px; background: linear-gradient(180deg, rgba(31,42,68,0), rgba(31,42,68,.7)); color: #fff; z-index: 1; }
.bia-ten-dai b { font-family: var(--tua); font-weight: 400; font-size: 24px; letter-spacing: .04em; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.cuon-cap { position: absolute; bottom: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--cap); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 0 0 2px #fff; }
.cuon-xong { position: absolute; top: 8px; left: 16px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--nang); color: #fff; font-size: 17px; box-shadow: 0 0 0 2px #fff; }
.cuon-tien { height: 5px; border-radius: 3px; background: rgba(31,42,68,.1); overflow: hidden; }
.cuon-tien i { display: block; height: 100%; background: var(--la); border-radius: 3px; }
.cuon-vi { font-size: 14px; font-weight: 600; line-height: 1.35; padding-left: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cuon.chua { width: 168px; }
.cuon.chua .cuon-vi { color: var(--muc-2); font-weight: 500; }

/* bìa chữ cho truyện chưa có tranh: vải bọc màu bộ truyện + dấu son */
.bia-chu { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 4px; padding: 30px 14px 12px 22px; text-align: center; color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, rgba(255,255,255,0) 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.05) 0 2px, rgba(0,0,0,0) 2px 5px),
    var(--mau, #5B7DB1); }
.bia-chu b { font-family: var(--tua); font-weight: 400; font-size: 25px; line-height: 1.15; letter-spacing: .05em; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.bia-chu i { display: none; }
.bia-chu em { position: absolute; left: 16px; top: 8px; font-style: normal; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); }
.bia-chu.lon { border-radius: inherit; padding: 20px; }
.bia-tom-rieng { display: none; }
.bia-chu.lon b { font-size: clamp(44px, 7vw, 80px); }
.cuon.chua .cuon-mat { filter: saturate(.85); }

.bq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 30px 16px 10px; color: var(--muc-3); font-size: 12.5px; text-align: center; }
.bq img { height: 26px; width: auto; opacity: .9; }
.bq small { flex-basis: 100%; font-size: 11px; opacity: .8; }

/* Của bé */
.so-lieu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.so-lieu div { background: var(--giay); border-radius: 20px; padding: 18px; display: grid; gap: 2px; box-shadow: 0 10px 26px -18px rgba(31,42,68,.5); }
.so-lieu b { font-size: 34px; line-height: 1.1; }
.so-lieu span { font-size: 13px; color: var(--muc-2); }
.trong { color: var(--muc-2); background: var(--giay); padding: 20px; border-radius: 18px; margin: 0; line-height: 1.55; }

/* thẻ từ */
.the-tu { display: flex; flex-wrap: wrap; gap: 10px; }
.tu { display: grid; justify-items: start; gap: 1px; padding: 10px 16px 10px 14px; border-radius: 16px; background: var(--giay); box-shadow: inset 0 0 0 1.5px var(--vien); text-align: left; transition: box-shadow .15s, transform .15s; min-width: 92px; }
.tu:hover { box-shadow: inset 0 0 0 2px var(--do); }
.tu:active { transform: scale(.97); }
.tu b { font-size: 22px; font-weight: 700; line-height: 1.2; }
.tu small { font-family: var(--han); font-size: 13px; color: var(--do); }
.tu i { font-style: normal; font-size: 12.5px; color: var(--muc-2); }
.the-tu.nho .tu { padding: 7px 12px; min-width: 0; }
.the-tu.nho .tu b { font-size: 18px; }

/* ===== BÌA TRUYỆN ===== */
.bia-man { min-height: 100dvh; padding: 18px clamp(16px, 4vw, 56px) 30px; background:
  radial-gradient(900px 500px at 20% 0, #fff 0, rgba(255,255,255,0) 70%),
  linear-gradient(180deg, var(--troi) 0, var(--troi-sang) 60%, var(--giay) 100%); }
.bia-dau { display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto 22px; }
.bia-nhan { font-size: 14px; font-weight: 600; color: var(--muc-2); }
.bia-nhan [lang="zh"] { font-family: var(--tua); font-size: 17px; color: var(--muc); }
.bia-chinh { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "to tin" "to the"; gap: 18px clamp(22px, 4vw, 56px); align-items: start; }
.bia-to { grid-area: to; position: relative; aspect-ratio: 4 / 3; border-radius: 8px 22px 22px 8px; overflow: hidden; background: var(--giay-2); box-shadow: 0 2px 3px rgba(31,42,68,.2), 0 40px 70px -34px rgba(31,42,68,.6), 9px 9px 0 -2px #fff, 9px 9px 0 0 rgba(31,42,68,.12), 17px 17px 0 -4px #fff, 17px 17px 0 -2px rgba(31,42,68,.1); }
.bia-to::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 22px; z-index: 2; background: linear-gradient(90deg, rgba(0,0,0,.3), rgba(255,255,255,.15) 55%, rgba(0,0,0,0)); }
.bia-to img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Mẫu bìa 13/11/2026 (theo ảnh anh Hạnh duyệt): tên truyện ở dải trời phía trên, ngay dưới là MỘT dòng tác giả màu đỏ,
   bản quyền nhỏ ở góc dưới phải. Cỡ chữ tính theo bề rộng bìa (cqw) để điện thoại và laptop cùng tỉ lệ, chữ chỉ chiếm ~20% trên cùng.
   Kiểu chữ theo nhóm người đọc: A trẻ nhỏ chữ tròn vui mắt; B trẻ lớn chữ nghệ thuật; C người trưởng thành chữ thư pháp/serif.
   Phông Latin đều có bộ chữ tiếng Việt (Google Fonts subset vietnamese), nạp ở index.html. */
.bia-to { container-type: inline-size; }
.bia-chu-tren-tranh { position: absolute; z-index: 3; top: 2.6%; left: 6%; right: 5%; text-align: center; color: #b3261e; pointer-events: none;
  --vien-chu: #fff; text-shadow: -1px -1px 0 var(--vien-chu), 1px -1px 0 var(--vien-chu), -1px 1px 0 var(--vien-chu), 1px 1px 0 var(--vien-chu), 0 0 6px rgba(255,255,255,.95); }
.bia-chu-tren-tranh > .bia-ten { display: block; font-family: var(--bia-ten); font-weight: 400; font-size: clamp(22px, 6.4cqw, 72px); line-height: 1.12; letter-spacing: .04em; }
.bia-ghi-cong { margin: .35em 0 0; display: flex; justify-content: center; flex-wrap: nowrap; white-space: nowrap; column-gap: 1.4em; font-family: var(--bia-ghi); font-size: clamp(9.5px, 2.25cqw, 22px); font-weight: 700; line-height: 1.25; color: #c62828; }
.bia-phong-cach-A { --bia-ten: "ZCOOL KuaiLe", var(--zh); --bia-ghi: "Baloo 2", var(--ui); }
.bia-phong-cach-A .bia-ghi-cong { font-weight: 800; letter-spacing: .01em; }
.bia-phong-cach-B { --bia-ten: "ZCOOL QingKe HuangYou", var(--zh); --bia-ghi: "Lobster", var(--ui); }
.bia-phong-cach-B .bia-ghi-cong { font-weight: 400; letter-spacing: .02em; }
.bia-phong-cach-C { --bia-ten: "Ma Shan Zheng", var(--zh); --bia-ghi: "Playfair Display", Georgia, serif; }
.bia-phong-cach-C .bia-ten { letter-spacing: .08em; }
.bia-phong-cach-C .bia-ghi-cong { font-style: italic; font-weight: 700; }
.bia-ban-quyen { position: absolute; z-index: 3; right: 2.2%; bottom: 2%; font: 600 clamp(8px, 1.55cqw, 14px)/1.2 var(--ui); color: #243047; text-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 8px #fff; pointer-events: none; white-space: nowrap; }
/* Tên truyện đã nằm trên tranh bìa: không lặp lại tiêu đề to bên cạnh, chỉ giữ cho trình đọc màn hình */
.bia-thong-tin h1.an-chu { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bia-thong-tin { grid-area: tin; padding-top: 6px; }
.bia-thong-tin h1 { margin: 0; font-family: var(--tua); font-weight: 400; font-size: clamp(46px, 6.4vw, 84px); line-height: 1.02; letter-spacing: .05em; }
.bia-thong-tin .py { margin: 6px 0 2px; font-family: var(--han); font-weight: 500; color: var(--do); font-size: 18px; }
.bia-thong-tin .vi { margin: 0 0 14px; font-size: 19px; font-weight: 700; }
.bia-thong-tin .tom { margin: 0 0 10px; color: var(--muc-2); line-height: 1.6; max-width: 46ch; }
.bia-thong-tin .meta { margin: 0; font-size: 13.5px; color: var(--muc-3); }
.bia-tac-gia { font-size: 13px; line-height: 1.5; margin: 8px 0 0; color: var(--muc-2); }

/* thẻ treo chọn cách đọc */
.the-treo { grid-area: the; position: relative; padding-top: 34px; transform-origin: 50% 0; animation: du 1.6s cubic-bezier(.3,.6,.4,1) .25s both; max-width: 430px; }
@keyframes du { 0% { transform: rotate(9deg); } 30% { transform: rotate(-5deg); } 55% { transform: rotate(2.5deg); } 78% { transform: rotate(-1deg); } 100% { transform: rotate(0); } }
.the-day { position: absolute; top: 0; left: 50%; width: 2px; height: 46px; background: linear-gradient(#9C7A55, #C2A27E); transform: translateX(-50%); }
.the-day::before { content: ""; position: absolute; top: -5px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #9C7A55; }
.the-than { position: relative; background: var(--giay); border-radius: 22px 22px 26px 26px; padding: 30px 18px 18px; box-shadow: 0 24px 40px -26px rgba(31,42,68,.6), 0 0 0 1px rgba(31,42,68,.06); clip-path: polygon(34px 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%, 0 34px); border-top: 0; }
.the-lo { position: absolute; top: 10px; left: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translateX(-50%); background: var(--troi); box-shadow: inset 0 0 0 3px #E9D9BF; }
.the-than > p { margin: 6px 0 14px; text-align: center; font-weight: 800; font-size: 15px; color: var(--muc-2); }
.che-nut { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; margin-bottom: 10px; transition: transform .15s, box-shadow .15s; }
.che-nut > svg { font-size: 30px; width: 52px; height: 52px; padding: 11px; border-radius: 15px; }
.che-nut b { display: block; font-size: 18px; }
.che-nut small { display: block; font-size: 13px; line-height: 1.4; margin-top: 2px; }
.che-nut.may { background: var(--do); color: #fff; box-shadow: 0 5px 0 -1px var(--do-dam); }
.che-nut.may > svg { background: rgba(255,255,255,.18); }
.che-nut.may small { color: rgba(255,255,255,.88); }
.che-nut.tu { background: #EAF4EE; color: var(--muc); box-shadow: inset 0 0 0 2px rgba(46,158,106,.35); }
.che-nut.tu > svg { background: var(--la); color: #fff; }
.che-nut.tu small { color: var(--muc-2); }
/* 13/11/2026: 3 nút chọn chế độ trên bìa dùng chung font tiếng Việt; chặn '.tu small' (font chữ Hán của thẻ từ) lọt vào nút Tự đọc */
.the-than .che-nut b, .the-than .che-nut small { font-family: var(--ui); }
.che-nut:hover { transform: translateY(-2px); }
.che-nut:active { transform: translateY(1px); }
.tiep { display: block; text-align: center; font-weight: 700; font-size: 14px; color: var(--la); padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.the-treo.chua .the-than { text-align: center; }
.the-treo.chua small { color: var(--muc-2); }

.bia-phu { max-width: 1180px; margin: 36px auto 0; }
.bia-phu h2 { font-size: 18px; font-weight: 800; margin: 0 0 14px; }
.dai-trang { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.dai-trang a { position: relative; flex: none; width: 150px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 16px -10px rgba(31,42,68,.6); transition: transform .15s; }
.dai-trang a:hover { transform: translateY(-3px); }
.dai-trang img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dai-trang span { position: absolute; left: 6px; bottom: 6px; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 6px; background: rgba(255,253,248,.92); font-size: 12px; font-weight: 800; }
.bia-phu.meo { background: #FFF6DE; border-radius: 22px; padding: 20px 22px; box-shadow: inset 0 0 0 1.5px rgba(255,182,39,.45); }
.bia-phu.meo h2 { margin-bottom: 6px; }
.bia-phu.meo p { margin: 0; line-height: 1.65; color: #5A4A2A; }
.dau-chim { position: absolute; left: 50%; bottom: 1.6%; transform: translateX(-50%); z-index: 3; font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: rgba(31,42,68,.38); text-shadow: 0 0 4px rgba(255,255,255,.7); pointer-events: none; white-space: nowrap; }

/* ===== ĐỌC ===== */
.doc { position: fixed; inset: 0; color: #fff; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "dau cc" "san cc";
  background:
    radial-gradient(70% 60% at 46% 48%, #3A5078 0%, rgba(58,80,120,0) 72%),
    radial-gradient(120% 90% at 50% 120%, var(--dem-2) 0, rgba(24,36,57,0) 60%),
    var(--dem); }
.doc-dau { grid-area: dau; display: flex; align-items: center; gap: 12px; padding: 6px clamp(10px, 1.5vw, 18px) 2px; min-width: 0; }
.doc-dau .nut-tron.toi { width: 34px; height: 34px; font-size: 16px; flex: none; }
.doc-ten { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.doc-ten b { font-family: var(--tua); font-weight: 400; font-size: 20px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-ten span { font-size: 12.5px; color: rgba(255,255,255,.68); white-space: nowrap; flex: none; }
.che-chon { display: grid; grid-template-columns: 1fr; gap: 4px; width: 100%; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); flex: none; }
.che-chon button { display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px; padding: 0 6px; border-radius: 12px; font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.78); transition: background .2s, color .2s; width: 100%; }
.che-chon button svg { font-size: 15px; flex: none; }
.che-chon button[aria-checked="true"] { background: var(--giay); color: var(--muc); box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); }
.che-chon button[aria-checked="true"][data-che="may"] svg { color: var(--do); }
.che-chon button[aria-checked="true"][data-che="tu"] svg { color: var(--la); }

.san { grid-area: san; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 10px 8px; min-height: 0; min-width: 0; }
.mui { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 22px; background: var(--giay); color: var(--muc); box-shadow: 0 10px 22px -8px rgba(0,0,0,.6); transition: transform .15s, opacity .2s; z-index: 4; }
.mui:hover { transform: scale(1.06); }
.mui:active { transform: scale(.95); }
.mui:disabled { opacity: .18; cursor: default; transform: none; }
.mui.sau { background: var(--nang); }

/* cuốn sách mở: mở rộng tối đa diện tích còn lại */
.sach-mo { position: relative; display: flex; container-type: inline-size; animation: vao .38s ease-out both; }
@keyframes vao { from { opacity: 0; transform: translateX(14px) scale(.99); } to { opacity: 1; transform: none; } }
.doi .sach-mo { flex: 1 1 auto; width: 100%; height: 100%; max-width: calc((100dvh - 46px) * 2.38); max-height: calc(100dvh - 46px); border-radius: 8px; box-shadow: 0 0 0 5px #EFE7D6, 0 0 0 6px rgba(0,0,0,.15), 0 3px 0 6px #DCD2BD, 0 6px 0 6px #CFC4AC, 0 32px 64px -20px rgba(0,0,0,.75); background: #EFE7D6; }
.doi .sach-mo::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 70px; transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0, rgba(0,0,0,.08) 32%, rgba(0,0,0,.32) 49%, rgba(255,255,255,.12) 51%, rgba(0,0,0,.08) 68%, rgba(0,0,0,0) 100%); }
.don .sach-mo { flex: 1 1 auto; width: 100%; height: 100%; max-width: calc((100dvh - 52px) * 1.18); max-height: calc(100dvh - 52px); border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 5px #EFE7D6, 0 30px 60px -20px rgba(0,0,0,.75); }

.trang { position: relative; margin: 0; flex: 1 1 0; min-width: 0; min-height: 0; height: 100%; display: grid; overflow: hidden; container-type: inline-size; background: var(--giay-2); }
.doi .trang, .don .trang { height: 100%; }
.doi .trang:first-child { border-radius: 6px 0 0 6px; }
.doi .trang:last-child { border-radius: 0 6px 6px 0; }
.trang.rong { background: #F4EEE0 repeating-linear-gradient(0deg, rgba(31,42,68,.03) 0 1px, rgba(0,0,0,0) 1px 28px); }
.trang > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.so-trang { position: absolute; bottom: 1.4%; right: 3%; z-index: 3; font-size: 11px; font-weight: 700; color: rgba(31,42,68,.45); text-shadow: 0 0 4px rgba(255,255,255,.8); }
.doi .trang:first-child .so-trang { right: auto; left: 3%; }

/* chữ nằm trên tranh: không bong bóng, chỉ quầng sáng mềm sau chữ */
.lop-chu { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; gap: 3cqw; padding: 4.2cqw 4.6cqw 6.8cqw; min-height: 100%; }
.dai { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2.4cqw 4cqw; }
.dai:empty { display: none; }
.dai.tren:empty + .dai.duoi { margin-top: auto; }
.vung { display: grid; gap: 1.6cqw; max-width: 66%; position: relative; }
.vung::before { content: ""; position: absolute; inset: -2.4cqw -3.2cqw; z-index: -1; border-radius: 44%; background: radial-gradient(closest-side, rgba(255,253,248,.9) 0%, rgba(255,253,248,.74) 52%, rgba(255,253,248,0) 100%); filter: blur(5px); }
.o-tl, .o-bl { margin-right: auto; }
.o-tr, .o-br { margin-left: auto; }
.o-tc, .o-bc { margin: 0 auto; text-align: center; max-width: 86%; }
.cap-5 .vung, .cap-6 .vung, .cap-7 .vung, .cap-8 .vung, .trang.day .vung, .don .vung { max-width: 92%; }
.cau { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.4cqw; align-items: start; color: var(--muc); }
.o-tc .cau, .o-bc .cau { justify-content: center; }
.loa { width: max(28px, 6.2cqw); height: max(28px, 6.2cqw); margin-top: .1em; border-radius: 50%; display: grid; place-items: center; font-size: max(15px, 3.3cqw); color: #fff; background: var(--la); box-shadow: 0 3px 8px -3px rgba(31,42,68,.55), 0 0 0 2px rgba(255,255,255,.9); transition: transform .15s, background .15s; }
.loa:hover { transform: scale(1.08); }
.che-may .loa { background: rgba(31,42,68,.55); width: max(24px, 5cqw); height: max(24px, 5cqw); font-size: max(13px, 2.7cqw); }
.cau.dang .loa { background: var(--do); animation: nhip 1s ease-in-out infinite; }
@keyframes nhip { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(215,38,30,.18), 0 0 0 2px rgba(255,255,255,.9); } }

.cau-chu { font-family: var(--han); font-weight: 700; font-size: max(20px, 6cqw); line-height: 1.5; letter-spacing: .02em;
  text-shadow: 0 0 2px #fff, 0 0 6px rgba(255,255,255,.95), 0 0 12px rgba(255,255,255,.8); }
.cap-3 .cau-chu, .cap-4 .cau-chu { font-size: max(17px, 4.6cqw); }
.cap-5 .cau-chu, .cap-6 .cau-chu { font-size: max(15px, 3.6cqw); }
.cap-7 .cau-chu, .cap-8 .cau-chu { font-size: max(14px, 3.2cqw); }
.trang.day .cau-chu { font-size: max(14px, 3.4cqw); }
.co-py .cau-chu { line-height: 1.85; }
.seg { cursor: pointer; border-radius: 4px; transition: color .12s; position: relative; }
.seg.dau { cursor: default; }
.seg[data-tu]:hover { background: rgba(255,182,39,.25); }
ruby { ruby-position: over; }
.co-py ruby { margin: 0 .1em; }
rt { font-family: var(--han); font-weight: 500; font-size: .5em; letter-spacing: 0; color: var(--muc-2); text-shadow: 0 0 3px #fff, 0 0 6px #fff; }
.seg.da { color: var(--do); }
.seg.da rt { color: var(--do); }
.seg.nay { color: var(--do); }
.seg.nay::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.05em; height: .14em; border-radius: .07em; background: var(--nang); }
.cau-vi { grid-column: 2; display: none; font-family: var(--ui); font-weight: 600; font-size: max(12px, 2.3cqw); line-height: 1.4; color: #2D3A57; margin-top: .2em; text-shadow: 0 0 2px #fff, 0 0 6px #fff, 0 0 10px #fff; }
.hien-vi .cau-vi { display: block; }

/* Trình bày cấp cao (HSK 3 - HSK 4, phân loại Đi học đi làm): giảm bớt hình, vài trang mới chèn 1 tranh Manhua */
.trang-chu-nho {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  background: linear-gradient(180deg, #FFFDF8 0%, #F3ECE0 100%);
  border: 1.5px dashed rgba(31, 42, 68, .18);
  text-align: center;
  color: var(--muc);
}
.trang-chu-nho b { font-family: var(--han); font-size: 13px; line-height: 1.3; color: var(--muc); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trang-chu-nho small { font-size: 10px; font-weight: 700; color: var(--do); position: static !important; background: none !important; min-width: 0 !important; height: auto !important; padding: 0 !important; }

.trang.trang-van-ban {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4.2cqw 5.4cqw 6.4cqw;
  background:
    linear-gradient(180deg, rgba(215, 38, 30, .035) 0%, rgba(255, 253, 248, 0) 16%),
    repeating-linear-gradient(0deg, rgba(31, 42, 68, .035) 0 1px, transparent 1px 34px),
    #FCF8EE;
  overflow-y: auto;
}
.tvb-dau {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2.2cqw;
  margin-bottom: 2.8cqw;
  border-bottom: 2px solid rgba(215, 38, 30, .22);
}
.tvb-ten { font-family: var(--han); font-weight: 700; font-size: max(13px, 2.5cqw); color: var(--do); }
.tvb-nhan { font-size: max(10.5px, 1.9cqw); font-weight: 700; color: var(--muc-3); background: rgba(31, 42, 68, .06); padding: 2px 8px; border-radius: 999px; }
.tvb-than { display: grid; gap: 2.6cqw; align-content: start; flex: 1; }
.trang-van-ban .cau {
  padding: 1.8cqw 2.2cqw;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, .08);
}
.trang-van-ban .cau-chu,
.trang-manhua-xen .cau-chu { text-shadow: none; }
.trang-van-ban .cau-vi,
.trang-manhua-xen .cau-vi { text-shadow: none; }

.trang.trang-manhua-xen {
  display: grid;
  grid-template-rows: 46% minmax(0, 1fr);
  background: #FCF8EE;
  overflow: hidden;
}
.tmx-tranh {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-bottom: 2.5px solid #1E293B;
  background: var(--giay-2);
}
.tmx-tranh img,
.tmx-tranh .canh-o { width: 100%; height: 100%; object-fit: cover; display: block; }
.tmx-nhan {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  backdrop-filter: blur(4px);
}
.tmx-chu {
  padding: 2.6cqw 4.4cqw 5.8cqw;
  display: grid;
  gap: 2cqw;
  align-content: start;
  overflow-y: auto;
  background: #FCF8EE;
}
.tmx-chu .cau {
  padding: 1.4cqw 1.8cqw;
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, .07);
}

/* thanh công cụ bên phải: gom toàn bộ nút chức năng của màn đọc */
.cong-cu { grid-area: cc; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; width: 92px; max-height: 100dvh; padding: 8px 10px 8px 6px; overflow-y: auto; background: rgba(15, 23, 42, .36); border-left: 1px solid rgba(255,255,255,.08); z-index: 6; }
.cong-cu .nut-theo, .cong-cu .nut-tung-cau { width: 100%; height: auto; display: grid; justify-items: center; gap: 3px; padding: 6px 4px; border-radius: 14px; background: var(--giay); color: var(--muc); box-shadow: 0 3px 0 -1px #CFC4AC; text-align: center; font-size: 11px; font-weight: 700; }
.cong-cu .nut-theo > svg, .cong-cu .nut-tung-cau > svg { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: var(--do); color: #fff; }
.cong-cu .nut-theo span, .cong-cu .nut-tung-cau span { display: block; line-height: 1.18; }
@media (min-width: 760px) and (orientation: landscape) { .bia-chinh { row-gap: 4px; grid-template-rows: auto 1fr; } .the-treo { padding-top: 8px; } .the-day, .the-lo { display: none; } .the-than { padding: 12px; clip-path: none; } .the-than > p { margin: 0 0 8px; } .che-nut { padding: 8px 10px; margin-bottom: 7px; } .che-nut > svg { width: 38px; height: 38px; padding: 8px; } .cong-cu { gap: 5px; overflow-y: auto; } }
.cc { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 6px 4px 5px; border-radius: 14px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); transition: background .15s, color .15s; }
.cc svg { font-size: 20px; }
.cc.chu b { font-size: 18px; line-height: 20px; font-family: var(--han); }
.cc:hover { background: rgba(255,255,255,.16); color: #fff; }
.cc[aria-pressed="true"] { background: var(--giay); color: var(--muc); }
.toc { display: grid; gap: 3px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); width: 100%; flex: none; }
.toc button { height: 26px; border-radius: 9px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.75); }
.toc button[aria-checked="true"] { background: var(--nang); color: var(--muc); }

.doc-chan { display: none; }
.tien-do { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; overflow: hidden; }
.tien-do i { width: 16px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); flex: 0 1 16px; min-width: 6px; }
.tien-do i.qua { background: rgba(255,182,39,.58); }
.tien-do i.nay { background: var(--nang); width: 26px; flex-basis: 26px; }
.phat { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px 0 8px; border-radius: 999px; background: var(--do); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 5px 0 -1px var(--do-dam), 0 16px 30px -12px rgba(215,38,30,.8); }
.phat svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.cong-cu .phat { width: 100%; height: auto; display: grid; justify-items: center; gap: 3px; padding: 7px 4px; border-radius: 14px; font-size: 11px; text-align: center; box-shadow: 0 4px 0 -1px var(--do-dam), 0 10px 20px -10px rgba(215,38,30,.8); flex: none; }
.cong-cu .phat svg { width: 26px; height: 26px; padding: 5px; }
.cong-cu .phat span { display: block; line-height: 1.15; }
.phat.nhay { animation: goi 1.3s ease-in-out infinite; }
@keyframes goi { 50% { box-shadow: 0 5px 0 -1px var(--do-dam), 0 0 0 10px rgba(215,38,30,.22); } }
.goi-y { margin: 0; font-size: 13px; color: rgba(255,255,255,.66); display: flex; align-items: center; gap: 6px; text-align: center; }
.goi-y svg { display: inline-block; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--la); color: #fff; }

/* mục lục trang (cửa sổ phụ mở rộng) */
.muc-luc { position: fixed; inset: 0; z-index: 30; background: rgba(12,18,32,.62); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 12px; }
.ml-than { width: min(1220px, 96vw); height: min(860px, 92dvh); max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--giay); color: var(--muc); border-radius: 26px; padding: 20px 24px 24px; animation: len .26s ease-out; box-shadow: 0 30px 70px -20px rgba(0,0,0,.75); }
@keyframes len { from { transform: translateY(40px); opacity: 0; } }
.ml-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 20px; flex: none; }
.ml-dau > b { display: flex; align-items: center; gap: 8px; }
.ml-dau > b svg { width: 26px; height: 26px; color: var(--do); }
.ml-luoi { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 4px; align-content: start; }
.ml-luoi a { position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--giay-2); box-shadow: 0 0 0 1.5px var(--vien); transition: transform .15s, box-shadow .15s; }
.ml-luoi a:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(31,42,68,.35), 0 0 0 2px var(--muc); }
.ml-luoi a.nay { box-shadow: 0 0 0 3px var(--do); background: #FFF8EB; }
.ml-anh { position: relative; aspect-ratio: 4 / 3; width: 100%; overflow: hidden; background: var(--giay-2); }
.ml-anh img, .ml-anh .canh-o { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-anh span { position: absolute; left: 8px; bottom: 8px; min-width: 26px; height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,253,248,.94); color: var(--muc); font-size: 12.5px; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ml-chu { padding: 10px 12px; display: grid; gap: 3px; }
.ml-chu b { font-family: var(--han); font-size: 16px; line-height: 1.3; color: var(--muc); }
.ml-chu small { font-size: 12.5px; color: var(--muc-2); line-height: 1.35; }

/* tra từ */
.tra-tu { position: fixed; z-index: 15; display: grid; gap: 1px; min-width: 120px; max-width: 260px; padding: 10px 14px; border-radius: 16px; background: var(--giay); color: var(--muc); box-shadow: 0 18px 40px -14px rgba(0,0,0,.6); animation: len .18s ease-out; }
.tra-tu b { font-family: var(--han); font-size: 26px; line-height: 1.2; }
.tra-tu small { font-family: var(--han); color: var(--do); font-size: 14px; }
.tra-tu span { font-size: 13.5px; color: var(--muc-2); line-height: 1.4; }

/* ===== ĐỌC XONG ===== */
.xong-man { min-height: 100dvh; padding: clamp(16px, 4vw, 48px); display: grid; align-content: center; background:
  radial-gradient(800px 500px at 50% 0, #fff 0, rgba(255,255,255,0) 70%),
  linear-gradient(180deg, var(--troi) 0, var(--giay) 100%); }
.xong-the { max-width: 1080px; width: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; background: var(--giay); border-radius: 32px; padding: clamp(16px, 2.4vw, 28px); box-shadow: 0 40px 80px -40px rgba(31,42,68,.6); }
.xong-anh { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; }
.xong-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dau-son { position: absolute; right: 7%; bottom: 9%; width: 30%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 16%; color: var(--do); border: .5vmin solid var(--do); box-shadow: inset 0 0 0 .35vmin rgba(255,253,248,.9), inset 0 0 0 .8vmin var(--do); background: rgba(255,253,248,.82); transform: rotate(-12deg); }
.dau-son b { font-family: var(--tua); font-weight: 400; font-size: clamp(28px, 5vw, 58px); letter-spacing: .06em; writing-mode: vertical-rl; line-height: 1; }
.dau-son.dong { animation: dong .55s cubic-bezier(.2,.9,.3,1.3) .35s both; }
@keyframes dong { 0% { transform: rotate(-24deg) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-12deg) scale(1); opacity: 1; } }
.xong-chu h1 { margin: 2px 0 2px; font-family: var(--tua); font-weight: 400; font-size: clamp(40px, 5.4vw, 66px); letter-spacing: .05em; line-height: 1.05; }
.xong-chu .vi { margin: 0 0 18px; font-weight: 700; font-size: 18px; color: var(--muc-2); }
.xong-nho { margin: 0 0 8px; font-weight: 700; color: var(--la); font-size: 14px; }
.xong-so { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.xong-so div { display: grid; padding: 10px 12px; border-radius: 16px; background: var(--troi-sang); }
.xong-so b { font-size: 24px; line-height: 1.15; }
.xong-so span { font-size: 12px; color: var(--muc-2); }
.xong-nut { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
.xong-nut [lang="zh"] { font-family: var(--tua); font-weight: 400; font-size: 18px; }

/* ===== điện thoại / màn dọc ===== */
@media (max-width: 760px) {
  .tv { grid-template-columns: 1fr; padding-bottom: 76px; }
  .ray { position: fixed; z-index: 10; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); background: rgba(255,253,248,.94); backdrop-filter: blur(10px); border-right: 0; border-top: 1px solid var(--vien); }
  .ray-logo { margin: 0; flex-direction: row; }
  .ray-logo img { width: 34px; height: 34px; }
  .ray-logo span { display: none; }
  .ray-muc { width: auto; min-width: 96px; padding: 7px 14px; }
  .ray-muc svg { font-size: 23px; }
  .tv-than { padding: 22px 16px 20px; }
  .tv-dau { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
  .chuoi { justify-self: start; align-self: flex-start; }
  .noi-bat { grid-template-columns: 1fr; padding: 12px 12px 18px; border-radius: 24px; gap: 14px; }
  .nb-anh { transform: none; }
  .nb-chu { padding: 0 6px; }
  .cuon { width: 168px; }
  .cuon.chua { width: 136px; }
  .ke-dau { flex-direction: column; gap: 2px; }
  .ke-dau > span { text-align: left; }
  .so-lieu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bia-chinh { grid-template-columns: 1fr; grid-template-areas: "to" "tin" "the"; gap: 12px; }
  .bia-thong-tin h1 { font-size: 46px; }
  .bia-thong-tin .tom { display: none; }
  .bia-tom-rieng { display: block; }
  .the-treo { padding-top: 26px; }
  .the-day { height: 36px; }
  .bia-chu b { font-size: 18px; }
  .the-treo { justify-self: center; width: 100%; }
  .xong-the { grid-template-columns: 1fr; }
  .xong-so { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xong-nut .nut { flex: 1 1 auto; justify-content: center; }
}

/* màn đọc dạng 1 trang: công cụ vẫn ở bên phải, tranh mở rộng hết phần còn lại */
.doc.don { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "dau cc" "san cc"; }
.don .doc-dau { padding: 6px 10px 2px; gap: 8px; }
.don .doc-ten b { font-size: 18px; }
.don .san { padding: 4px 8px 8px; gap: 6px; }
.don .mui { width: 40px; height: 40px; font-size: 20px; }
.don .mui:disabled { opacity: .15; }
.don .cong-cu { width: 84px; padding: 6px 8px 6px 4px; gap: 5px; }
@media (max-width: 520px) {
  .don .san { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "s s s" "t . n"; align-items: stretch; justify-items: center; row-gap: 8px; }
  .don .sach-mo { grid-area: s; margin: 0; max-height: calc(100dvh - 110px); }
  .don .mui.truoc { grid-area: t; }
  .don .mui.sau { grid-area: n; }
  .don .cong-cu { width: 74px; padding: 6px 6px 6px 4px; }
  .che-chon button { font-size: 10.5px; padding: 0 4px; }
  .cc, .cong-cu .nut-theo, .cong-cu .nut-tung-cau, .cong-cu .phat { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.tom-rieng { margin: 0; color: var(--muc-2); line-height: 1.6; }
/* đoạn nhiều câu: nền giấy mờ dạng khối, đọc rõ trên tranh đông chi tiết */
.cap-5 .vung::before, .cap-6 .vung::before, .cap-7 .vung::before, .cap-8 .vung::before, .trang.day .vung::before { inset: -1.8cqw -2.4cqw; border-radius: 3.4cqw; background: rgba(255,253,248,.8); filter: blur(4px); }

/* ===== 10/11 tối: tranh tạm, Đọc theo, Từ điển ===== */
/* tranh tạm vẽ bằng canh.js khi truyện chưa có tranh thật */
.canh-o { display: block; width: 100%; height: 100%; background: var(--giay-2); }
.canh-o > svg { display: block; width: 100%; height: 100%; }
.trang > .canh-o { position: absolute; inset: 0; }
.nhan-tam { position: absolute; top: 10px; left: 10px; z-index: 3; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255,253,248,.92); color: var(--muc-2); box-shadow: 0 2px 8px rgba(31,42,68,.15); pointer-events: none; }
/* bìa lớn: tên truyện và dòng tác giả chiếm dải trên, nên nhãn "Tranh tạm" xuống góc dưới trái, đối diện dòng bản quyền */
.bia-to .nhan-tam { top: auto; bottom: 2%; left: 2.2%; white-space: nowrap; }
@container (max-width: 480px) { .bia-to .nhan-tam { font-size: 9.5px; padding: 3px 8px; } }
.so-lieu { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* chân trang đọc: nút Máy đọc / gợi ý + nút Đọc theo */
.chan-hang { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }
.nut-theo { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px 0 7px; border-radius: 999px; background: var(--giay); color: var(--muc); text-align: left; box-shadow: 0 5px 0 -1px #CFC4AC, 0 16px 30px -14px rgba(0,0,0,.7); transition: transform .15s; }
.nut-theo:hover { transform: translateY(-1px); }
.nut-theo:active { transform: translateY(2px); }
.nut-theo > svg { width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: var(--do); color: #fff; flex: none; }
.nut-theo span { display: grid; line-height: 1.15; }
.nut-theo b { font-size: 15px; }
.nut-theo small { font-size: 11.5px; color: var(--muc-2); font-weight: 600; }

/* chữ đang tra */
.seg.tra { background: rgba(255,182,39,.45); border-radius: 6px; box-shadow: 0 0 0 3px rgba(255,182,39,.45); }

/* thẻ tra từ */
.tra-tu { max-width: min(380px, calc(100vw - 16px)); min-width: 240px; gap: 4px; padding: 14px 16px; }
.tt-dau { display: flex; align-items: center; gap: 6px; }
.tt-dau b { flex: 1; }
.tt-loa, .tt-luu, .tt-dong { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.tt-loa svg, .tt-luu svg, .tt-dong svg { width: 20px; height: 20px; }
.tt-loa { background: var(--la); color: #fff; }
.tt-luu { background: var(--giay-2); color: var(--muc-3); }
.tt-luu[aria-pressed="true"] { color: var(--nang); background: #FFF3D6; }
.tt-dong { background: #FDE3E1; color: var(--do-dam); }
.tra-tu .tt-py { font-size: 15px; }
.tra-tu .tt-vi { font-size: 14.5px; color: var(--muc); font-weight: 600; }
.tt-chu { display: grid; gap: 3px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--vien); }
.tra-tu .tt-chu span { font-size: 12.5px; color: var(--muc-2); }
.tra-tu .tt-chu b { font-size: 17px; margin-right: 6px; }
.tt-chu i { font-style: normal; color: var(--do); margin-right: 4px; font-family: var(--han); }
.tt-mo { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--muc); background: var(--giay-2); }
.tt-mo svg { width: 18px; height: 18px; }

/* lớp phủ chung (cửa sổ phụ mở rộng): hiển thị đầy đủ thông tin, có nút Thu gọn và Đóng */
.lop-phu { position: fixed; inset: 0; z-index: 30; background: rgba(12,18,32,.62); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 12px; }
.lp-than { width: min(1220px, 96vw); max-height: 92dvh; display: flex; flex-direction: column; background: var(--giay); color: var(--muc); border-radius: 26px; padding: 20px 24px max(22px, env(safe-area-inset-bottom)); animation: len .26s ease-out; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0,0,0,.75); }
.lp-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex: none; }
.lp-dau > b { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; }
.lp-dau > b svg { width: 26px; height: 26px; color: var(--do); flex: none; }
.lp-nut-dau { display: flex; align-items: center; gap: 8px; flex: none; }
.nut-phu { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--muc); background: var(--giay-2); box-shadow: inset 0 0 0 1.5px var(--vien); transition: background .15s, transform .12s; }
.nut-phu svg { width: 18px; height: 18px; flex: none; }
.nut-phu:hover { background: #E8DEC8; }
.nut-dong-phu { background: #FDE3E1; color: var(--do-dam); box-shadow: inset 0 0 0 1.5px rgba(215,38,30,.28); }
.nut-dong-phu:hover { background: #F9C9C5; }

/* trạng thái Thu gọn của cửa sổ phụ (Mục lục, Từ điển, Đọc từng câu, Đọc cả bài) */
.muc-luc.thu-gon, .lop-phu.thu-gon { inset: auto 16px 16px auto; width: auto; height: auto; padding: 0; background: transparent; backdrop-filter: none; pointer-events: none; place-items: end; }
.muc-luc.thu-gon .ml-than, .lop-phu.thu-gon .lp-than { width: auto !important; height: auto !important; max-width: min(560px, calc(100vw - 24px)); max-height: none; padding: 10px 14px; border-radius: 999px; box-shadow: 0 16px 36px -10px rgba(0,0,0,.7), 0 0 0 2px var(--nang); pointer-events: auto; animation: none; }
.muc-luc.thu-gon .ml-dau, .lop-phu.thu-gon .lp-dau { margin-bottom: 0; gap: 12px; font-size: 16px; }
.muc-luc.thu-gon .ml-dau > b, .lop-phu.thu-gon .lp-dau > b { font-size: 16px; white-space: nowrap; }
.muc-luc.thu-gon .ml-than > :not(.ml-dau), .lop-phu.thu-gon .lp-than > :not(.lp-dau) { display: none !important; }
.lp-than .trong { margin: 18px 4px; color: var(--muc-2); line-height: 1.55; text-align: center; grid-column: 1 / -1; }

/* Từ điển (mở rộng, hiển thị đầy đủ thông tin) */
.tu-dien-lop .lp-than { width: min(1220px, 96vw); height: min(860px, 92dvh); }
.td-tim { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 14px; background: var(--giay-2); box-shadow: inset 0 0 0 1.5px var(--vien); flex: none; }
.td-tim:focus-within { box-shadow: inset 0 0 0 2px var(--muc); }
.td-tim svg { width: 20px; height: 20px; color: var(--muc-3); flex: none; }
.td-tim input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--muc); }
.td-tab { display: flex; gap: 8px; margin: 12px 0 8px; flex: none; }
.td-tab button { flex: 1; height: 42px; border-radius: 12px; font-weight: 700; font-size: 14.5px; color: var(--muc-2); background: var(--giay-2); }
.td-tab button[aria-selected="true"] { background: var(--muc); color: #fff; }
.td-ds { flex: 1; overflow: auto; margin: 0 -4px; padding: 4px; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px 14px; align-content: start; }
.td-dem { margin: 4px 2px; font-size: 13px; font-weight: 600; color: var(--muc-3); grid-column: 1 / -1; }
.td-dong { display: grid; grid-template-columns: auto minmax(96px, auto) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--giay-2); box-shadow: inset 0 0 0 1px var(--vien); }
.td-loa { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #E3F3EA; color: var(--la); }
.td-loa svg { width: 20px; height: 20px; }
.td-chu { display: grid; cursor: pointer; }
.td-chu b { font-family: var(--han); font-size: 25px; line-height: 1.2; }
.td-chu small { font-family: var(--han); font-size: 14px; color: var(--do); font-weight: 600; }
.td-nghia { font-size: 14.5px; line-height: 1.45; color: var(--muc); }
.td-nghia em { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 800; color: #8A5A00; background: #FFF0C7; vertical-align: 1px; }
.td-luu { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muc-3); }
.td-luu svg { width: 22px; height: 22px; }
.td-luu[aria-pressed="true"] { color: var(--nang); }

/* Đọc theo */
.theo-than { overflow: auto; }
.theo-so { font-size: 13px; font-weight: 700; color: var(--muc-2); background: var(--giay-2); padding: 5px 10px; border-radius: 999px; }
.theo-cau { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; padding: 18px 10px 8px; border-radius: 20px; background: var(--giay-2); cursor: pointer; font-family: var(--han); flex: none; }
.theo-cau .o { font-size: clamp(30px, 8.5vw, 44px); font-weight: 700; line-height: 1.25; padding: 0 3px; border-radius: 10px; transition: color .15s, background .15s; }
.theo-cau .o rt { font-size: 15px; font-weight: 500; color: var(--muc-2); font-family: var(--ui); }
.theo-cau .o.nay { color: var(--do); }
.theo-cau .o.dung { color: var(--la); }
.theo-cau .o.sai { color: var(--do); background: #FDE3E1; box-shadow: inset 0 -3px 0 var(--do); }
.theo-vi { margin: 10px 4px 0; text-align: center; color: var(--muc-2); font-size: 15px; line-height: 1.5; flex: none; }
.theo-ket { min-height: 84px; display: grid; align-items: center; margin: 10px 0 6px; flex: none; }
.theo-hd, .theo-loi { margin: 0; text-align: center; font-size: 14.5px; line-height: 1.5; color: var(--muc-2); }
.theo-loi { color: var(--do-dam); background: #FDECEA; padding: 10px 12px; border-radius: 14px; }
.theo-hd.dang-nghe { color: var(--do); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.theo-hd.dang-nghe i { width: 12px; height: 12px; border-radius: 50%; background: var(--do); animation: chop 1s ease-in-out infinite; }
@keyframes chop { 50% { opacity: .25; transform: scale(.7); } }
.theo-hd .xoay { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border-radius: 50%; border: 2.5px solid var(--vien); border-top-color: var(--do); animation: xoay .8s linear infinite; }
@keyframes xoay { to { transform: rotate(360deg); } }
.theo-diem { display: flex; align-items: center; gap: 14px; justify-content: center; }
.theo-diem .vong { width: 84px; height: 84px; flex: none; }
.theo-diem b { font-size: 19px; }
.theo-diem p { margin: 2px 0 0; font-size: 14px; color: var(--muc-2); line-height: 1.45; }
.theo-diem .theo-ky { color: var(--la); font-weight: 700; }
.theo-nut { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 6vw, 34px); margin: 4px 0 14px; flex: none; }
.tn { display: grid; justify-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muc-2); min-width: 72px; }
.tn svg { width: 58px; height: 58px; padding: 16px; border-radius: 50%; background: var(--giay-2); color: var(--muc); box-shadow: inset 0 0 0 1px var(--vien); }
.tn-nghe svg { background: #E3F3EA; color: var(--la); box-shadow: none; }
.tn-ghi svg { width: 76px; height: 76px; padding: 20px; background: var(--do); color: #fff; box-shadow: 0 6px 0 -1px var(--do-dam), 0 16px 28px -12px rgba(215,38,30,.8); }
.tn-ghi { color: var(--do); }
.tn-ghi.dang svg { animation: ghi 1.2s ease-in-out infinite; }
@keyframes ghi { 50% { box-shadow: 0 6px 0 -1px var(--do-dam), 0 0 0 14px rgba(215,38,30,.18); } }
.tn:disabled { opacity: .4; }
.theo-chuyen { display: flex; justify-content: space-between; gap: 10px; flex: none; }
.theo-chuyen .nut { min-height: 44px; padding: 0 16px; font-size: 14px; }
.theo-chuyen .nut svg { width: 18px; height: 18px; }
.theo-chuyen .nut:disabled { opacity: .35; }

/* thông báo nhỏ */
.bao-nho { position: fixed; left: 50%; bottom: 96px; z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 999px; background: var(--muc); color: #fff; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s; }
.bao-nho.hien { opacity: 1; transform: translate(-50%, 0); }

/* điện thoại: thanh công cụ vẫn giữ bên phải gọn gàng */
@media (max-width: 560px) {
  .td-ds { grid-template-columns: 1fr; }
  .nut-phu span { display: none; }
  .nut-phu { padding: 0 10px; }
}

/* ===== 11/11/2026: Đọc cả bài, ô chấm điểm, Ôn bài, tiến độ, huy chương, Xu, Hồ sơ ===== */
.xoay { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; border-radius: 50%; border: 2.5px solid var(--vien); border-top-color: var(--do); animation: xoay .8s linear infinite; }
.xoay.to { width: 42px; height: 42px; border-width: 4px; }
.dang-nghe { color: var(--do); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.dang-nghe i { width: 12px; height: 12px; border-radius: 50%; background: var(--do); animation: chop 1s ease-in-out infinite; }

/* lớp phủ đọc cả bài */
.dcb-lop { z-index: 35; }
.dcb-lop .dcb-than { width: min(760px, 94vw); align-items: center; text-align: center; gap: 14px; padding: 22px 26px 26px; }
.dcb-than .lp-dau { width: 100%; text-align: left; }
.dcb-than p { margin: 0; color: var(--muc-2); font-size: 16px; line-height: 1.6; max-width: 54ch; }
.dcb-tieu { font-size: 22px; }
.dcb-dem { align-self: center; justify-self: center; display: grid; justify-items: center; gap: 10px; text-align: center; color: #fff; padding: 24px; }
.dcb-lop:has(.dcb-dem) { place-items: center; }
.dcb-dem p { margin: 0; font-size: 18px; font-weight: 700; }
.dcb-dem b { font-size: clamp(96px, 26vw, 180px); line-height: 1; font-weight: 800; color: var(--nang); animation: nay-so .5s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes nay-so { 0% { transform: scale(1.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.dcb-dem small { max-width: 34ch; font-size: 14px; line-height: 1.5; opacity: .9; }
.dcb-thanh-cham { width: min(320px, 80%); height: 8px; border-radius: 4px; background: var(--giay-2); overflow: hidden; }
.dcb-thanh-cham i { display: block; height: 100%; background: var(--la); transition: width .3s; }
body.dcb-on .doc-chan, body.dcb-on .mui, body.dcb-on .cong-cu, body.dcb-on .loa, body.dcb-on .che-chon { visibility: hidden; pointer-events: none; }
.dcb-thanh { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 25; width: min(640px, calc(100% - 20px)); display: grid; gap: 8px; padding: 12px 16px 14px; border-radius: 22px; background: var(--giay); color: var(--muc); box-shadow: 0 20px 40px -16px rgba(0,0,0,.7); }
.dcb-thanh.thu-gon { left: auto; right: 16px; transform: none; width: auto; border-radius: 999px; padding: 8px 14px; box-shadow: 0 16px 36px -10px rgba(0,0,0,.7), 0 0 0 2px var(--nang); }
.dcb-thanh.thu-gon > :not(.dcb-tien) { display: none !important; }
.dcb-tien { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dcb-tien b { flex: 1; text-align: center; }
.dcb-ghi { display: inline-flex; align-items: center; gap: 6px; color: var(--do); font-weight: 700; }
.dcb-ghi i { width: 10px; height: 10px; border-radius: 50%; background: var(--do); animation: chop 1s ease-in-out infinite; }
.dcb-giay { color: var(--muc-2); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.dcb-thu { height: 32px; padding: 0 10px; font-size: 12.5px; }
.dcb-huy { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--do-dam); background: #FDE3E1; }
.dcb-vach { display: flex; gap: 4px; }
.dcb-vach i { flex: 1; height: 5px; border-radius: 3px; background: rgba(31,42,68,.12); }
.dcb-vach i.qua { background: var(--la); }
.dcb-vach i.nay { background: var(--do); }
.dcb-xong { justify-content: center; width: 100%; font-size: 17px; }

/* màn kết quả và Ôn bài */
.ket-man { min-height: 100dvh; padding: clamp(16px, 4vw, 40px) clamp(14px, 4vw, 40px) 20px; background: var(--troi-sang); }
.o-cham { max-width: 760px; margin: 0 auto; background: var(--giay); border-radius: 26px; padding: clamp(16px, 3vw, 28px); box-shadow: 0 24px 50px -30px rgba(31,42,68,.55); }
.o-cham h3 { margin: 20px 0 6px; font-size: 17px; }
.oc-dau { display: flex; align-items: center; gap: 18px; }
.oc-vong { width: 110px; height: 110px; flex: none; }
.oc-vong svg, .oc-vong .vong { width: 100%; height: 100%; }
.oc-dau small { color: var(--muc-2); font-size: 13px; font-weight: 600; }
.oc-nhan { display: block; font-size: 24px; margin: 2px 0; }
.oc-nhan.tot { color: var(--la); }
.oc-nhan.kha { color: #B27A00; }
.oc-nhan.yeu { color: var(--do); }
.oc-dau p { margin: 0; color: var(--muc-2); font-size: 14px; line-height: 1.45; }
.oc-loi { margin: 12px 0 0; padding: 9px 12px; border-radius: 12px; background: #FFF4DA; color: #7A5300; font-size: 13.5px; }
.oc-hd { margin: 0 0 10px; color: var(--muc-2); font-size: 14px; line-height: 1.5; }
.oc-chip { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: grid; justify-items: center; min-width: 64px; padding: 8px 12px; border-radius: 14px; background: #FDE3E1; color: var(--do-dam); box-shadow: inset 0 -3px 0 rgba(215,38,30,.4); transition: transform .12s; }
.chip b { font-size: 22px; font-family: var(--han); line-height: 1.2; }
.chip small { font-size: 12px; }
.chip.dat { background: #E3F3EA; color: #1D6B47; box-shadow: inset 0 -3px 0 rgba(46,158,106,.5); }
.chip[aria-pressed="true"] { outline: 3px solid var(--nang); outline-offset: 2px; }
.chip:active { transform: scale(.96); }
.oc-luyen { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--giay-2); }
.lt { display: grid; justify-items: center; gap: 10px; }
.lt-tu { display: grid; justify-items: center; padding: 6px 18px; border-radius: 16px; background: var(--giay); }
.lt-tu b { font-family: var(--han); font-size: 40px; line-height: 1.2; }
.lt-tu small { color: var(--do); font-size: 15px; }
.lt-nut { display: flex; gap: clamp(18px, 8vw, 40px); align-items: flex-start; }
.lt-kq { margin: 0; text-align: center; font-size: 14.5px; color: var(--muc-2); line-height: 1.5; }
.lt-kq b.dat { color: var(--la); }
.lt-kq b.chua { color: var(--do); }
.oc-nut { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px auto 0; max-width: 760px; }
.on-buoc { list-style: none; display: flex; gap: 6px; max-width: 760px; margin: 0 auto 14px; padding: 0; }
.on-buoc li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--muc-3); background: rgba(255,255,255,.6); }
.on-buoc li.nay { background: var(--do); color: #fff; }
.on-buoc li.qua { background: #E3F3EA; color: #1D6B47; }
.on-so { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muc-3); }
.on-than h3 { margin: 0 0 12px; font-size: 19px; line-height: 1.4; }
.on-tranh { max-width: 360px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; margin: 0 0 12px; }
.on-tranh img, .on-tranh .canh-o { width: 100%; height: 100%; object-fit: cover; }
.on-chon { display: grid; gap: 10px; }
.on-chon.xep { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.on-op { position: relative; min-height: 52px; padding: 10px 14px; border-radius: 16px; background: var(--giay-2); box-shadow: inset 0 0 0 2px var(--vien); font-size: 16px; font-weight: 600; text-align: left; }
.on-op[lang="zh"] { font-size: 22px; }
.on-chon.xep .on-op { display: grid; justify-items: center; text-align: center; }
.on-op b { font-family: var(--han); font-size: 22px; }
.on-op small { color: var(--muc-2); font-size: 12px; }
.on-op:hover { box-shadow: inset 0 0 0 2px var(--muc-2); }
.on-op.da-chon { background: #FFF3D6; box-shadow: inset 0 0 0 2px var(--nang); }
.on-op.dung { background: #E3F3EA; box-shadow: inset 0 0 0 2px var(--la); }
.on-op.sai { background: #FDE3E1; box-shadow: inset 0 0 0 2px var(--do); }
.on-th { position: absolute; top: 6px; left: 8px; font-size: 12px; font-weight: 800; color: #8A5A00; }
.on-chon.dung { outline: 3px solid var(--la); outline-offset: 4px; border-radius: 16px; }
.on-chon.sai { outline: 3px solid var(--do); outline-offset: 4px; border-radius: 16px; }
.on-giai { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; line-height: 1.5; font-size: 14.5px; }
.on-giai.dung { background: #E3F3EA; color: #1D6B47; }
.on-giai.sai { background: #FDECEA; color: var(--do-dam); }
.on-tiep { margin-top: 14px; }
.on-luyen { padding: 14px; border-radius: 18px; background: var(--giay-2); }
.cm { position: relative; text-align: center; padding-top: 10px; }
.cm .dau-son { position: static; display: inline-grid; width: 96px; margin: 0 auto 6px; }
.cm .dau-son b { font-size: 34px; }
.cm h2 { margin: 6px 0 2px; font-size: 22px; }
.cm-ten { margin: 0 0 14px; font-family: var(--tua); font-size: 26px; }
.cm .xong-so { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cm .xong-so div { min-width: 92px; padding: 10px; border-radius: 16px; background: var(--giay-2); display: grid; }
.cm .xong-so b { font-size: 24px; }
.cm .xong-so span { font-size: 12.5px; color: var(--muc-2); }
.cm-nho { margin: 14px auto 0; max-width: 52ch; color: var(--muc-2); font-size: 14px; line-height: 1.5; }
.cm-nho.loi { color: var(--do-dam); }
.cm-huy { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cm .xong-nut { justify-content: center; margin-top: 18px; }

/* bìa: đã đọc đổi màu, cấp khoá xám */
.cuon.da-doc .cuon-mat { box-shadow: 0 0 0 4px var(--la), var(--bong-sach); }
.cuon.da-doc .cuon-vi { color: #1D6B47; }
.cuon.khoa .cuon-mat { filter: grayscale(1) opacity(.55); }
.cuon.khoa .cuon-vi { color: var(--muc-3); }
.cuon-khoa { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; color: #fff; background: rgba(31,42,68,.35); }
.cuon-khoa svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.nhan-doc { position: absolute; left: 14px; bottom: 8px; z-index: 3; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--nang); color: var(--muc); }
.nhan-doc.xong { background: var(--la); color: #fff; }
.o-khoa p { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.o-khoa p svg { width: 22px; height: 22px; color: var(--muc-2); }
.che-nut.dcb { background: #FFF3D6; color: var(--muc); box-shadow: inset 0 0 0 2px rgba(255,182,39,.6); }
.che-nut.dcb > svg { background: var(--nang); color: var(--muc); }
.che-nut.dcb small { color: var(--muc-2); }
.da-xong-bai { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-weight: 700; color: #1D6B47; }
.da-xong-bai svg { width: 20px; height: 20px; color: var(--nang); }
.xong-luu { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #FFF4DA; color: #6B4A00; font-size: 14px; line-height: 1.5; }

/* tiến độ học + luật thưởng ở thư viện */
.tien-hoc .ke-dau a { font-size: 14px; font-weight: 700; color: var(--la); }
.th-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.th-cap { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--giay); box-shadow: 0 8px 20px -16px rgba(31,42,68,.5); }
.th-cap > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.th-cap b { font-size: 14.5px; }
.th-cap b [lang="zh"] { font-family: var(--tua); font-weight: 400; }
.th-cap small { font-size: 12.5px; color: var(--muc-2); }
.th-cap.khoa { opacity: .62; }
.th-cap.khoa .ke-so { background: var(--muc-3); }
.th-cap .ke-so svg { width: 16px; height: 16px; }
.th-thanh { height: 6px; border-radius: 3px; background: rgba(31,42,68,.1); overflow: hidden; }
.th-thanh i { display: block; height: 100%; background: var(--cap, var(--la)); border-radius: 3px; }
.th-duoi { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 14px; color: var(--muc-2); }
.th-duoi > span { display: inline-flex; align-items: center; gap: 6px; }
.th-duoi svg { width: 20px; height: 20px; color: var(--do); }
.th-moi a { color: var(--do); font-weight: 700; text-decoration: underline; }
.th-qt { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: #FFF4DA; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.th-qt input { width: 18px; height: 18px; }
.luat { margin-bottom: 34px; background: var(--giay); border-radius: 20px; box-shadow: 0 10px 26px -20px rgba(31,42,68,.5); }
.luat > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; list-style: none; }
.luat > summary::-webkit-details-marker { display: none; }
.luat > summary svg { width: 26px; height: 26px; color: var(--nang); }
.luat > summary b { font-size: 17px; }
.luat > summary span { color: var(--muc-2); font-size: 13.5px; }
.luat-than { padding: 0 18px 16px; }
.luat-than p, .luat-than li { font-size: 14px; line-height: 1.55; color: var(--muc); }
.luat-than ul { margin: 10px 0 0; padding-left: 20px; }
.luat-huy, .hs-huy { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.huy { display: grid; justify-items: center; gap: 2px; padding: 14px 10px; border-radius: 18px; text-align: center; background: var(--giay-2); }
.huy > svg { width: 44px; height: 44px; }
.huy b { font-size: 15px; }
.huy span[lang="zh"] { font-family: var(--tua); font-size: 18px; }
.huy small { font-size: 12px; color: var(--muc-2); }
.huy em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muc-2); }
.huy.dong { background: #F8E9DD; }
.huy.dong > svg { color: #B4692F; }
.huy.bac { background: #E6F2EC; }
.huy.bac > svg { color: #3F8F6B; }
.huy.vang { background: #FFF1C9; }
.huy.vang > svg { color: #D99A00; }
.huy.da-dung { opacity: .55; }
.huy .nut { min-height: 36px; padding: 0 14px; font-size: 13px; margin-top: 6px; }

/* Hồ sơ học tập */
.hs-ai { margin: -10px 0 18px; color: var(--muc-2); }
.hs-moi { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 22px; border-radius: 20px; background: #FFF4DA; }
.hs-moi > svg { width: 36px; height: 36px; color: #8A5A00; }
.hs-moi p { margin: 4px 0 10px; color: var(--muc-2); line-height: 1.5; font-size: 14px; }
.hs-bai { display: grid; gap: 8px; }
.hs-dong { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--giay); }
.hs-dong b { font-family: var(--tua); font-weight: 400; font-size: 20px; }
.hs-dong span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-dong em { font-style: normal; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #E3F3EA; color: #1D6B47; }
.hs-dong small { font-size: 12px; color: var(--muc-3); }
.hs-tb, .vi-tb, .hb-tb { margin: 10px 0 0; font-size: 14px; color: var(--muc); }
.vi-tb .nut { min-height: 38px; margin-left: 8px; }
.vi-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-radius: 18px; background: var(--giay); }
.vi-dau > svg { width: 34px; height: 34px; }
.vi-dau > b { font-size: 24px; margin-right: auto; }
.vi-dau .nut { min-height: 40px; padding: 0 14px; font-size: 14px; }
.nut:disabled { opacity: .4; cursor: default; }
.vi-ls { display: grid; gap: 6px; margin-top: 10px; }
.vi-ls > div { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--giay); font-size: 14px; }
.vi-ls b.cong { color: var(--la); }
.vi-ls b.tru { color: var(--do); }
.vi-ls b.ma { font-family: ui-monospace, monospace; }
.vi-ls small { color: var(--muc-3); font-size: 12px; }
.hs-hb p { line-height: 1.55; }
.doi-hb.xac { background: var(--nang); color: var(--muc); box-shadow: 0 6px 0 -1px #C98A00; }
.bv { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bv li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--giay); }
.bv-hang { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--giay-2); }
.bv li.top1 .bv-hang { background: #F2B705; color: #fff; }
.bv li.top2 .bv-hang { background: #A9B4C2; color: #fff; }
.bv li.top3 .bv-hang { background: #C98A5A; color: #fff; }
.bv li.toi { box-shadow: inset 0 0 0 2px var(--do); }
.bv em { font-style: normal; font-weight: 800; color: var(--do); }
.bv small { font-size: 12px; color: var(--muc-3); }
.bv-toi { margin: 10px 0 0; font-size: 14px; }
@media (max-width: 560px) {
  .hs-dong { grid-template-columns: auto minmax(0, 1fr); }
  .hs-dong em, .hs-dong small { grid-column: 2; justify-self: start; }
  .bv li { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .bv small { display: none; }
  .so-lieu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oc-vong { width: 88px; height: 88px; }
}

/* ===== 14/11/2026: Thanh điều hướng bên trái mở rộng + 3 phân loại Thư viện + kệ 2 hàng kéo ngang + toàn trang theo cấp + 看图识字 / Lật thẻ / Phát âm / Luyện tập ===== */
.tv { grid-template-columns: 232px minmax(0, 1fr); }
.ray {
  width: 232px;
  align-items: stretch;
  gap: 5px;
  padding: 16px 12px 20px;
  background: rgba(255, 253, 248, .72);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(31, 42, 68, .09);
  overflow-y: auto;
  scrollbar-width: thin;
}
.ray-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--vien);
  font-size: 16px;
  font-weight: 800;
}
.ray-logo img { width: 38px; height: 38px; }
.ray-nhom-tv { display: grid; gap: 4px; }
.ray-muc {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 14px;
  text-align: left;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ray-muc > svg { font-size: 22px; flex: none; }
.rm-chu { display: grid; gap: 1px; min-width: 0; line-height: 1.22; flex: 1; }
.rm-chu b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-chu b[lang="zh"] { font-family: var(--han); font-size: 14.5px; }
.rm-chu small { font-size: 11px; font-weight: 500; color: var(--muc-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ray-muc.on .rm-chu small { color: var(--do); opacity: .85; }
.rm-mui {
  font-style: normal;
  font-size: 12px;
  color: var(--muc-3);
  margin-left: auto;
  transition: transform .18s ease, color .15s;
}
.ray-muc[aria-expanded="true"] .rm-mui {
  transform: rotate(180deg);
  color: var(--do);
}

/* 3 lựa chọn phân loại dưới nút Thư viện truyện ở thanh bên trái: mặc định ẩn, bấm vào mới hiện */
.ray-con {
  display: none;
  gap: 4px;
  margin: 2px 0 6px 14px;
  padding-left: 10px;
  border-left: 2px solid rgba(215, 38, 30, .22);
}
.ray-con.mo {
  display: grid;
}
.ray-con-muc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 11px;
  color: var(--muc-2);
  font-size: 12px;
  transition: background .15s, color .15s;
}
.ray-con-muc:hover { background: rgba(255, 255, 255, .75); color: var(--muc); }
.ray-con-muc.on {
  background: var(--giay);
  color: var(--muc);
  box-shadow: inset 0 0 0 1.5px var(--mau-nhom, var(--do)), 0 4px 10px -6px rgba(31, 42, 68, .25);
}
.rc-so {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(31, 42, 68, .08);
  color: var(--muc);
  flex: none;
}
.ray-con-muc.on .rc-so { background: var(--mau-nhom, var(--do)); color: #fff; }
.rc-chu { display: grid; min-width: 0; line-height: 1.25; }
.rc-chu b { font-size: 12px; font-weight: 700; white-space: normal; line-height: 1.25; }
.rc-chu small { font-size: 10.5px; color: var(--muc-3); }

/* Hộp thông tin phong cách vẽ & định hướng nội dung của phân loại đang chọn */
.tv-huong-dan-nhom {
  margin: -6px 0 16px;
  padding: 11px 16px;
  border-radius: 14px;
  background: rgba(255, 253, 248, .92);
  border-left: 4px solid var(--mau-nhom, var(--do));
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, .08);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muc-2);
}
.tv-huong-dan-nhom b { color: var(--muc); font-weight: 800; }

/* 3 thẻ lựa chọn phân loại lớn ở đầu Thư viện */
.pl-khung {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.pl-the {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--giay);
  box-shadow: 0 10px 26px -18px rgba(31, 42, 68, .45), inset 0 0 0 1.5px rgba(31, 42, 68, .08);
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.pl-the::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--mau-nhom, var(--do));
  opacity: .55;
}
.pl-the:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -18px rgba(31, 42, 68, .55), inset 0 0 0 2px var(--mau-nhom, var(--do)); }
.pl-the.on {
  background: linear-gradient(180deg, #fff 0%, var(--giay) 100%);
  box-shadow: 0 20px 38px -20px rgba(31, 42, 68, .6), inset 0 0 0 2.5px var(--mau-nhom, var(--do));
}
.pl-the.on::before { opacity: 1; height: 6px; }
.pl-dau { display: flex; align-items: center; gap: 8px; }
.pl-so {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--mau-nhom, var(--do));
  color: #fff;
  font-size: 13px; font-weight: 800;
}
.pl-ic { color: var(--mau-nhom, var(--do)); font-size: 22px; display: grid; place-items: center; }
.pl-he {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--troi-sang);
  color: var(--muc);
}
.pl-the.on .pl-he { background: var(--mau-nhom, var(--do)); color: #fff; }
.pl-the h2 { margin: 2px 0 0; font-size: 17.5px; font-weight: 800; line-height: 1.25; }
.pl-the p { margin: 0; font-size: 13px; color: var(--muc-2); line-height: 1.45; flex: 1; }
.pl-chan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed var(--vien);
  font-size: 12.5px;
}
.pl-chan b { font-size: 14px; color: var(--muc); }
.pl-chan span { font-weight: 700; color: var(--mau-nhom, var(--do)); }

/* Thanh chọn trình độ YCT / HSK */
.thanh-cap-tv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 253, 248, .85);
  box-shadow: inset 0 0 0 1px var(--vien);
}
.tc-nut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muc-2);
  background: var(--giay-2);
  transition: background .15s, color .15s, transform .12s;
}
.tc-nut:hover { color: var(--muc); background: #E9E2D2; }
.tc-nut.on {
  background: var(--cap, var(--do));
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(31, 42, 68, .45);
}
.tc-nut span { font-size: 12px; font-weight: 600; opacity: .88; }

/* Thẻ đọc tiếp gọn */
.noi-bat.gon {
  grid-template-columns: 220px minmax(0, 1fr);
  padding: 14px 18px;
  margin-bottom: 26px;
  border-radius: 22px;
}
.noi-bat.gon .nb-chu b { font-size: clamp(26px, 3.2vw, 38px); }

/* Kệ 2 hàng kéo sang phải theo từng trình độ */
.ke-2hang {
  background: rgba(255, 253, 248, .65);
  padding: 18px 20px 16px;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(31, 42, 68, .07), 0 12px 28px -22px rgba(31, 42, 68, .4);
  margin-bottom: 28px;
}
.ke-2hang .ke-dau {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.ke-tieu { display: grid; gap: 4px; }
.ke-link-cap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muc);
  transition: color .15s;
}
.ke-link-cap:hover { color: var(--do); }
.ke-nhan-he {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--cap, var(--do));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}
.ke-mo-ta { margin: 0; font-size: 13px; color: var(--muc-2); }
.ke-hanh-dong { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ke-cuon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--giay);
  color: var(--muc);
  box-shadow: inset 0 0 0 1.5px var(--vien);
  font-size: 18px;
  transition: background .15s, transform .12s;
}
.ke-cuon:hover { background: var(--troi-sang); transform: scale(1.05); }
.nut-xem-cap {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--cap, var(--do));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(31, 42, 68, .35);
}
.nut-xem-cap:hover { filter: brightness(1.06); }

/* Lưới đúng 2 hàng, các truyện còn lại kéo sang phải */
.ke-hang-2 {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 202px;
  gap: 18px 18px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.ke-hang-2::-webkit-scrollbar { height: 7px; }
.ke-hang-2::-webkit-scrollbar-thumb { background: rgba(31, 42, 68, .22); border-radius: 4px; }
.ke-hang-2 .cuon, .ke-hang-2 .cuon.chua { width: 100%; }

/* Xem toàn bộ truyện của 1 trình độ trên toàn trang */
.ke-toan-trang {
  background: var(--giay);
  padding: 22px 24px 28px;
  border-radius: 26px;
  box-shadow: 0 18px 40px -26px rgba(31, 42, 68, .5), inset 0 0 0 1.5px rgba(31, 42, 68, .08);
}
.ktt-dau {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--vien);
}
.ktt-nhan {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--cap, var(--do));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.ktt-dau h2 { margin: 0 0 4px; font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; }
.ktt-dau p { margin: 0; color: var(--muc-2); font-size: 14px; }
.luoi-toan-trang {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 22px 18px;
}
.luoi-toan-trang .cuon, .luoi-toan-trang .cuon.chua { width: 100%; }

/* Nhãn YCT / HSK và nhãn đa nhóm trên bìa cuốn truyện */
.cuon-cap.co-chu {
  width: auto;
  min-width: 48px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .02em;
}
.cuon-da-nhom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(31, 42, 68, .72);
  color: #fff;
  backdrop-filter: blur(4px);
}
.cuon-da-nhom.cuon-nhan-nd {
  background: rgba(153, 27, 27, .86);
}

/* ===== Các màn học mới: 看图识字, Lật thẻ, Luyện phát âm, Luyện tập ===== */
.che-tab {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pa-tab { margin-bottom: 14px; }
.ct-nut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  background: var(--giay);
  color: var(--muc-2);
  box-shadow: inset 0 0 0 1.5px var(--vien);
  transition: background .15s, color .15s, box-shadow .15s;
}
.ct-nut svg { font-size: 19px; color: var(--do); }
.ct-nut:hover { color: var(--muc); }
.ct-nut.on {
  background: var(--muc);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(31, 42, 68, .55);
}
.ct-nut.on svg { color: var(--nang); }

/* 看图识字 */
.nh-luoi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.nh-the {
  background: var(--giay);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 30px -20px rgba(31, 42, 68, .5), inset 0 0 0 1px var(--vien);
  display: flex;
  flex-direction: column;
}
.nh-tranh {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--giay-2);
  overflow: hidden;
  cursor: pointer;
}
.nh-tranh img, .nh-tranh .canh-o { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.nh-tranh:hover img { transform: scale(1.04); }
.nh-cap {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(31, 42, 68, .78);
  color: #fff;
}
.nh-loa {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--la);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  font-size: 19px;
}
.nh-than {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.nh-tu-hang { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.nh-chu-chinh { cursor: pointer; display: grid; gap: 2px; }
.nh-chu-chinh b { font-family: var(--han); font-size: 30px; line-height: 1.15; color: var(--muc); }
.nh-chu-chinh small { font-size: 14px; font-weight: 600; color: var(--do); }
.nh-nghia { margin: 0; font-size: 15px; font-weight: 700; color: var(--muc); }
.nh-cau {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--giay-2);
  text-align: left;
  font-size: 13px;
}
.nh-cau svg { width: 18px; height: 18px; color: var(--la); margin-top: 2px; }
.nh-cau span { display: grid; gap: 2px; }
.nh-cau b { font-family: var(--han); font-size: 15px; }
.nh-cau i { font-style: normal; color: var(--muc-2); font-size: 12px; }
.nh-mo-truyen {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--la);
}
.nh-mo-truyen:hover { text-decoration: underline; }
.phan-trang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 28px;
}

/* Đố vui 看图识字 */
.nh-game-khung { max-width: 860px; }
.nhg-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.nhg-chuoi { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: #D97706; }
.nhg-chuoi svg { font-size: 20px; }
.nhg-than {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 12px;
}
.nhg-tranh {
  background: var(--giay-2);
  border-radius: 18px;
  overflow: hidden;
  padding-bottom: 10px;
}
.nhg-tranh img, .nhg-tranh .canh-o { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.nhg-nghe {
  margin: 10px 12px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #E3F3EA;
  color: #1D6B47;
  font-size: 13px;
  font-weight: 700;
}
.nhg-goi-y { margin: 4px 12px 0; font-size: 13.5px; color: var(--muc-2); }
.nhg-chon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nhg-op {
  min-height: 104px;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--giay-2);
  box-shadow: inset 0 0 0 2px var(--vien);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  transition: transform .12s, box-shadow .12s;
}
.nhg-op:hover { box-shadow: inset 0 0 0 2px var(--muc); transform: translateY(-2px); }
.nhg-op b { font-family: var(--han); font-size: 30px; line-height: 1.15; }
.nhg-op small { font-size: 13px; color: var(--do); font-weight: 600; }
.nhg-op i { font-style: normal; font-size: 12px; color: var(--muc-2); }
.nhg-op.dung { background: #E3F3EA; box-shadow: inset 0 0 0 2.5px var(--la); }
.nhg-op.sai { background: #FDE3E1; box-shadow: inset 0 0 0 2.5px var(--do); }

/* Lật thẻ Flashcard */
.lt-bo-loc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.lt-trang-thai { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-san { max-width: 720px; margin: 0 auto 28px; display: grid; gap: 16px; }
.fc-dem { text-align: center; font-size: 14px; color: var(--muc-2); }
.fc-nhan-thuoc { font-style: normal; font-weight: 700; color: var(--la); }
.fc-the {
  position: relative;
  min-height: 340px;
  border-radius: 28px;
  background: var(--giay);
  box-shadow: 0 24px 50px -28px rgba(31, 42, 68, .55), inset 0 0 0 2px rgba(31, 42, 68, .08);
  padding: 26px 28px;
  cursor: pointer;
  display: grid;
  align-items: center;
  transition: transform .22s ease, box-shadow .22s ease;
}
.fc-the:hover { box-shadow: 0 28px 56px -26px rgba(31, 42, 68, .65), inset 0 0 0 2px var(--do); }
.fc-mat { display: grid; gap: 14px; justify-items: center; text-align: center; }
.fc-the:not(.lat) .fc-sau { display: none; }
.fc-the.lat .fc-truoc { display: none; }
.fc-goc {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--troi-sang);
  color: var(--muc-2);
}
.fc-han { font-family: var(--han); font-size: clamp(54px, 9vw, 88px); line-height: 1.1; color: var(--muc); }
.fc-goi { margin: 0; font-size: 13.5px; color: var(--muc-3); }
.fc-nut-nho { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fc-sau-than {
  width: 100%;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  text-align: left;
}
.fc-tranh { aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--giay-2); box-shadow: var(--bong-sach); }
.fc-tranh img, .fc-tranh .canh-o { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-thong-tin { display: grid; gap: 6px; }
.fc-han-nho { font-family: var(--han); font-size: 40px; line-height: 1.1; }
.fc-py { font-size: 18px; font-weight: 700; color: var(--do); }
.fc-vi { margin: 2px 0 6px; font-size: 20px; font-weight: 800; color: var(--muc); }
.fc-cau {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--giay-2);
  display: grid;
  gap: 2px;
}
.fc-cau span { font-family: var(--han); font-size: 17px; font-weight: 700; }
.fc-cau small { font-size: 13px; color: var(--muc-2); }
.fc-dieu-khien { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fc-luu-so svg { width: 20px; height: 20px; color: var(--nang); }

/* Phòng luyện phát âm AI */
.pa-khung { max-width: 840px; }
.pa-dau-muc { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pa-than-tu, .pa-than-cau {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 16px;
}
.pa-tranh { aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--giay-2); box-shadow: var(--bong-sach); }
.pa-tranh img, .pa-tranh .canh-o { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-nghia-tu { margin: 0 0 10px; text-align: center; font-size: 16px; color: var(--muc-2); }
.pa-cau-zh { display: block; font-family: var(--han); font-size: 26px; line-height: 1.35; margin-bottom: 4px; }
.pa-cau-py { margin: 0 0 4px; color: var(--do); font-size: 15px; font-weight: 600; }
.pa-cau-vi { margin: 0 0 12px; color: var(--muc-2); font-size: 14.5px; }
.pa-chuyen { margin-top: 12px; }
.pa-ds-nhanh { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--vien); }
.bt-nut-nghe { margin-bottom: 14px; }

/* ===== Game vui học (11 game tiếng Trung tương tác) ===== */
.gv-pl-khung {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.gv-pl-khung .pl-the {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}
.gv-pl-khung .pl-ic {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--troi-sang);
  font-size: 22px;
  flex: none;
}
.gv-pl-khung .pl-the.on .pl-ic {
  background: var(--do);
  color: #fff;
}
.gv-pl-khung .pl-chu {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.gv-pl-khung .pl-ten {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--muc);
  line-height: 1.25;
}
.gv-pl-khung .pl-chu small {
  font-size: 12px;
  color: var(--muc-3);
}

.gv-luoi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 20px;
  margin-bottom: 34px;
}
.gv-the {
  background: var(--giay);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 32px -20px rgba(31, 42, 68, .5), inset 0 0 0 1px var(--vien);
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.gv-the:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px -20px rgba(31, 42, 68, .62), inset 0 0 0 1.5px rgba(215, 38, 30, .28);
}
.gv-bia-link { display: block; }
.gv-bia {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: #fff;
  overflow: hidden;
  text-align: center;
}
.gv-bia::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 18%, rgba(255, 255, 255, .22), transparent 55%);
  pointer-events: none;
}
.gv-bia-anh { padding: 0; }
.gv-bia-anh img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.gv-the:hover .gv-bia-anh img { transform: scale(1.04); }
.gv-chu-lon {
  font-family: var(--tua);
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 44px);
  line-height: 1.1;
  letter-spacing: .06em;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .28);
  z-index: 1;
}
.gv-py-lon {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: .9;
  letter-spacing: .03em;
  z-index: 1;
}
.gv-nhan-kn,
.gv-nhan-cap {
  position: absolute;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}
.gv-nhan-kn {
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, .68);
  color: #fff;
}
.gv-nhan-cap {
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, .9);
  color: var(--muc);
}
.gv-than {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.gv-dau-the h3 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}
.gv-dau-the h3 a:hover { color: var(--do); }
.gv-phu-zh {
  font-size: 12.5px;
  color: var(--muc-3);
}
.gv-phu-zh b {
  font-family: var(--han);
  color: var(--do);
  font-size: 14px;
}
.gv-mo-ta {
  margin: 0;
  font-size: 13.5px;
  color: var(--muc-2);
  line-height: 1.5;
  flex: 1;
}
.gv-nhom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gv-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--giay-2);
  color: var(--muc-2);
}
.gv-tag-thieu-nhi { background: #FDE8E4; color: #B43325; }
.gv-tag-tuoi-teen { background: #E3F3EA; color: #1D6B47; }
.gv-tag-di-hoc-di-lam { background: #E4ECF8; color: #244779; }
.gv-chan {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}
.gv-nut-choi { flex: 1; min-height: 40px; padding: 0 14px; font-size: 14px; }
.gv-nut-tab { min-height: 40px; padding: 0 12px; font-size: 13px; }
.nut-nho { min-height: 36px; padding: 0 13px; font-size: 13px; }

/* Khung chơi game trực tiếp trong RQX Reader */
.gv-san-choi {
  background: var(--giay);
  border-radius: 24px;
  box-shadow: 0 22px 48px -26px rgba(31, 42, 68, .58), inset 0 0 0 1.5px var(--vien);
  overflow: hidden;
  margin-bottom: 24px;
}
.gv-san-choi.toan-man {
  position: fixed;
  inset: 10px;
  z-index: 90;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}
.gv-thanh-choi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 16px;
  background: var(--giay-2);
  border-bottom: 1px solid var(--vien);
}
.gv-tc-trai,
.gv-tc-phai {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gv-tc-ten {
  display: grid;
  line-height: 1.2;
}
.gv-tc-ten b {
  font-family: var(--han);
  font-size: 17px;
  color: var(--muc);
}
.gv-tc-ten span {
  font-size: 12px;
  color: var(--muc-2);
  font-weight: 600;
}
.gv-tc-giua {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 0;
  scrollbar-width: thin;
}
.gv-chip-game {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--giay);
  color: var(--muc-2);
  box-shadow: inset 0 0 0 1px var(--vien);
  transition: background .15s, color .15s;
}
.gv-chip-game:hover { color: var(--muc); }
.gv-chip-game.on {
  background: var(--do);
  color: #fff;
  box-shadow: none;
}
.gv-khung-boc {
  width: 100%;
  height: clamp(560px, 78dvh, 860px);
  background: #0F172A;
}
.gv-san-choi.toan-man .gv-khung-boc {
  flex: 1;
  height: auto;
}
.gv-khung-if {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Bảng vàng Game vui học */
.gv-bang-vang {
  background: var(--giay);
  padding: 20px 22px 22px;
  border-radius: 24px;
  box-shadow: 0 14px 32px -22px rgba(31, 42, 68, .48), inset 0 0 0 1px var(--vien);
}
.gv-bang-vang .ke-dau {
  flex-wrap: wrap;
  align-items: center;
}
.gv-bv-bo-loc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.gv-bv-chon {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid var(--vien);
  background: var(--giay-2);
  color: var(--muc);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}
.gv-bv-ky { display: flex; gap: 6px; }
.gv-bv-ds {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.gv-bv-dong {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--giay-2);
  font-size: 14px;
}
.gv-bv-dong.hang-1 { background: #FEF3C7; box-shadow: inset 0 0 0 1.5px #F59E0B; }
.gv-bv-dong.hang-2 { background: #F1F5F9; box-shadow: inset 0 0 0 1.5px #94A3B8; }
.gv-bv-dong.hang-3 { background: #FFEDD5; box-shadow: inset 0 0 0 1.5px #FB923C; }
.gv-bv-hang {
  font-weight: 800;
  color: var(--muc-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gv-bv-dong.hang-1 .gv-bv-hang svg { color: #D97706; font-size: 22px; }
.gv-bv-dong.hang-2 .gv-bv-hang svg { color: #64748B; font-size: 22px; }
.gv-bv-dong.hang-3 .gv-bv-hang svg { color: #EA580C; font-size: 22px; }
.gv-bv-ten {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-bv-cap {
  font-size: 12px;
  font-weight: 700;
  color: var(--muc-3);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}
.gv-bv-diem {
  font-weight: 800;
  color: var(--do);
}
.gv-bv-cua-toi {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #E3F3EA;
  color: #1D6B47;
  font-size: 13.5px;
}
.gv-bv-trong {
  margin: 8px 0 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--giay-2);
  color: var(--muc-2);
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.gv-bv-trong p { margin: 0; }

@media (max-width: 960px) {
  .pl-khung, .gv-pl-khung { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nhg-than, .fc-sau-than, .pa-than-tu, .pa-than-cau { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .tv { grid-template-columns: 1fr; padding-bottom: 84px; }
  .ray {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
    gap: 6px;
  }
  .ray-logo { display: none; }
  .ray-con, .ray-con.mo, .rm-mui { display: none; }
  .ray-nhom-tv { display: contents; }
  .ray-muc {
    width: auto;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    text-align: center;
  }
  .rm-chu small { display: none; }
  .rm-chu b { font-size: 11px; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; text-align: center; }
  .noi-bat.gon { grid-template-columns: 1fr; }
  .ke-hang-2 { grid-auto-columns: 158px; gap: 14px; }
  .luoi-toan-trang { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .pl-khung, .gv-pl-khung, .gv-luoi { grid-template-columns: 1fr; }
  .gv-khung-boc { height: 74dvh; }
}

/* Màn đọc: thanh đầu chung, sách nằm giữa khung và bảng màu độc lập. */
.doc, .doc.don {
  --doc-giay: #FFFDF8;
  --doc-vien-sach: #EFE7D6;
  --doc-khung: #22324F;
  --doc-khung-toi: #182439;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 58px minmax(0, 1fr) 32px;
  grid-template-areas: "dau dau" "san cc" "chan cc";
  background: radial-gradient(70% 65% at 48% 52%, color-mix(in srgb, var(--doc-khung) 78%, white) 0%, transparent 75%), var(--doc-khung-toi);
}
.doc-dau, .don .doc-dau {
  position: relative;
  z-index: 9;
  padding: 7px clamp(12px, 1.8vw, 28px);
  gap: clamp(8px, 1.2vw, 18px);
  background: rgba(10, 18, 32, .42);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.doc-logo { display: flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; }
.doc-logo img { display: block; width: 150px; height: auto; }
.doc-logo strong { color: #12284B; background: #fff; font: 800 20px/1 var(--ui); padding: 6px 7px 6px 0; border-radius: 0 5px 5px 0; margin-left: -5px; }
.doc-ten { align-items: center; gap: 8px; }
.doc-ten b, .don .doc-ten b { font-size: clamp(15px, 1.35vw, 21px); }
.doc-ten span { font-size: 12px; }
.doc-theme { position: relative; flex: none; }
.doc-theme summary { list-style: none; display: flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.13); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.doc-theme summary::-webkit-details-marker { display: none; }
.doc-theme[open] summary, .doc-theme summary:hover { background: rgba(255,255,255,.22); }
.doc-theme-bang { position: absolute; top: calc(100% + 8px); right: 0; width: min(330px, calc(100vw - 24px)); padding: 14px; border-radius: 16px; background: #fff; color: #1F2A44; box-shadow: 0 18px 44px rgba(0,0,0,.35); }
.doc-theme-bang p { margin: 0 0 8px; font-size: 13px; font-weight: 800; }
.doc-theme-bang p:not(:first-child) { margin-top: 14px; }
.doc-theme-mau { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mau-mau { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 6px 3px; border: 2px solid transparent; border-radius: 10px; font-size: 10px; line-height: 1.2; text-align: center; }
.mau-mau:hover, .mau-mau.dang-chon { border-color: #D7261E; background: #FFF4F0; }
.mau-mau i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(31,42,68,.15); }
.mau-mau span { color: #1F2A44; }
.doc .san, .doc.don .san { padding: clamp(12px, 2vh, 24px) clamp(10px, 1.4vw, 22px); }
.doc .sach-mo { flex-basis: 0; min-width: 0; height: min(78dvh, 860px); max-height: calc(100dvh - 150px); margin: auto 0; }
.doc.doi .sach-mo { max-width: min(100%, 1580px); }
.doc.don .sach-mo { max-width: min(100%, 860px); }
.doc .sach-mo { background: var(--doc-vien-sach); box-shadow: 0 0 0 5px var(--doc-vien-sach), 0 3px 0 6px color-mix(in srgb, var(--doc-vien-sach) 75%, black), 0 24px 48px -16px rgba(0,0,0,.7); }
.doc .trang, .doc .trang.rong { background-color: var(--doc-giay); }
.doc .trang-van-ban, .doc .trang-manhua-xen { background: var(--doc-giay); }
.doc .cong-cu { background: color-mix(in srgb, var(--doc-khung-toi) 80%, transparent); }
.doc-chan { grid-area: chan; display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; color: rgba(255,255,255,.72); font-size: 11px; background: rgba(10,18,32,.32); border-top: 1px solid rgba(255,255,255,.1); }
.doc-chan i { width: 24px; height: 1px; background: rgba(255,255,255,.4); }

@media (max-width: 760px) {
  .doc, .doc.don { grid-template-columns: minmax(0, 1fr); grid-template-rows: 54px minmax(0, 1fr) 22px auto; grid-template-areas: "dau" "san" "chan" "cc"; }
  .doc-dau, .don .doc-dau { gap: 7px; padding: 5px 8px; }
  .doc-logo img { width: 96px; }
  .doc-logo strong { font-size: 13px; padding: 4px 4px 4px 0; }
  .doc-ten { display: grid; gap: 0; }
  .doc-ten b, .don .doc-ten b { font-size: 14px; }
  .doc-ten span { font-size: 10px; }
  .doc-dau .tien-do { display: none; }
  .doc-theme summary { min-height: 34px; padding: 0 8px; }
  .doc-theme summary span { display: none; }
  .doc .san, .doc.don .san { display: flex; gap: 5px; padding: 10px 6px; align-items: center; }
  .doc .sach-mo { height: min(68dvh, 700px); max-height: calc(100dvh - 190px); }
  .doc.don .sach-mo { flex: 0 0 calc(100vw - 108px); width: calc(100vw - 108px); max-width: calc(100vw - 108px); margin: auto 0; max-height: calc(100dvh - 190px); }
  .doc .mui, .don .mui { width: 34px; height: 34px; font-size: 18px; }
  .doc .cong-cu, .doc.don .cong-cu { width: 100%; max-height: none; min-height: 86px; padding: 7px 8px max(8px, env(safe-area-inset-bottom)); flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; overflow-x: auto; overflow-y: hidden; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .doc .cong-cu > * { flex: 0 0 auto; }
  .doc .che-chon { width: 104px; }
  .doc .cc, .doc .cong-cu .nut-theo, .doc .cong-cu .nut-tung-cau, .doc .cong-cu .phat { width: 66px; min-height: 64px; }
  .doc .toc { width: 62px; }
  .doc .cong-cu .phat { box-shadow: none; }
  .doc-chan { font-size: 10px; }
}


/* 17/11/2026: 看图识字 và Lật thẻ nằm trong Game vui học; menu giữ chỗ */
.ray-muc[hidden] { display: none !important; }
.tv-dau .nut-nho { margin-bottom: 10px; }
.fc-san { touch-action: pan-y; }
.fc-the { touch-action: pan-y; user-select: none; }
.fc-truoc { position: relative; width: 100%; }
.fc-tranh-lon { width: 100%; max-width: 560px; margin: 0 auto; }
.fc-lat-ic { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 253, 248, .92); color: var(--do); display: grid; place-items: center; box-shadow: 0 4px 12px -4px rgba(31, 42, 68, .5); }
.fc-lat-ic svg { width: 22px; height: 22px; }
.fc-giai { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muc-2); }
.fc-the:focus-visible { outline: 3px solid var(--do); outline-offset: 3px; }

.th-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 24px; }
.th-the { background: var(--giay); border-radius: 22px; padding: 16px; box-shadow: 0 14px 30px -20px rgba(31, 42, 68, .5), inset 0 0 0 1px var(--vien); display: grid; gap: 12px; align-content: start; }
.th-buoc { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; }
.th-b { margin: 0; display: grid; gap: 6px; justify-items: center; }
.th-b svg { width: 100%; max-width: 92px; aspect-ratio: 1; display: block; }
.th-b figcaption { font-size: 11.5px; font-weight: 700; color: var(--muc-2); text-align: center; }
.th-chu { width: 100%; max-width: 92px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; background: var(--troi-sang); font-family: var(--han); font-size: 52px; line-height: 1; color: var(--muc); }
.th-mui { font-style: normal; color: var(--do); font-size: 18px; }
.th-net { stroke-dasharray: 1; stroke-dashoffset: 0; }
.th-the.chay .th-b1 { animation: thHien .6s ease both; }
.th-the.chay .th-mui:nth-of-type(1) { animation: thHien .4s .7s ease both; }
.th-the.chay .th-b2 { animation: thHien .5s 1s ease both; }
.th-the.chay .th-b2 .th-net { animation: thVe 1.2s 1.1s ease both; }
.th-the.chay .th-mui:nth-of-type(2) { animation: thHien .4s 2.3s ease both; }
.th-the.chay .th-b3 { animation: thHien .6s 2.6s ease both; }
@keyframes thHien { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes thVe { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.th-than { display: grid; gap: 8px; }
.th-tu-hang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.th-han { font-family: var(--han); font-size: 34px; line-height: 1; }
.th-py { font-weight: 800; color: var(--do); }
.th-vi { font-weight: 700; color: var(--muc); }
.th-giai { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muc-2); }
.th-vds { display: grid; gap: 6px; }
.th-vd { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border-radius: 12px; background: var(--giay-2); border: 0; cursor: pointer; font: inherit; color: var(--muc); }
.th-vd svg { width: 18px; height: 18px; flex: none; color: var(--do); }
.th-vd i { font-style: normal; color: var(--muc-3); }
.th-pt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.th-manh { display: grid; justify-items: center; gap: 4px; padding: 8px 12px; border-radius: 16px; background: var(--troi-sang); }
.th-manh svg { width: 56px; height: 56px; }
.th-manh b { font-family: var(--han); font-size: 40px; line-height: 1; font-weight: 700; }
.th-kq { background: #FFF1D6; }
.th-cong { font-style: normal; font-size: 26px; font-weight: 800; color: var(--do); }
@media (max-width: 480px) { .th-luoi { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .th-the.chay * { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ===== Game Ghép tranh với từ (#/game-vui/ghep-tranh) ===== */
.gt-che { margin: 0 0 16px; }
.gt-dem { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 14px; font-size: 14px; color: var(--muc-2); }
.gt-dem b { color: var(--muc); font-size: 16px; }
.gt-dem .nut-phu { margin-left: auto; }
.gt-huong-dan { margin: 0 0 12px; color: var(--muc-2); font-size: 14px; line-height: 1.5; }
.gt-xong { margin: 0 0 18px; padding: 18px 16px 20px; border-radius: 22px; background: #FFF6E0; box-shadow: inset 0 0 0 2px #F5D48A; }
.gt-xong .xong-nut { justify-content: center; margin-top: 14px; }
.gt-bao { min-height: 22px; margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--muc-2); }
.gt-bao.dung { color: #1B7A4D; }
.gt-bao.sai { color: var(--do-dam); }
.gt-hai-nhom { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.gt-nhom { padding: 12px; border-radius: 18px; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 2px var(--vien); }
.gt-nhom-chu { background: #FFF8E6; }
.gt-nhom-ten { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muc-2); }
.gt-luoi { display: grid; gap: 10px; }
.gt-luoi-tranh { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gt-luoi-chu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gt-the { position: relative; display: block; width: 100%; padding: 0; border-radius: 14px; background: var(--giay); cursor: pointer; transition: transform .12s, box-shadow .12s, opacity .2s; }
.gt-tranh { aspect-ratio: 4 / 3; }
.gt-chu { min-height: 78px; }
.gt-mat { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; }
.gt-mat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--vien); pointer-events: none; }
.gt-mat img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gt-chu .gt-mat { align-content: center; gap: 2px; padding: 10px 8px; text-align: center; }
.gt-chu .gt-mat b { font-family: var(--han); font-size: clamp(24px, 6vw, 32px); line-height: 1.15; font-weight: 500; }
.gt-chu .gt-mat b.dai { font-size: clamp(17px, 4.4vw, 24px); }
.gt-chu .gt-mat small { font-size: 13px; color: var(--do); font-weight: 600; }
.gt-chu .gt-mat i { font-style: normal; font-size: 12px; color: var(--muc-2); line-height: 1.3; }
.gt-the:hover:not(.xong) { transform: translateY(-2px); }
.gt-the:focus-visible { outline: 3px solid var(--do); outline-offset: 3px; }
.gt-the.chon { box-shadow: 0 0 0 4px var(--nang); transform: translateY(-2px); }
.gt-the.chon .gt-mat::after { box-shadow: inset 0 0 0 2px var(--nang); }
.gt-the.xong { cursor: default; opacity: .72; transform: none; }
.gt-the.xong .gt-mat::after { box-shadow: inset 0 0 0 4px var(--la); }
.gt-dau-xong { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--la); color: #fff; font-size: 14px; font-weight: 800; line-height: 1; }
.gt-the.sai { animation: gt-lac .35s; box-shadow: 0 0 0 4px var(--do); }
.gt-the.sai .gt-mat::after { box-shadow: inset 0 0 0 4px var(--do); }
@media (min-width: 700px) {
  .gt-hai-nhom { grid-template-columns: 1fr 1fr; align-items: start; }
  .gt-luoi-tranh { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gt-chu { min-height: 100px; }
}
@keyframes gt-lac { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.gt-noi { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
.gt-noi-tranh { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.gt-noi-chu { display: grid; gap: 10px; align-content: start; }
.gt-nt { position: relative; display: block; width: 100%; padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--giay-2); transition: box-shadow .12s, transform .12s; }
.gt-nt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gt-nt:hover:not([disabled]) { transform: translateY(-2px); }
.gt-nt:focus-visible, .gt-nc:focus-visible { outline: 3px solid var(--do); outline-offset: 3px; }
.gt-nt.chon { box-shadow: 0 0 0 3px var(--nang); }
.gt-nt.xong { box-shadow: 0 0 0 3px var(--la); cursor: default; }
.gt-nhan { position: absolute; left: 8px; bottom: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(255,253,248,.92); font-family: var(--han); font-size: 18px; color: var(--muc); }
.gt-nc { min-height: 64px; padding: 10px 14px; border-radius: 16px; background: var(--giay-2); box-shadow: inset 0 0 0 2px var(--vien); display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; text-align: left; transition: box-shadow .12s, background .12s; }
.gt-nc b { font-family: var(--han); font-size: 26px; grid-row: span 2; font-weight: 500; }
.gt-nc:not(.xong) b { grid-row: auto; }
.gt-nc small { font-size: 13px; color: var(--do); font-weight: 600; }
.gt-nc i { font-style: normal; font-size: 12.5px; color: var(--muc-2); }
.gt-nc:hover:not([disabled]) { box-shadow: inset 0 0 0 2px var(--muc); }
.gt-nc.chon { background: #FFF1D0; box-shadow: inset 0 0 0 2.5px var(--nang); }
.gt-nc.xong { background: #E3F3EA; box-shadow: inset 0 0 0 2.5px var(--la); cursor: default; }
.gt-nt.sai, .gt-nc.sai { box-shadow: 0 0 0 3px var(--do); animation: gt-lac .35s; }
.gt-cau { margin: 10px 12px 2px; font-family: var(--han); font-size: 20px; line-height: 1.5; color: var(--muc); }
.gt-goc .nhg-op b.dai { font-size: 22px; }
@media (max-width: 699px) {
  .gt-noi { grid-template-columns: 1fr; }
  .gt-noi-chu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gt-nc { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .gt-nc b { grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .gt-the { transition: none; }
  .gt-the.sai, .gt-nt.sai, .gt-nc.sai { animation: none; }
}

/* nhãn phân loại giải thích chữ: từ nguyên, mẹo nhớ, cần xác minh */
.th-nguon { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muc-3, #5b6b7b); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.th-nguon a { color: inherit; text-decoration: underline; }
.th-loai { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.th-loai-tn { background: #DDF3E4; color: #14532D; }
.th-loai-meo { background: #DCEBFB; color: #1E3A8A; }
.th-loai-xm { background: #FDEBC8; color: #7C3F00; }
