/* Chế độ nền tối (đen trung tính, không navy — JUN chốt 28/11) cho các bài đi kèm video (/cong-dong/<bài>/ và /skill/).
   Bật bằng <html data-theme="dark">; nút chuyển do bai-video.js gắn vào thanh menu. */
.nut-mau{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:1.5px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);cursor:pointer}
.nut-mau:hover{border-color:currentColor}
.nut-mau svg{width:19px;height:19px;fill:currentColor}
.nut-mau i{width:14px;height:14px;border-radius:50%;border:2px solid currentColor;background:linear-gradient(90deg,currentColor 50%,transparent 50%)}

html[data-theme="dark"]{
  --cream:#0e0e10; --cream-2:#1c1c1f; --paper:#161618;
  --ink:#f3f3f4; --muted:#9b9ba3; --line:rgba(255,255,255,.16);
  --blue:#5b8cff; --blue-d:#8fb0ff; --blue-l:#1f1f23;
  --teal:#5b8cff; --teal-d:#8fb0ff; --teal-l:#1f1f23;
  color-scheme:dark;
}
html[data-theme="dark"] body{background:#0e0e10}
html[data-theme="dark"] header.nav{background:rgba(14,14,16,.96);border-bottom-color:rgba(255,255,255,.12)}
html[data-theme="dark"] .lead,
html[data-theme="dark"] .tac-gia,
html[data-theme="dark"] .chot,
html[data-theme="dark"] .bv-chu span,
html[data-theme="dark"] .s3 p,
html[data-theme="dark"] .st .cl,
html[data-theme="dark"] .guide p,
html[data-theme="dark"] .guide li,
html[data-theme="dark"] .guide td{color:#c8c8cd}
html[data-theme="dark"] .guide h2,html[data-theme="dark"] h1,html[data-theme="dark"] .guide h3{color:#fff}
html[data-theme="dark"] .mark,
html[data-theme="dark"] .btn-gold,
html[data-theme="dark"] .prompt button:not(.ok),
html[data-theme="dark"] .tag.key{color:#0b1d3a}
html[data-theme="dark"] .btn-line:hover{color:#0b1d3a}
html[data-theme="dark"] .tac-gia,
html[data-theme="dark"] .so-sanh,
html[data-theme="dark"] .bv-the,
html[data-theme="dark"] .tu-lam,
html[data-theme="dark"] .st,
html[data-theme="dark"] .s3,
html[data-theme="dark"] details.acc,
html[data-theme="dark"] .tw,
html[data-theme="dark"] .vcap{background:#161618;border-color:rgba(255,255,255,.16)}
html[data-theme="dark"] .prompt{background:#0a0a0b;border:1px solid rgba(255,255,255,.14)}
html[data-theme="dark"] .guide pre{background:#0a0a0b}
html[data-theme="dark"] .bv-hang>div,
html[data-theme="dark"] .help{background:#18181b;border:1px solid rgba(255,255,255,.18)}
html[data-theme="dark"] .note,
html[data-theme="dark"] .keybox,
html[data-theme="dark"] .callout.warn{background:#1d1a10;border-color:#8a6d22;color:#efe3c2}
html[data-theme="dark"] .callout{background:#1f1f23}
html[data-theme="dark"] .guide th{background:#1f1f23;color:#e4e4e7}
html[data-theme="dark"] .vid,
html[data-theme="dark"] figure.canh video{box-shadow:0 0 0 1px rgba(255,255,255,.16)}
html[data-theme="dark"] .dk-kenh{background:#161618;border-color:rgba(255,255,255,.2);border-left-color:#e62117}
header.nav .wrap>.nut-mau{margin-left:auto;margin-right:10px}


/* Ô kêu gọi đăng ký kênh + bình luận (bai-video.js chèn vào đầu bài) */
.dk-kenh{display:flex;flex-wrap:wrap;align-items:center;gap:16px 22px;max-width:820px;margin:4px 0 20px;padding:20px 22px;background:#fff;border:1.5px solid var(--line);border-left:5px solid #e62117;border-radius:10px}
.dk-kenh p{flex:1 1 320px;margin:0;font-size:18px;line-height:1.5;color:var(--ink)}
.dk-kenh p b{color:var(--ink)}
.dk-nut{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.nut-dk{display:inline-flex;align-items:center;gap:10px;padding:16px 28px;border-radius:10px;background:#e62117;color:#fff!important;font:800 18px var(--sans,system-ui);text-decoration:none;white-space:nowrap;animation:lac-dk 3.2s ease-in-out 1s infinite}
.nut-dk:hover{background:#c41a12;animation-play-state:paused}
.nut-dk svg{width:24px;height:24px;fill:#fff}
.nut-bl{display:inline-flex;align-items:center;padding:14px 18px;border-radius:10px;border:1.5px solid var(--line);color:var(--ink)!important;font:600 15.5px var(--sans,system-ui);text-decoration:none;white-space:nowrap}
.nut-bl:hover{border-color:currentColor}
@keyframes lac-dk{0%,62%,100%{transform:translateX(0) rotate(0)}66%{transform:translateX(-7px) rotate(-2deg)}70%{transform:translateX(7px) rotate(2deg)}74%{transform:translateX(-5px) rotate(-1.5deg)}78%{transform:translateX(5px) rotate(1.5deg)}82%{transform:translateX(-2px)}86%{transform:translateX(0)}}
@media(max-width:620px){.dk-kenh{padding:16px}.dk-kenh p{font-size:16.5px}.nut-dk{padding:14px 22px;font-size:17px}}
@media(prefers-reduced-motion:reduce){.nut-dk{animation:none}}

/* Nền loang theo cuộn (học từ trang Cộng đồng): canvas #nenLoang do bai-video.js vẽ, cố định sau nội dung */
html{background:#fbfcfe}
html[data-theme="dark"]{background:#0e0e10}
body{background:transparent!important;position:relative}
#nenLoang{position:fixed;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;display:block}
header.nav{background:rgba(251,252,254,.9)!important}
html[data-theme="dark"] header.nav{background:rgba(14,14,16,.9)!important}

/* Hiện dần khi cuộn tới (dùng chung 2 bài, bai-video.js gắn class) */
.hien{opacity:0;transform:translateY(32px);transition:opacity .8s cubic-bezier(.22,.7,.2,1),transform .8s cubic-bezier(.22,.7,.2,1);transition-delay:var(--tre,0s)}
.hien.on{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){.hien{opacity:1;transform:none;transition:none}}
