.spinner{width:18px;height:18px;border:2px solid #c7d2fe;border-top-color:#4f46e5;border-radius:50%;display:inline-block;animation:vt-spin .8s linear infinite;flex-shrink:0}
@keyframes vt-spin{to{transform:rotate(360deg)}}
.tag{display:inline-block;font-size:11px;padding:1px 6px;border-radius:4px;background:#eef2ff;color:#4338ca;margin-left:4px;font-weight:500}
.prose h2{font-size:1.35rem;font-weight:700;margin:1.4em 0 .5em}
.prose>:first-child{margin-top:0}
.prose h3{font-size:1.1rem;font-weight:600;margin:1.2em 0 .4em}
.prose p{margin:.7em 0;line-height:1.75}
.prose ol{list-style:decimal;padding-left:1.4em;margin:.7em 0}
.prose ul{list-style:disc;padding-left:1.4em;margin:.7em 0}
.prose li{margin:.3em 0}
.prose a{color:#4f46e5;text-decoration:underline}
.prose img{border-radius:8px;margin:1em 0;max-width:100%}
.prose table{border-collapse:collapse;width:100%}
.prose td,.prose th{border:1px solid #e2e8f0;padding:6px 10px}
.tbl{width:100%;font-size:.875rem;background:#fff}
.tbl th{text-align:left;font-weight:600;color:#475569;background:#f8fafc;padding:.5rem .75rem;border-bottom:1px solid #e2e8f0;white-space:nowrap}
.tbl td{padding:.5rem .75rem;border-top:1px solid #f1f5f9;vertical-align:top}
.tbl tr:hover td{background:#fafafa}
.inp{border:1px solid #cbd5e1;border-radius:.5rem;padding:.45rem .7rem;width:100%;background:#fff}
.inp:focus{outline:2px solid #a5b4fc;border-color:#6366f1}
.btn{display:inline-flex;align-items:center;gap:.35rem;padding:.45rem 1rem;border-radius:.5rem;font-size:.875rem;font-weight:500;background:#4f46e5;color:#fff}
.btn:hover{background:#4338ca}
.btn-light{background:#fff;color:#334155;border:1px solid #cbd5e1}
.btn-light:hover{background:#f8fafc}
.btn-danger{background:#e11d48}
.btn-danger:hover{background:#be123c}
.btn-sm{padding:.25rem .6rem;font-size:.78rem}
.card{background:#fff;border:1px solid #e2e8f0;border-radius:.75rem}
.lbl{display:block;font-size:.8rem;font-weight:500;color:#475569;margin-bottom:.25rem}
.line-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ===== Vùng quảng cáo chuẩn AdSense =====
   Giữ chỗ trước (min-height) để không nhảy bố cục (CLS); nhãn "Quảng cáo" tách biệt nội dung;
   khoảng cách ≥ 32px với nút bấm / điều hướng để tránh nhấp nhầm. */
.ad-zone{display:block;margin:32px auto;text-align:center;clear:both;overflow:hidden}
.ad-zone .ad-label{font-size:11px;line-height:16px;letter-spacing:.06em;text-transform:uppercase;color:#94a3b8;margin-bottom:4px}
.ad-zone .ad-body{display:flex;justify-content:center;align-items:center;width:100%}
.ad-zone .ad-body>ins{width:100%}
/* Leaderboard: 320×100 di động → 728×90 tablet → 970×90 desktop */
.ad-zone-header{max-width:970px;margin-top:20px;margin-bottom:24px}
.ad-zone-header .ad-body{min-height:100px}
@media (min-width:768px){.ad-zone-header .ad-body{min-height:90px}}
/* Hình chữ nhật trong nội dung: 300×250 / 336×280 */
.ad-zone-content{max-width:728px}
.ad-zone-content .ad-body{min-height:280px}
/* Half page 300×600, dính khi cuộn (chỉ desktop) */
.ad-zone-sidebar{width:300px;margin:0 0 24px}
.ad-zone-sidebar .ad-body{min-height:600px}
/* In-article */
.ad-zone-article{max-width:100%;margin:28px auto}
.ad-zone-article .ad-body{min-height:250px}
/* Cuối trang: 300×250 di động → 728×90 / 970×250 desktop */
.ad-zone-footer{max-width:970px;margin-top:40px;margin-bottom:8px}
.ad-zone-footer .ad-body{min-height:250px}
@media (min-width:1024px){.ad-zone-footer .ad-body{min-height:250px}}
/* Khung xem trước cho quản trị viên khi chưa gắn mã */
.ad-placeholder{width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px dashed #cbd5e1;border-radius:8px;background:repeating-linear-gradient(45deg,#f8fafc,#f8fafc 10px,#f1f5f9 10px,#f1f5f9 20px);color:#64748b;font:600 13px/1.4 system-ui,sans-serif}
.ad-zone .ad-body:has(.ad-placeholder){align-items:stretch}
.ad-zone-header .ad-placeholder{min-height:100px}
@media (min-width:768px){.ad-zone-header .ad-placeholder{min-height:90px}}
.ad-zone-content .ad-placeholder{min-height:280px}
.ad-zone-sidebar .ad-placeholder{min-height:600px}
.ad-zone-article .ad-placeholder{min-height:250px}
.ad-zone-footer .ad-placeholder{min-height:250px}

/* ===================================================================
   CHẾ ĐỘ TỐI — kích hoạt bằng <html class="dark">
   Ánh xạ lại các lớp màu Tailwind đang dùng; độ ưu tiên (html.dark .x)
   cao hơn lớp gốc nên không cần sửa từng màn hình.
   =================================================================== */
html.dark{color-scheme:dark}
html.dark body{background:#0b1120;color:#e2e8f0}
:where(html.dark) *,:where(html.dark) ::before,:where(html.dark) ::after{border-color:#243146}
/* Tailwind CDN chèn màu viền mặc định sau file này: tăng độ ưu tiên cho các lớp viền không kèm màu */
html.dark :where(.border,.border-t,.border-b,.border-y,.border-x,.border-l,.border-r,.border-2,hr){border-color:#243146}
html.dark .divide-y>*{border-color:#1f2b40}
html.dark .border-indigo-600{border-color:#4f46e5}
html.dark .border-indigo-400{border-color:#818cf8}
html.dark .border-slate-800{border-color:#1e293b}

/* Nền */
html.dark .bg-white{background-color:#111a2e}
html.dark .bg-slate-50{background-color:#0f1729}
html.dark .bg-slate-100{background-color:#1a2438}
html.dark .bg-slate-200{background-color:#273449}
html.dark .bg-slate-400{background-color:#475569}
html.dark .bg-indigo-50{background-color:rgba(99,102,241,.16)}
html.dark .bg-rose-50{background-color:rgba(244,63,94,.12)}
html.dark .bg-emerald-50{background-color:rgba(16,185,129,.12)}
html.dark .bg-amber-50{background-color:rgba(245,158,11,.12)}
html.dark .bg-sky-50{background-color:rgba(14,165,233,.12)}
html.dark .bg-rose-100{background-color:rgba(244,63,94,.2)}
html.dark .bg-emerald-100{background-color:rgba(16,185,129,.2)}
html.dark .bg-amber-100{background-color:rgba(245,158,11,.2)}
html.dark footer.bg-slate-900{background-color:#060b17}
html.dark .hover\:bg-slate-50:hover,html.dark .hover\:bg-slate-100:hover{background-color:#1a2438}
html.dark .hover\:bg-slate-200:hover{background-color:#273449}

/* Chữ */
html.dark .text-slate-800{color:#e2e8f0}
html.dark .text-slate-700{color:#cbd5e1}
html.dark .text-slate-600{color:#a8b4c7}
html.dark .text-slate-500{color:#8d9bb0}
html.dark .text-slate-400{color:#6b7a90}
html.dark .hover\:text-slate-800:hover{color:#f8fafc}
html.dark .text-indigo-600,html.dark .text-indigo-700{color:#a5b4fc}
html.dark .text-rose-600{color:#fb7185}
html.dark .text-rose-700,html.dark .text-rose-800{color:#fda4af}
html.dark .text-emerald-600{color:#34d399}
html.dark .text-emerald-700,html.dark .text-emerald-800{color:#6ee7b7}
html.dark .text-amber-600{color:#fbbf24}
html.dark .text-amber-700,html.dark .text-amber-800{color:#fcd34d}
html.dark .text-sky-800{color:#7dd3fc}

/* Viền */
html.dark .border-slate-300{border-color:#334155}
html.dark .border-rose-200,html.dark .border-rose-300{border-color:rgba(244,63,94,.35)}
html.dark .border-emerald-200{border-color:rgba(16,185,129,.35)}
html.dark .border-amber-200,html.dark .border-amber-300{border-color:rgba(245,158,11,.35)}
html.dark .border-sky-200{border-color:rgba(14,165,233,.35)}
html.dark .shadow-lg,html.dark .shadow-sm,html.dark .shadow{--tw-shadow-color:rgba(0,0,0,.5)}

/* Thành phần tự định nghĩa */
html.dark .card{background:#111a2e;border-color:#1f2b40}
html.dark .inp,html.dark input:not([type=checkbox]):not([type=radio]),html.dark select,html.dark textarea{background-color:#0d1526;border-color:#334155;color:#e2e8f0}
html.dark .inp::placeholder,html.dark input::placeholder,html.dark textarea::placeholder{color:#64748b}
html.dark .bg-slate-50.inp{background-color:#0a1120;color:#8d9bb0}
html.dark .lbl{color:#a8b4c7}
html.dark .btn-light{background:#1a2438;color:#e2e8f0;border-color:#334155}
html.dark .btn-light:hover{background:#273449}
html.dark .tbl{background:#111a2e}
html.dark .tbl th{background:#0f1729;color:#8d9bb0;border-color:#1f2b40}
html.dark .tbl td{border-color:#1a2438}
html.dark .tbl tr:hover td{background:#152036}
html.dark .tag{background:rgba(99,102,241,.2);color:#c7d2fe}
html.dark .prose a{color:#a5b4fc}
html.dark .prose td,html.dark .prose th{border-color:#273449}
html.dark code{background:#1a2438;color:#e2e8f0}
html.dark .spinner{border-color:#334155;border-top-color:#818cf8}
html.dark .ad-zone .ad-label{color:#64748b}
html.dark .ad-placeholder{border-color:#334155;background:repeating-linear-gradient(45deg,#0f1729,#0f1729 10px,#131d31 10px,#131d31 20px);color:#8d9bb0}

/* Nút chuyển chế độ */
.theme-toggle .i-sun{display:none}
html.dark .theme-toggle .i-sun{display:block}
html.dark .theme-toggle .i-moon{display:none}
