/* ===== Toán cùng cô Tâm — giao diện chung ===== */
:root {
  --nen: #f6f4fb; --the: #ffffff; --chu: #1e1a2e; --phu: #5c5672; --mo: #8a84a0; --vien: #e7e2f1;
  --chinh: #5b3fd0; --chinh-dam: #3d2a9c; --chinh-nhat: #efeafe; --nhan: #f59e0b;
  --sdt: #0f9d8f; --inf: #ea580c; --st: #9333ea; --mp: #2563eb; --tc: #db2777; --de: #dc2626; --gt: #4f46e5; --ptm: #16a34a;
  --bo: 16px; --bong: 0 1px 2px rgba(30, 20, 60, .06), 0 6px 22px rgba(30, 20, 60, .07);
  --rong: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 16px/1.6 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; }
a { color: var(--chinh); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--chinh) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.an { display: none !important; }
.khung { max-width: var(--rong); margin: 0 auto; padding: 0 16px; }

/* ---------- đầu trang ---------- */
.dau { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--vien); }
.dau .khung { display: flex; align-items: center; gap: 14px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--chu); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-o { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px;
  background: linear-gradient(135deg, var(--chinh), #9b5cf6 60%, #ec4899); box-shadow: 0 4px 12px rgba(91, 63, 208, .35); }
.logo b { display: block; font-size: 17px; line-height: 1.15; }
.logo small { display: block; font-size: 11.5px; color: var(--mo); line-height: 1.2; }
.menu { display: flex; align-items: center; gap: 2px; margin-left: 10px; flex: 1; }
.menu > a, .menu .nhom > button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--phu); font-weight: 600; font-size: 14.5px;
  background: none; border: 0; white-space: nowrap; }
.menu > a:hover, .menu .nhom > button:hover, .menu .nhom.mo > button { background: var(--chinh-nhat); color: var(--chinh-dam); text-decoration: none; }
.menu > a.dang, .menu .nhom.dang > button { color: var(--chinh-dam); background: var(--chinh-nhat); }
.nhom { position: relative; }
.nhom > button::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.tha { position: absolute; top: calc(100% + 6px); left: 0; min-width: 290px; background: #fff; border: 1px solid var(--vien); border-radius: 14px; box-shadow: var(--bong); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s; }
.nhom.mo .tha { opacity: 1; visibility: visible; transform: none; }
.tha a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--chu); }
.tha a:hover { background: var(--nen); text-decoration: none; }
.tha a i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 18px; flex-shrink: 0; background: color-mix(in srgb, var(--m) 14%, #fff); }
.tha a b { display: block; font-size: 14.5px; }
.tha a small { display: block; color: var(--mo); font-size: 12.5px; line-height: 1.35; }
.phai { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dem { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff7e6; color: #8a5300; font-weight: 700; font-size: 13.5px; border: 1px solid #fde4b0; white-space: nowrap; }
.dem:hover { text-decoration: none; background: #ffefcc; }
.dem .cham { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.ban { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--vien); background: #fff; color: var(--chu); font-weight: 600; font-size: 13.5px; max-width: 190px; }
.ban span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ban .av { width: 28px; height: 28px; border-radius: 50%; background: var(--chinh-nhat); color: var(--chinh-dam); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.nut-menu { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--vien); background: #fff; font-size: 20px; }

/* ngăn kéo điện thoại */
.ngan { position: fixed; inset: 0; z-index: 80; background: rgba(20, 14, 40, .45); opacity: 0; visibility: hidden; transition: .2s; }
.ngan.mo { opacity: 1; visibility: visible; }
.ngan nav { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); background: #fff; padding: 14px; overflow-y: auto; transform: translateX(100%); transition: .25s; }
.ngan.mo nav { transform: none; }
.ngan h4 { margin: 16px 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mo); }
.ngan a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; color: var(--chu); font-weight: 600; }
.ngan a:hover, .ngan a.dang { background: var(--chinh-nhat); text-decoration: none; }
.ngan .dong { float: right; border: 0; background: var(--nen); width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }

@media (max-width: 1420px) { .dem .chu { display: none; } .menu > a, .menu .nhom > button { padding: 8px 9px; font-size: 14px; } .logo small { display: none; } }
@media (max-width: 1140px) { .menu, .dau .ban span:last-child { display: none; } .nut-menu { display: grid; place-items: center; } .ban { padding: 4px; } }
@media (max-width: 520px) { .logo small { display: none; } .dem .chu { display: none; } }

/* ---------- đường dẫn, tiêu đề trang ---------- */
.vet { font-size: 13.5px; color: var(--mo); padding: 18px 0 0; }
.vet a { color: var(--phu); }
.vet span { margin: 0 6px; }
.tieu-de { padding: 10px 0 18px; }
.tieu-de h1 { margin: 6px 0 6px; font-size: clamp(26px, 4vw, 36px); line-height: 1.2; letter-spacing: -.01em; }
.tieu-de p { margin: 0; color: var(--phu); max-width: 760px; }
.tieu-de .bieu { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; font-size: 26px; background: color-mix(in srgb, var(--m, var(--chinh)) 14%, #fff); }

/* ---------- thanh lọc ---------- */
.loc { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 18px; padding: 10px; background: #fff; border: 1px solid var(--vien); border-radius: 14px; position: sticky; top: 74px; z-index: 20; }
.tab { display: inline-flex; background: var(--nen); border-radius: 10px; padding: 3px; }
.tab button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 700; color: var(--phu); font-size: 14.5px; }
.tab button.on { background: #fff; color: var(--m, var(--chinh-dam)); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.o-tim { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; background: var(--nen); border-radius: 10px; padding: 0 12px; }
.o-tim input { border: 0; background: none; padding: 9px 0; width: 100%; font: inherit; font-size: 14.5px; outline: none; color: var(--chu); }
.dem-kq { color: var(--mo); font-size: 13.5px; }

/* ---------- thẻ ---------- */
.luoi { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; color: var(--chu); }
a.the:hover, .the.bam:hover { transform: translateY(-3px); box-shadow: var(--bong); text-decoration: none; }
.the .anh { aspect-ratio: 4/3; background: #f1eef8 center top/cover no-repeat; position: relative; border-bottom: 1px solid var(--vien); }
.the .anh img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.the .nhan-bai { position: absolute; left: 10px; top: 10px; background: rgba(255, 255, 255, .94); color: var(--m); font-weight: 800; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.the .than { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.the h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.the p { margin: 0; color: var(--phu); font-size: 13.5px; line-height: 1.45; }
.the .chan { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--phu); background: var(--nen); padding: 3px 9px; border-radius: 999px; }
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--vien); background: #fff; color: var(--chu); font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.nut:hover { text-decoration: none; border-color: var(--m, var(--chinh)); color: var(--m, var(--chinh-dam)); }
.nut.chinh { background: var(--m, var(--chinh)); border-color: var(--m, var(--chinh)); color: #fff; }
.nut.chinh:hover { filter: brightness(1.08); color: #fff; }
.nut.nho { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.nhom-chuong { margin: 26px 0 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nhom-chuong h2 { margin: 0; font-size: 19px; }
.nhom-chuong .so-ch { font-weight: 800; color: var(--m); font-size: 13px; background: color-mix(in srgb, var(--m) 12%, #fff); padding: 2px 10px; border-radius: 999px; }
.rong { text-align: center; color: var(--mo); padding: 40px 10px; }

/* ---------- trang chủ ---------- */
.hero { position: relative; z-index: 2; background: linear-gradient(135deg, #2e1f7a 0%, #5b3fd0 55%, #9b5cf6 100%); color: #fff; border-radius: 0 0 28px 28px; }
.hero::before { content: '∑  π  √x  ∫  Δ  ∞  θ  ≠  ≤  ∈  f(x)  →'; position: absolute; inset: 0; font-size: 46px; font-weight: 800; opacity: .07; letter-spacing: 20px; line-height: 1.9; word-spacing: 30px; padding: 10px; pointer-events: none; overflow: hidden; border-radius: 0 0 28px 28px; }
.hero .khung { position: relative; padding-top: 48px; padding-bottom: 54px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.12; margin: 8px 0 12px; letter-spacing: -.02em; }
.hero p.mo-ta { font-size: 17px; opacity: .92; margin: 0 0 22px; max-width: 560px; }
.hero .loi { display: inline-block; background: rgba(255, 255, 255, .16); padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.tim-lon { display: flex; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: 560px; position: relative; }
.tim-lon input { flex: 1; border: 0; outline: none; padding: 10px 12px; font: inherit; color: var(--chu); min-width: 0; }
.tim-lon button { border: 0; background: var(--nhan); color: #3b2300; font-weight: 800; padding: 0 18px; border-radius: 10px; }
.goi-y { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; color: var(--chu); border-radius: 14px; box-shadow: var(--bong); max-height: 380px; overflow: auto; z-index: 10; padding: 6px; }
.goi-y a { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--chu); align-items: center; }
.goi-y a:hover, .goi-y a.chon { background: var(--nen); text-decoration: none; }
.goi-y small { color: var(--mo); display: block; font-size: 12.5px; }
.lop-nhanh { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lop-nhanh a { background: rgba(255, 255, 255, .14); color: #fff; padding: 9px 16px; border-radius: 12px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .25); }
.lop-nhanh a:hover { background: rgba(255, 255, 255, .25); text-decoration: none; }
.hero-so { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-so div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 16px; }
.hero-so b { display: block; font-size: 30px; line-height: 1.1; }
.hero-so span { font-size: 13.5px; opacity: .9; }
@media (max-width: 860px) { .hero .khung { grid-template-columns: 1fr; padding-top: 30px; } }

.muc { padding: 40px 0 6px; }
.muc > h2 { font-size: 24px; margin: 0 0 4px; }
.muc > p.gt { margin: 0 0 18px; color: var(--phu); }
.o-muc { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.o-muc a { background: #fff; border: 1px solid var(--vien); border-radius: 18px; padding: 18px; color: var(--chu); display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; transition: .15s; }
.o-muc a::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: color-mix(in srgb, var(--m) 10%, transparent); }
.o-muc a:hover { transform: translateY(-3px); box-shadow: var(--bong); text-decoration: none; border-color: color-mix(in srgb, var(--m) 40%, var(--vien)); }
.o-muc i { font-style: normal; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--m) 14%, #fff); }
.o-muc h3 { margin: 4px 0 0; font-size: 18px; }
.o-muc p { margin: 0; font-size: 14px; color: var(--phu); }
.o-muc .so { font-size: 13px; font-weight: 700; color: var(--m); }
.o-muc .di { margin-top: auto; font-weight: 700; color: var(--m); font-size: 14px; }
.buoc { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: b; }
.buoc div { background: #fff; border: 1px solid var(--vien); border-radius: 16px; padding: 18px 18px 18px 64px; position: relative; }
.buoc div::before { counter-increment: b; content: counter(b); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%; background: var(--chinh); color: #fff; font-weight: 800; display: grid; place-items: center; }
.buoc b { display: block; margin-bottom: 4px; }
.buoc p { margin: 0; font-size: 14px; color: var(--phu); }

/* ---------- học theo bài ---------- */
.htb { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; padding-bottom: 30px; }
.ds-bai { background: #fff; border: 1px solid var(--vien); border-radius: 16px; padding: 10px; position: sticky; top: 78px; max-height: calc(100vh - 92px); overflow-y: auto; }
.ds-bai .tab { width: 100%; margin-bottom: 8px; }
.ds-bai .tab button { flex: 1; }
.ds-bai details { border-radius: 10px; }
.ds-bai summary { cursor: pointer; list-style: none; padding: 8px 10px; font-weight: 700; font-size: 13.5px; color: var(--phu); border-radius: 10px; display: flex; gap: 8px; }
.ds-bai summary::-webkit-details-marker { display: none; }
.ds-bai summary:hover { background: var(--nen); }
.ds-bai summary .ic { flex-shrink: 0; }
.ds-bai a { display: block; padding: 7px 10px 7px 34px; border-radius: 9px; font-size: 14px; color: var(--chu); line-height: 1.4; }
.ds-bai a:hover { background: var(--nen); text-decoration: none; }
.ds-bai a.dang { background: var(--chinh-nhat); color: var(--chinh-dam); font-weight: 700; }
.bai-chi-tiet { min-width: 0; }
.bai-dau { background: #fff; border: 1px solid var(--vien); border-radius: 18px; padding: 22px; border-top: 6px solid var(--m); }
.bai-dau .so-ch { font-weight: 700; color: var(--m); font-size: 13.5px; }
.bai-dau h1 { margin: 4px 0 6px; font-size: clamp(22px, 3.2vw, 30px); line-height: 1.25; }
.bai-dau p { margin: 0; color: var(--phu); }
.tai-nguyen { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 16px; }
.tn { background: #fff; border: 1px solid var(--vien); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tn .anh { aspect-ratio: 16/10; background: #f1eef8; overflow: hidden; }
.tn .anh img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tn .bieu-lon { aspect-ratio: 16/10; display: grid; place-items: center; font-size: 48px; background: color-mix(in srgb, var(--m) 10%, #fff); }
.tn .than { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tn .loai { font-size: 12px; font-weight: 800; color: var(--m); text-transform: uppercase; letter-spacing: .05em; }
.tn h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.tn p { margin: 0; font-size: 13.5px; color: var(--phu); }
.tn .chan { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.chuyen { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@media (max-width: 900px) { .htb { grid-template-columns: 1fr; } .ds-bai { position: static; max-height: 360px; } }

/* ---------- trình xem ---------- */
body.trang-xem { overflow: hidden; }
.xem { position: fixed; inset: 0; display: flex; flex-direction: column; background: #2b2640; }
.xem-thanh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--vien); flex-wrap: nowrap; }
.xem-thanh .ten { flex: 1; min-width: 0; }
.xem-thanh .ten b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xem-thanh .ten small { display: block; font-size: 12.5px; color: var(--mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xem-thanh .nut { padding: 8px 12px; }
.xem iframe { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 700px) { .xem-thanh .chu-nut { display: none; } .xem-thanh .nut { padding: 8px 10px; } }

/* ---------- hộp thoại ---------- */
.hop-nen { position: fixed; inset: 0; z-index: 100; background: rgba(20, 14, 40, .5); display: grid; place-items: center; padding: 16px; animation: hien .2s; }
@keyframes hien { from { opacity: 0; } }
.hop { background: #fff; border-radius: 20px; width: min(470px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); position: relative; }
.hop h2 { margin: 0 0 4px; font-size: 22px; }
.hop > p { margin: 0 0 16px; color: var(--phu); font-size: 14.5px; }
.hop .x { position: absolute; right: 14px; top: 14px; border: 0; background: var(--nen); width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.vai { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.vai button { border: 2px solid var(--vien); background: #fff; border-radius: 12px; padding: 10px 4px; font-size: 13px; font-weight: 700; color: var(--phu); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vai button span { font-size: 22px; }
.vai button.on { border-color: var(--chinh); background: var(--chinh-nhat); color: var(--chinh-dam); }
.hop label { display: block; font-size: 13.5px; font-weight: 700; margin: 10px 0 4px; }
.hop input { width: 100%; padding: 11px 12px; border: 1px solid var(--vien); border-radius: 11px; font: inherit; font-size: 15px; }
.hop input:focus { border-color: var(--chinh); outline: none; box-shadow: 0 0 0 3px var(--chinh-nhat); }
.hop .hang { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.hop .nut-hang { display: flex; gap: 10px; margin-top: 18px; }
.hop .nut-hang .nut { flex: 1; }
.hop .loi-nho { font-size: 12.5px; color: var(--mo); margin: 12px 0 0; }
.hop .loi-sai { color: var(--de); font-size: 13.5px; margin-top: 8px; min-height: 1em; }
@media (max-width: 420px) { .vai { grid-template-columns: repeat(2, 1fr); } .hop .hang { grid-template-columns: 1fr; } }

.bao { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1e1a2e; color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 120; font-size: 14.5px; box-shadow: var(--bong); animation: hien .2s; max-width: calc(100vw - 32px); }
.thong-bao { background: #fff7e6; border: 1px solid #fde4b0; color: #7a4a00; padding: 10px 14px; border-radius: 12px; font-size: 14px; margin: 0 0 16px; }

/* ---------- thống kê ---------- */
.o-so { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.o-so div { background: #fff; border: 1px solid var(--vien); border-radius: 16px; padding: 16px 18px; }
.o-so span { font-size: 13.5px; color: var(--phu); font-weight: 600; }
.o-so b { display: block; font-size: 32px; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.o-so small { color: var(--mo); font-size: 12.5px; }
.bang-tk { background: #fff; border: 1px solid var(--vien); border-radius: 16px; padding: 18px; margin-top: 16px; }
.bang-tk h2 { margin: 0 0 2px; font-size: 18px; }
.bang-tk > p { margin: 0 0 12px; color: var(--mo); font-size: 13.5px; }
.bieu-do { position: relative; }
.bieu-do svg { width: 100%; height: 240px; display: block; overflow: visible; }
.bieu-do .cot { fill: var(--chinh); }
.bieu-do .cot:hover, .bieu-do .cot.on { fill: var(--chinh-dam); }
.bieu-do text { font-size: 11px; fill: var(--mo); font-family: inherit; }
.bieu-do .luoi-ke { stroke: var(--vien); stroke-width: 1; }
.goi-tip { position: absolute; pointer-events: none; background: #1e1a2e; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -110%); }
.thanh-ngang { display: grid; grid-template-columns: 170px 1fr 54px; gap: 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.thanh-ngang .vach { height: 14px; background: var(--nen); border-radius: 4px; overflow: hidden; }
.thanh-ngang .vach div { height: 100%; background: var(--chinh); border-radius: 0 4px 4px 0; }
.thanh-ngang b { text-align: right; font-variant-numeric: tabular-nums; }
table.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bang th, table.bang td { padding: 7px 8px; border-bottom: 1px solid var(--vien); text-align: left; }
table.bang td.so { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- hướng dẫn ---------- */
.hd { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; padding-bottom: 40px; }
.hd nav { position: sticky; top: 80px; background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: 10px; }
.hd nav a { display: block; padding: 7px 10px; border-radius: 9px; color: var(--phu); font-size: 14px; font-weight: 600; }
.hd nav a:hover { background: var(--nen); text-decoration: none; }
.hd article { background: #fff; border: 1px solid var(--vien); border-radius: 18px; padding: 8px 26px 26px; min-width: 0; }
.hd article h2 { margin: 28px 0 8px; font-size: 21px; scroll-margin-top: 84px; display: flex; gap: 10px; align-items: center; }
.hd article h3 { margin: 18px 0 6px; font-size: 16.5px; }
.hd article li { margin: 6px 0; }
.hd code, .hd kbd { background: var(--nen); border: 1px solid var(--vien); border-radius: 6px; padding: 1px 6px; font-size: 13.5px; font-family: Consolas, monospace; }
.hd .meo { background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 14.5px; }
.hd .canh { background: #fff7e6; border: 1px solid #fde4b0; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 14.5px; }
.hd table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.hd th, .hd td { border: 1px solid var(--vien); padding: 7px 9px; text-align: left; vertical-align: top; }
.hd th { background: var(--nen); }
.kiem { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.kiem input { flex: 1; min-width: 240px; padding: 10px 12px; border: 1px solid var(--vien); border-radius: 10px; font: inherit; font-size: 14px; }
@media (max-width: 860px) { .hd { grid-template-columns: 1fr; } .hd nav { position: static; } .hd article { padding: 4px 16px 20px; } }

/* ---------- chân trang ---------- */
.chan-trang { margin-top: 50px; background: #1e1a2e; color: #cfc9e3; font-size: 14px; }
.chan-trang .khung { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; padding-top: 34px; padding-bottom: 24px; }
.chan-trang h4 { color: #fff; margin: 0 0 10px; font-size: 14.5px; }
.chan-trang a { color: #cfc9e3; display: block; padding: 3px 0; }
.chan-trang a:hover { color: #fff; }
.chan-trang .ban-quyen { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 16px; text-align: center; font-size: 13px; color: #9a93b5; }
.chan-trang .dem-chan { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.chan-trang .dem-chan span { background: rgba(255, 255, 255, .07); padding: 6px 10px; border-radius: 10px; }
.chan-trang .dem-chan b { color: #fff; }
@media (max-width: 860px) { .chan-trang .khung { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .chan-trang .khung { grid-template-columns: 1fr; } }

/* nút lên đầu */
.len-dau { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--chinh); color: #fff; font-size: 20px; box-shadow: var(--bong); opacity: 0; visibility: hidden; transition: .2s; z-index: 40; }
.len-dau.hien { opacity: 1; visibility: visible; }
@media print { .dau, .chan-trang, .loc, .len-dau { display: none !important; } }

/* điện thoại: đầu trang gọn, không tràn ngang */
.logo { min-width: 0; flex-shrink: 1; }
.logo > span:last-child { min-width: 0; }
.logo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd code { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .dau .khung { gap: 8px; }
  .logo-o { width: 36px; height: 36px; font-size: 20px; }
  .logo b { font-size: 15px; }
  .phai { gap: 6px; }
  .dem { padding: 5px 9px; }
  .nut-menu { width: 38px; height: 38px; }
}
