/* lythuyet.thayquyenmath.online: cùng chất liệu với phòng thi (exam.css).
   Bảng xanh chọn lớp; phiếu lý thuyết viết thẳng trên một tờ giấy có lề đỏ, số mục ghi ở lề bằng bút đỏ,
   hình vẽ dán băng keo; mục lục bám theo bên trái. Không dùng hộp bo góc. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- trang chủ: chương + mục lục buổi ---------- */
.chuong { margin-bottom: 40px; }
.chuong-head { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 4px 20px; padding-bottom: 10px; border-bottom: 3px solid var(--ink); }
.chuong-so { font-family: var(--f-head); font-weight: 800; font-size: clamp(5rem, 16vw, 9rem); line-height: .72; color: var(--pastel); letter-spacing: -.03em;
  margin-bottom: -14px; text-shadow: 3px 3px 0 var(--deep); }
.chuong-nhan { font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--do); }
.chuong-head h2 { font-size: clamp(2rem, 6vw, 3rem); text-transform: uppercase; letter-spacing: .01em; }
.chuong-dem { font-family: var(--f-hand); color: var(--tim); font-size: 1.3rem; transform: rotate(-3deg); }
.muc-phu a { color: var(--deep); font-weight: 600; }

/* ---------- phiếu lý thuyết: một tờ giấy ---------- */

.ghi-chu .muiten.lui { width: 56px; }
.ghi-chu:hover .muiten.lui { transform: translateX(-6px); }
.l9-to { padding-top: 34px; padding-bottom: 34px; }
.l9-to .tape { left: auto; right: 34px; transform: rotate(4deg); }
.l9-head { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.l9-eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--do); }
.l9-head h1 { font-size: clamp(2rem, 5.8vw, 3rem); text-transform: uppercase; letter-spacing: .01em; }
.l9-chuong { font-family: var(--f-hand); color: var(--tim); font-size: 1.3rem; }
.l9-sec { font-size: clamp(1.5rem, 4vw, 1.9rem); margin: 34px 0 6px; }
.l9-sec .hl { padding: 0 4px; }

/* mục kiến thức: số ghi ở lề đỏ, khoanh bằng bút đỏ */
.kt { position: relative; padding: 16px 0 14px; border-bottom: 1px dashed var(--rule-strong); }
.kt:last-of-type { border-bottom: 0; }
.kt h3 { font-family: var(--f-body); font-size: 1.08rem; font-weight: 800; color: var(--deep); margin-bottom: 6px; }
.le-so { position: absolute; left: calc(-1 * var(--pl) + 4px); top: 12px; width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--f-hand); font-size: 1.4rem; color: var(--do); border: 2px solid var(--do); border-radius: 50%; transform: rotate(-8deg); background: var(--paper); }
@media (max-width: 639px) { .le-so { left: calc(-1 * var(--pl) + 2px); width: 24px; height: 24px; font-size: 1.05rem; border-width: 1.5px; } }
.kt ul { margin: 0; padding-left: 0; list-style: none; color: var(--ink); display: grid; gap: 6px; }
.kt li { position: relative; padding-left: 22px; }
.kt li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 11px; height: 2px; background: var(--pastel); transform: rotate(-12deg); }
.kt-body.has-fig { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 26px; align-items: center; }

/* hình vẽ: tờ giấy nhỏ dán băng keo, hơi lệch */
.fig { position: relative; margin: 10px 4px 4px; background: #fff; border: 1px solid var(--rule); padding: 10px; text-align: center; max-width: 100%;
  transform: rotate(1.4deg); box-shadow: 0 12px 18px -14px rgba(18, 53, 36, .6); }
.fig::before { content: ""; position: absolute; top: -10px; left: 50%; width: 74px; height: 20px; transform: translateX(-50%) rotate(-3deg); background: rgba(242, 201, 76, .45);
  clip-path: polygon(0 10%, 5% 0, 100% 6%, 96% 50%, 100% 100%, 4% 94%, 0 60%); }
.vd .fig { transform: rotate(-1.2deg); }
.fig img { display: block; max-width: 100%; height: auto; margin: 0 auto; }

/* ví dụ mẫu */
.vd { padding: 18px 0 16px; border-bottom: 1px dashed var(--rule-strong); }
.vd:last-of-type { border-bottom: 0; }
.vd .dang { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin-bottom: 8px; }
.vd .de-row { display: flex; gap: 18px; align-items: flex-start; color: var(--ink); }
.vd .de-row .de { flex: 1; min-width: 0; }
.vd .lab { color: var(--deep); font-weight: 800; }
.vd details { margin-top: 12px; }
.vd summary { cursor: pointer; font-family: var(--f-hand); color: var(--tim); font-size: 1.28rem; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.vd summary::-webkit-details-marker { display: none; }
.vd summary::before { content: "↓"; font-family: var(--f-body); font-weight: 700; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1.5px solid currentColor; border-radius: 50%; font-size: .9rem; transition: transform .2s; }
.vd details[open] summary::before { transform: rotate(180deg); }
.vd .giai { margin-top: 8px; color: var(--ink); line-height: 1.75; border-left: 2px dashed var(--pastel); padding-left: 16px; }
.vd .giai p { margin: 0 0 4px; }
.vd .giai .g { font-weight: 800; color: var(--deep); }
.l9-next { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 30px 0 8px; }

@media (max-width: 620px) {
  .chuong-head { grid-template-columns: auto 1fr; }
  .chuong-dem { grid-column: 1 / -1; justify-self: end; }
  .kt-body.has-fig { grid-template-columns: 1fr; justify-items: center; }
  .kt-body.has-fig ul { justify-self: stretch; }
  .vd .de-row { flex-direction: column; }
  .vd .de-row .fig { align-self: center; }
}

/* ---------- khung trang ---------- */
.lt-wrap { max-width: 1140px; margin: 0 auto; padding-bottom: 40px; }
#tien { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--yellow); transform-origin: left; transform: scaleX(0); z-index: 60; pointer-events: none; }
.lt-board { margin: 4px 0 40px; }
.lt-board .chalk-line { margin-top: 6px; }
.lt-lop { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 6px; }
.lt-lop a { display: grid; place-items: center; width: 84px; height: 84px; border: 3px dashed var(--chalk-faint); color: var(--chalk);
  font-family: var(--f-chalk); font-weight: 700; font-size: 2.6rem; line-height: 1; text-decoration: none; transition: transform .2s, border-color .2s; }
.lt-lop a small { font-size: .8rem; font-weight: 400; color: var(--chalk-dim); margin-bottom: -10px; }
.lt-lop a:hover { transform: translateY(-3px); border-color: var(--chalk-yellow); }
.lt-lop a[aria-current="page"] { border: 3px solid var(--chalk-yellow); color: var(--chalk-yellow); background: rgba(245, 212, 106, .08); }
.lt-lop a:focus-visible { outline: 3px solid var(--chalk-yellow); outline-offset: 3px; }
.lt-moi { font-family: var(--f-hand); color: var(--tim); font-size: 1.5rem; text-align: center; margin: 10px 0 40px; }
.lt-wrap .ke-h { margin-top: 46px; }
.lt-wrap .ke-h:first-of-type { margin-top: 0; }
.lt-cho { margin-top: 18px; padding: 22px 26px; color: var(--ink); font-size: 1.02rem; }

/* sơ đồ tư duy: hai tờ giấy dán băng keo */
.lt-sd { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin-top: 22px; }
.lt-sd-i { position: relative; display: grid; gap: 4px; padding: 26px 26px 22px; color: var(--ink-soft); text-decoration: none;
  box-shadow: 6px 6px 0 var(--ink); border: 2px solid var(--ink); transition: transform .2s, box-shadow .2s; }
.lt-sd-i:nth-child(1) { transform: rotate(-.8deg); }
.lt-sd-i:nth-child(2) { transform: rotate(.7deg); }
.lt-sd-i:hover { transform: translate(-2px, -3px) rotate(0); box-shadow: 9px 9px 0 var(--ink); }
.lt-sd-i:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.sd-ve { width: 150px; height: auto; color: var(--green); margin-bottom: 6px; }
.lt-sd-hk { font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--do); }
.lt-sd-i b { font-family: var(--f-head); font-size: 1.7rem; font-weight: 800; color: var(--ink); text-transform: uppercase; line-height: 1.05; }
.lt-sd-nd { font-size: .92rem; }
.lt-di { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--f-hand); color: var(--tim); font-size: 1.25rem; }
.lt-di .muiten { width: 46px; transition: transform .2s; }
.lt-sd-i:hover .lt-di .muiten { transform: translateX(6px); }

/* bài học tương tác ở Lab */
.lt-bh { list-style: none; margin: 8px 0 0; padding: 0; }
.lt-bh a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; align-items: center; padding: 16px 4px; border-bottom: 1px dashed var(--rule-strong);
  color: var(--ink-soft); text-decoration: none; }
.lt-bh b { color: var(--ink); font-size: 1.08rem; }
.lt-bh span { grid-column: 1; font-size: .9rem; }
.lt-bh .muiten { grid-column: 2; grid-row: 1 / 3; width: 52px; color: var(--deep); transition: transform .2s; }
.lt-bh a:hover b { color: var(--deep); }
.lt-bh a:hover .muiten { transform: translateX(6px); }

/* ---------- đọc phiếu: mục lục bám theo + tờ giấy ---------- */
.lt-crumb { margin: 2px 0 16px; }
.lt-doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.lt-toc { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; padding: 4px 4px 12px 0; }
.lt-toc-h { font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; text-transform: uppercase; color: var(--ink); padding-bottom: 6px; border-bottom: 3px solid var(--ink); }
.lt-toc-ds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 1px; }
.lt-toc-ds .nhom { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--do); margin: 12px 0 4px; }
.lt-toc-ds a { display: block; padding: 6px 8px 6px 12px; border-left: 3px solid transparent; color: var(--ink-soft); text-decoration: none; font-size: .9rem; line-height: 1.35; }
.lt-toc-ds a:hover { color: var(--ink); border-left-color: var(--rule-strong); }
.lt-toc-ds a[aria-current] { color: var(--ink); font-weight: 700; border-left-color: var(--deep); background: linear-gradient(90deg, rgba(157, 196, 110, .22), transparent); }
.lt-toc-act { margin-top: 18px; }
.lt-toc-act .btn { width: 100%; justify-content: center; }
.lt-cong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.lt-co { display: inline-flex; gap: 4px; }
.lt-toc-m { display: none; }
#to { font-size: calc(1rem * var(--lt-co, 1)); }
#to .kt h3 { font-size: 1.08em; }
.lt-goi { font-family: var(--f-hand); color: var(--tim); font-size: 1.2em; margin-top: 2px; }
.kt, .vd { scroll-margin-top: 16px; }
.lt-tiep { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; padding-top: 16px; border-top: 2px solid var(--ink); }
.lt-tiep a { display: grid; gap: 2px; color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.3; padding: 6px 0; }
.lt-tiep a small { font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--do); }
.lt-tiep .sau { text-align: right; grid-column: 2; }
.lt-tiep a:hover { color: var(--deep); }

@media (max-width: 900px) {
  .lt-doc { grid-template-columns: minmax(0, 1fr); }
  .lt-toc { display: none; }
  .lt-toc-m { display: block; position: relative; }
  .lt-toc-m summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 2px solid var(--ink);
    background: var(--paper); font-weight: 700; color: var(--ink); font-size: .9rem; }
  .lt-toc-m summary::-webkit-details-marker { display: none; }
  .lt-toc-m summary::after { content: "▾"; margin-left: 8px; }
  .lt-toc-m[open] .lt-toc-ds { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(86vw, 360px); max-height: 60vh; overflow: auto;
    background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 4px 10px 12px; margin: 0; }
}
@media (max-width: 560px) {
  .lt-lop { gap: 8px; }
  .lt-lop a { width: 64px; height: 68px; font-size: 2.1rem; }
  .lt-tiep { grid-template-columns: 1fr; }
  .lt-tiep .sau { grid-column: 1; }
  .lt-sd-i { padding: 22px 18px 18px; }
  #in { display: none; }
}
@media print {
  body { background: #fff !important; }
  #tien, .lt-crumb, .lt-toc, .lt-cong, .l9-next, .lt-tiep, .app-fs, #zfs { display: none !important; }
  .lt-doc { display: block; }
  #to { box-shadow: none; border: 0; transform: none; }
  .vd details > summary { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lt-sd-i, .lt-sd-i:hover { transform: none; } }
