/* Bộ máy phát cảnh – dùng chung cho trình dựng và gói xuất */
.ls-scene { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; overflow: hidden; background: #fff; color: #1f1f1f; }
.ls-band { position: absolute; left: 0; top: 0; width: 100%; height: 14px; }
.ls-accent { position: absolute; left: 0; top: 14px; width: 220px; height: 5px; }
.ls-corner { position: absolute; right: -120px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; opacity: .7; }
.ls-el { position: absolute; box-sizing: border-box; }
.ls-el img, .ls-el video, .ls-el canvas, .ls-el iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ls-el video.ls-hidden-src { visibility: hidden; }
.ls-text { position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; word-wrap: break-word; }
.ls-text > * { margin: 0; }
.ls-text p + p, .ls-text p + ul, .ls-text ul + p { margin-top: .45em; }
.ls-text ul, .ls-text ol { padding-left: 1.3em; }
.ls-text li { margin: .32em 0; }
.ls-text ul li::marker { color: var(--ls-accent); content: "▶  "; font-size: .75em; }
.ls-text b, .ls-text strong { color: var(--ls-primary); }
.ls-empty { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f1f2f6, #f1f2f6 12px, #e8eaf1 12px, #e8eaf1 24px); border: 2px dashed #b8bccb; color: #6b7080; font-size: 22px; border-radius: 10px; }
.ls-shield { position: absolute; inset: 0; }

/* xuất hiện / ẩn */
.ls-el.ls-anim { transition-property: opacity, transform, clip-path; transition-timing-function: cubic-bezier(.2,.7,.2,1); }
.ls-el.ls-off { opacity: 0; pointer-events: none; }
.ls-el.ls-off[data-fx="fly"] { transform: translateY(40px); }
.ls-el.ls-off[data-fx="left"] { transform: translateX(-60px); }
.ls-el.ls-off[data-fx="right"] { transform: translateX(60px); }
.ls-el.ls-off[data-fx="zoom"] { transform: scale(.6); }
.ls-el.ls-off[data-fx="wipe"] { clip-path: inset(0 100% 0 0); opacity: 1; }
.ls-el[data-fx="wipe"] { clip-path: inset(0 0 0 0); }
.ls-el.ls-off[data-fx="none"] { transition: none; }

/* hiện từng ý theo lời giảng */
.ls-text li, .ls-text > p { transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.2,1); }
.ls-text .ls-li-off { opacity: 0; transform: translateY(14px); }
/* phụ đề */
.ls-cc { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); max-width: 86%; z-index: 9000; background: rgba(10,12,18,.78); color: #fff;
  font: 500 26px/1.35 "Segoe UI", Arial, sans-serif; padding: 6px 16px; border-radius: 8px; text-align: center; pointer-events: none; }
/* ảnh thu nhỏ */
.ls-thumbvid { background: #1e2130 center / cover no-repeat; }
.ls-thumbkey { background-color: #00b140; }

/* chuyển cảnh */
.ls-scene[class*="ls-tr-"] { animation-timing-function: cubic-bezier(.2,.7,.2,1); animation-fill-mode: both; }
.ls-tr-fade { animation-name: lsFade; }
.ls-tr-push { animation-name: lsPush; }
.ls-tr-cover { animation-name: lsCover; }
.ls-tr-zoom { animation-name: lsZoom; }
.ls-tr-wipe { animation-name: lsWipe; }
.ls-tr-split { animation-name: lsSplit; }
@keyframes lsFade { from { opacity: 0; } }
@keyframes lsPush { from { transform: translateX(100%); } }
@keyframes lsCover { from { transform: translateY(100%); } }
@keyframes lsZoom { from { transform: scale(.82); opacity: 0; } }
@keyframes lsWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lsSplit { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }

/* ---- định dạng chữ nâng cao ---- */
.ls-text[style*="--para"] p + p, .ls-text[style*="--para"] p + ul, .ls-text[style*="--para"] ul + p { margin-top: var(--para); }
.ls-text[style*="--para"] li { margin: calc(var(--para) / 2) 0; }
.ls-text[data-mk="dot"] ul li::marker { content: "●  "; }
.ls-text[data-mk="check"] ul li::marker { content: "✓  "; font-size: .9em; }
.ls-text[data-mk="dash"] ul li::marker { content: "–  "; font-size: 1em; }
.ls-text[data-mk="square"] ul li::marker { content: "■  "; font-size: .7em; }
.ls-text[data-mk="star"] ul li::marker { content: "★  "; font-size: .85em; }
.ls-text[data-mk="none"] ul { list-style: none; padding-left: 0; }
.ls-text[data-mk="none"] ul li::marker { content: ""; }
.ls-shape-text { pointer-events: none; }
.ls-vec { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ---- icon ---- */
.ls-iconbox { position: absolute; inset: 0; display: grid; place-items: center; }
.ls-iconbox svg { width: 100%; height: 100%; }

/* ---- bảng ---- */
.ls-tablewrap { overflow: hidden; }
.ls-tbl { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.ls-tbl th, .ls-tbl td { border: 1px solid var(--tl, #d5d9e3); padding: .35em .6em; vertical-align: middle; line-height: 1.3; word-wrap: break-word; }
.ls-tbl td[contenteditable="true"], .ls-tbl th[contenteditable="true"] { outline: 2px solid #086288; outline-offset: -2px; background: #fffbe6; }

/* ---- biểu đồ: hiệu ứng khi hiện ---- */
.ls-chart-play .ls-ch-bar:not(.h) { transform-box: fill-box; transform-origin: bottom; animation: lsGrowY .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.ls-chart-play .ls-ch-bar.h { transform-box: fill-box; transform-origin: left; animation: lsGrowX .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.ls-chart-play .ls-ch-line { stroke-dasharray: 1; animation: lsDraw 1.2s ease both; }
.ls-chart-play .ls-ch-slice { animation: lsFade .5s ease both; animation-delay: calc(var(--i) * 90ms); }
@keyframes lsGrowY { from { transform: scaleY(0); } }
@keyframes lsGrowX { from { transform: scaleX(0); } }
@keyframes lsDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---- công thức / sơ đồ ---- */
.ls-mathbox { position: absolute; inset: 0; display: flex; align-items: center; }
.ls-mathbox math { font-size: 1em; }
.ls-svgwrap { position: absolute; inset: 0; }
.ls-svgwrap svg { width: 100%; height: 100%; }

/* ---- nút bấm / vùng bấm ---- */
.ls-btn { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: .4em; border: 2px solid transparent; cursor: pointer;
  font-family: inherit; padding: 0 .8em; box-shadow: 0 6px 16px rgba(0,0,0,.14); transition: transform .12s, filter .12s; }
.ls-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.ls-btn:active { transform: translateY(0); }
.ls-btn svg { width: 1.1em; height: 1.1em; flex: none; }
.ls-btn.ls-out { box-shadow: none; }
.ls-btn.ls-hot { background: transparent; box-shadow: none; border: 0; }
.ls-btn.ls-hot:hover { background: rgba(255,255,255,.18); outline: 3px solid rgba(255,214,0,.85); border-radius: 10px; transform: none; }
.ls-btn.ls-hot span { font-size: 16px; color: #086288; background: rgba(227,242,251,.94); padding: 2px 8px; border-radius: 6px; }

/* ---- câu hỏi trong bài ---- */
.ls-quizbox { position: absolute; inset: 0; border-radius: 18px; box-shadow: 0 18px 50px rgba(15,18,40,.22); padding: 1em 1.2em; display: flex; flex-direction: column; gap: .5em; overflow: auto; border-top: 6px solid var(--qa); }
.lq-head { display: flex; align-items: center; gap: .6em; }
.lq-badge { background: var(--qa); color: #fff; font-weight: 700; font-size: .7em; padding: .2em .8em; border-radius: 99px; letter-spacing: .03em; text-transform: uppercase; }
.lq-pts { font-size: .7em; opacity: .7; }
.lq-stem { font-weight: 700; font-size: 1.05em; line-height: 1.35; }
.lq-hint { font-size: .72em; opacity: .65; margin-top: -.3em; }
.lq-opts { display: grid; gap: .4em; }
.lq-o { display: flex; align-items: center; gap: .6em; text-align: left; font: inherit; font-size: .9em; padding: .45em .7em; border: 2px solid #e2e5ee; border-radius: 12px; background: #fff; color: inherit; cursor: pointer; }
.lq-o:hover { border-color: var(--qa); }
.lq-l { flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: #eef0f6; font-weight: 700; font-size: .85em; }
.lq-o.m .lq-l { border-radius: 6px; }
.lq-o.sel { border-color: var(--qa); background: color-mix(in srgb, var(--qa) 9%, #fff); }
.lq-o.sel .lq-l { background: var(--qa); color: #fff; }
.lq-o.ok { border-color: #16a34a; background: #e9f8ef; } .lq-o.ok .lq-l { background: #16a34a; color: #fff; }
.lq-o.bad { border-color: #dc2626; background: #fdecec; } .lq-o.bad .lq-l { background: #dc2626; color: #fff; }
.lq-tf4 { width: 100%; border-collapse: collapse; font-size: .85em; }
.lq-tf4 td, .lq-tf4 th { border-bottom: 1px solid #e2e5ee; padding: .3em .4em; text-align: left; }
.lq-tf4 th { font-size: .8em; opacity: .7; text-align: center; }
.lq-tf4 td:not(:first-child) { width: 3.2em; text-align: center; }
.lq-tf4 tr.ok td:first-child { color: #16a34a; } .lq-tf4 tr.bad td:first-child { color: #dc2626; }
.lq-ds { font: inherit; font-weight: 700; width: 2.2em; height: 1.9em; border: 2px solid #e2e5ee; border-radius: 8px; background: #fff; cursor: pointer; color: inherit; }
.lq-ds.sel { background: var(--qa); border-color: var(--qa); color: #fff; }
.lq-in { font: inherit; font-size: .95em; padding: .45em .7em; border: 2px solid #e2e5ee; border-radius: 10px; width: 100%; box-sizing: border-box; }
.lq-in:focus { outline: none; border-color: var(--qa); }
.lq-ans { font-size: .8em; margin-top: .3em; }
.lq-fb { font-size: .82em; padding: .5em .8em; border-radius: 10px; line-height: 1.4; }
.lq-fb.ok { background: #e9f8ef; color: #166534; } .lq-fb.bad { background: #fdecec; color: #991b1b; }
.lq-foot { display: flex; justify-content: flex-end; gap: .5em; margin-top: auto; padding-top: .3em; }
.lq-btn { font: inherit; font-size: .85em; font-weight: 700; padding: .45em 1.2em; border-radius: 10px; border: 0; background: var(--qa); color: #fff; cursor: pointer; }
.lq-btn:disabled { opacity: .45; cursor: default; }
.lq-btn.ghost { background: transparent; color: var(--qa); border: 2px solid var(--qa); }
