/**
 * ==============================================================================
 * DỰ ÁN: Blog cá nhân gaubo.io.vn
 * FILE: tainguyen/css/style.css
 * MỤC ĐÍCH: Bảng kiểu dáng toàn bộ website (Ưu tiên di động Mobile-First, thuần CSS)
 * ==============================================================================
 */

/* ==========================================================================
   1. HỆ THỐNG DESIGN TOKENS (Chuẩn hóa Stripe-Inspired + Gấu Bố Pixel Accent)
   ========================================================================== */
:root {
    /* 1.1. BẢNG MÀU CHỦ ĐẠO (Primary - Gấu Tangerine / Sunset Orange) */
    --color-primary-50: #fff7ed;
    --color-primary-100: #ffedd5;
    --color-primary-200: #fed7aa;
    --color-primary-500: #ff6b00;          /* Màu nhận diện Gấu Bố: Cam ấm, tươi sáng, nhiệt huyết */
    --color-primary-600: #ea580c;          /* Hover nút chính */
    --color-primary-700: #c2410c;          /* Active / Focus viền */

    /* 1.2. BẢNG MÀU PHỤ CÔNG NGHỆ (Secondary Accent - Stripe Electric Indigo) */
    --color-accent-50: #eef2ff;
    --color-accent-100: #e0e7ff;
    --color-accent-500: #635bff;           /* Tím Stripe: Công nghệ, hiện đại, tri thức */
    --color-accent-600: #4f46e5;
    --color-accent-700: #4338ca;

    /* 1.3. THANG MÀU BỀ MẶT & VĂN BẢN (Neutral Slate Surface Scale) */
    --color-bg-canvas: #f8fafc;            /* Nền canvas sáng sạch (Slate 50) */
    --color-bg-surface: #ffffff;           /* Nền thẻ Card trắng muốt */
    --color-bg-subtle: #f1f5f9;            /* Nền blockquote, code block (Slate 100) */
    --color-border-subtle: #e2e8f0;        /* Viền mỏng tiêu chuẩn (Slate 200) */
    --color-border-hover: #cbd5e1;         /* Viền khi hover (Slate 300) */
    --color-text-muted: #94a3b8;           /* Chữ phụ, icon mờ (Slate 400) */
    --color-text-secondary: #64748b;       /* Tóm tắt, ngày tháng (Slate 500) */
    --color-text-primary: #0f172a;         /* Tiêu đề & nội dung chính (Slate 900) */

    /* 1.4. ALIAS TƯƠNG THÍCH NGƯỢC (Đảm bảo 100% không làm vỡ các trang cũ) */
    --mau-chinh: var(--color-primary-500);
    --mau-chinh-hover: var(--color-primary-600);
    --mau-phu: var(--color-accent-500);
    --mau-nen: var(--color-bg-canvas);
    --mau-the: var(--color-bg-surface);
    --mau-chu-chinh: var(--color-text-primary);
    --mau-chu-phu: var(--color-text-secondary);
    --mau-chu-nhat: var(--color-text-muted);
    --mau-vien: var(--color-border-subtle);
    --mau-vien-dam: var(--color-border-hover);
    --mau-bg-nhe: var(--color-bg-subtle);

    /* 1.5. HỆ THỐNG PHÔNG CHỮ (Typography Stack) */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --phong-chu: var(--font-sans);
    --phong-tieu-de: var(--font-sans);

    /* 1.6. THANG KÍCH THƯỚC CHỮ (5 Cấp Chuẩn) */
    --text-display: clamp(1.75rem, 4vw, 2.25rem); /* Level 1: 28px - 36px */
    --text-h1: 1.5rem;                           /* Level 2: 24px */
    --text-h2: 1.25rem;                          /* Level 3: 20px */
    --text-h3: 1.125rem;                         /* Level 4: 18px */
    --text-body: 1rem;                           /* Level 4 Body: 16px */
    --text-caption: 0.875rem;                    /* Level 5: 14px */
    --text-micro: 0.75rem;                       /* Level 5 Micro: 12px */

    --co-chu-than: var(--text-body);
    --chieu-cao-dong: 1.65;
    --chieu-rong-doc: 70ch;

    /* 1.7. THANG SPACING 4PX / 8PX */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */

    /* 1.8. HỆ THỐNG BO GÓC (Border Radius) */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --bo-goc: var(--radius-lg);
    --bo-goc-nho: var(--radius-sm);

    /* 1.9. HỆ THỐNG ĐỔ BÓNG (Layered Soft Shadows - Stripe Standard) */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
    --shadow-glow-primary: 0 0 20px rgba(255, 107, 0, 0.25);
    --shadow-glow-accent: 0 0 20px rgba(99, 91, 255, 0.25);
    --do-bong: var(--shadow-sm);
    --do-bong-noi: var(--shadow-md);
}

/* ==========================================================================
   2. THIẾT LẬP CƠ BẢN (CSS Reset, Base & Accessibility Focus Ring)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-canvas);
    color: var(--color-text-primary);
    line-height: var(--chieu-cao-dong);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chuẩn tiếp cận bàn phím: Focus Ring rõ ràng phong cách Stripe */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-accent-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Tối ưu hóa ảnh Pixel Logo */
.logo-anh, img[src*="logo.png"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--mau-chinh);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a:hover {
    color: var(--mau-chinh-hover);
}

ul, ol {
    list-style-position: inside;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Khung chứa giới hạn chiều rộng */
.hop-chua {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.noi-dung-chinh {
    flex: 1 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* ==========================================================================
   3. ĐẦU TRANG & THANH ĐIỀU HƯỚNG (Glassmorphism Sticky Header & Navigation)
   ========================================================================== */
.dau-trang {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.khung-dau-trang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.thuong-hieu {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-primary);
    text-decoration: none;
}

.thuong-hieu:hover {
    color: var(--color-text-primary);
}

.logo-anh {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background-color: var(--color-primary-50);
    border: 2px solid var(--color-primary-500);
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s ease;
}

.thuong-hieu:hover .logo-anh {
    transform: rotate(6deg) scale(1.05);
}

.thuong-hieu-chu {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.thuong-hieu-ten {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.thuong-hieu-phu {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-600);
    letter-spacing: 0.04em;
}

/* Nút mở Menu trên điện thoại (Touch Target >= 44px) */
.nut-menu-mobile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border-subtle);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nut-menu-mobile:hover {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-200);
}

.vach-menu {
    width: 20px;
    height: 2px;
    background-color: var(--color-text-primary);
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Menu điều hướng trên điện thoại */
.dieu-huong {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-lg);
}

.dieu-huong.dang-mo {
    display: block;
    animation: menuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.danh-sach-menu {
    list-style: none;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.lien-ket-menu {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.6rem var(--space-3);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    text-decoration: none;
}

.lien-ket-menu:hover {
    color: var(--color-primary-500);
    background-color: var(--color-primary-50);
}

.lien-ket-menu.kich-hoat {
    color: var(--color-primary-600);
    background-color: var(--color-primary-100);
    font-weight: 700;
}

/* ==========================================================================
   4. BỐ CỤC ĐỌC BÀI VIẾT & HUY HIỆU (Badges - Đạt chuẩn WCAG AA >= 4.5:1)
   ========================================================================== */
.nhan-dang-bai,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.nhan-chu, .badge-chu {
    background-color: #eff6ff;
    color: #1d4ed8; /* Contrast 5.8:1 - Pass WCAG AA */
    border: 1px solid #dbeafe;
}

.nhan-album, .badge-album {
    background-color: #fffbeb;
    color: #b45309; /* Contrast 5.2:1 - Pass WCAG AA */
    border: 1px solid #fef3c7;
}

.nhan-video, .badge-video {
    background-color: #fff1f2;
    color: #be123c; /* Contrast 6.4:1 - Pass WCAG AA */
    border: 1px solid #ffe4e6;
}

.badge-app {
    background-color: #eef2ff;
    color: #4338ca; /* Contrast 7.1:1 - Pass WCAG AA */
    border: 1px solid #e0e7ff;
}

.badge-game {
    background-color: #f0fdf4;
    color: #15803d; /* Contrast 5.0:1 - Pass WCAG AA */
    border: 1px solid #dcfce7;
}

.badge-nhac {
    background-color: #fdf2f8;
    color: #9d174d; /* Contrast 7.3:1 - Pass WCAG AA */
    border: 1px solid #fce7f3;
}

.tieu-de-bai-viet {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

.thong-tin-phu-bai {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-caption);
    color: var(--color-text-secondary);
}

.tom-tat-dau-bai {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-top: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background-color: var(--color-bg-subtle);
    border-left: 4px solid var(--color-primary-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Ảnh đại diện đầu bài */
.anh-bia-bai-viet {
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: var(--color-bg-subtle);
}

.anh-bia-bai-viet img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nội dung văn bản thân bài (Định dạng chữ chuẩn đọc sách) */
.noi-dung-bai-viet {
    font-size: var(--text-body);
    line-height: 1.75;
    color: var(--color-text-primary);
    word-break: break-word;
}

.noi-dung-bai-viet p {
    margin-bottom: 1.4rem;
}

.noi-dung-bai-viet h2 {
    font-size: var(--text-h2);
    font-weight: 800;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
    line-height: 1.35;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary-100);
    letter-spacing: -0.02em;
}

.noi-dung-bai-viet h3 {
    font-size: var(--text-h3);
    font-weight: 700;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
}

.noi-dung-bai-viet blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-6);
    background-color: var(--color-primary-50);
    border-left: 4px solid var(--color-primary-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: #9a3412;
}

.noi-dung-bai-viet blockquote p:last-child {
    margin-bottom: 0;
}

.noi-dung-bai-viet ul,
.noi-dung-bai-viet ol {
    margin-bottom: 1.4rem;
    padding-left: 1.5rem;
}

.noi-dung-bai-viet li {
    margin-bottom: 0.5rem;
}

.noi-dung-bai-viet img {
    border-radius: var(--radius-md);
    margin: var(--space-6) auto;
    box-shadow: var(--shadow-sm);
}

.noi-dung-bai-viet figure {
    margin: var(--space-6) 0;
    text-align: center;
}

.noi-dung-bai-viet figcaption {
    font-size: var(--text-caption);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    font-style: italic;
}

.noi-dung-bai-viet code {
    font-family: var(--font-mono);
    background-color: var(--color-bg-subtle);
    padding: 0.2em 0.45em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--color-accent-600);
    border: 1px solid var(--color-border-subtle);
}

.noi-dung-bai-viet pre {
    background-color: #0f172a;
    color: #f8fafc;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

.noi-dung-bai-viet pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border: none;
}

/* Khung bọc bảng cuộn ngang mượt mà cho Mobile */
.bang-cuon-ngang {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-6) 0;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

.noi-dung-bai-viet table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--text-caption);
    min-width: 480px;
}

.noi-dung-bai-viet th {
    background-color: var(--color-bg-subtle);
    color: var(--color-text-primary);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-border-subtle);
}

.noi-dung-bai-viet td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-secondary);
}

.noi-dung-bai-viet tr:last-child td {
    border-bottom: none;
}

.noi-dung-bai-viet tr:hover td {
    background-color: var(--color-primary-50);
}

/* ==========================================================================
   5. ĐỊNH DẠNG RIÊNG: DẠNG ALBUM ẢNH & VIDEO
   ========================================================================== */
/* Lưới Album Ảnh */
.khung-album-anh {
    margin: 1.5rem 0;
}

.luoi-album {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.muc-album {
    position: relative;
    border-radius: var(--bo-goc-nho);
    overflow: hidden;
    background-color: var(--mau-bg-nhe);
    cursor: pointer;
    box-shadow: var(--do-bong);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.muc-album:hover {
    transform: translateY(-2px);
    box-shadow: var(--do-bong-noi);
}

.muc-album img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.muc-album:hover img {
    transform: scale(1.04);
}

.chu-thich-anh-nho {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    color: var(--mau-chu-phu);
    background-color: var(--mau-the);
    border-top: 1px solid var(--mau-vien);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Khung Video YouTube Responsive */
.khung-video-chinh {
    margin-bottom: 1.5rem;
}

.khung-video-responsive {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--bo-goc);
    overflow: hidden;
    background-color: #000;
    box-shadow: var(--do-bong-noi);
}

.khung-video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.mo-ta-video {
    margin-top: 1.5rem;
    white-space: pre-line;
}

/* ==========================================================================
   6. KHỐI BÀI VIẾT KHÁC & Ô QUẢNG CÁO
   ========================================================================== */
.khoi-bai-khac {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--mau-vien);
}

.tieu-de-khoi {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--mau-chu-chinh);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.luoi-bai-khac {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.the-bai-nho {
    display: flex;
    gap: 1rem;
    background-color: var(--mau-the);
    padding: 0.85rem;
    border-radius: var(--bo-goc-nho);
    border: 1px solid var(--mau-vien);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.the-bai-nho:hover {
    transform: translateY(-2px);
    border-color: var(--mau-chinh);
}

.the-bai-nho-anh {
    width: 90px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.the-bai-nho-anh img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.the-bai-nho-noi-dung {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.the-bai-nho-tieu-de {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--mau-chu-chinh);
    margin-bottom: 0.35rem;
}

.the-bai-nho-tieu-de:hover {
    color: var(--mau-chinh);
}

.the-bai-nho-ngay {
    font-size: 0.8rem;
    color: var(--mau-chu-nhat);
}

/* Ô quảng cáo: Khi rỗng, hoàn toàn ẩn và không chiếm diện tích */
.o-quang-cao {
    margin: 2rem auto;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

.o-quang-cao:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   7. TRANG CHỦ & CÁC KHỐI DANH SÁCH BÀI (Hero Banner & Card Systems)
   ========================================================================== */
.khoi-gioi-thieu-trang-chu {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #eef2ff 100%);
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-subtle);
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.anh-dai-dien-hop {
    flex-shrink: 0;
    position: relative;
}

.anh-dai-dien-chu-web {
    width: 104px;
    height: 104px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--color-primary-500);
    box-shadow: var(--shadow-md);
}

.badge-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary-600);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-2);
}

.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary-500);
    animation: pulseDot 1.5s infinite alternate;
}

@keyframes pulseDot {
    from { opacity: 0.5; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1.15); }
}

.loi-chao-tieu-de {
    font-size: var(--text-display);
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

.diem-nhan-ten-gau {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loi-chao-mo-ta {
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    line-height: 1.65;
    max-width: 620px;
    margin: 0 auto;
}

.diem-nhan-noi-bat {
    color: var(--color-primary-600);
    font-weight: 700;
}

.nhom-nut-hero {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-4);
    justify-content: center;
}

/* Danh sách thẻ bài viết trang chủ */
.luoi-bai-viet-trang-chu {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.the-bai-viet-chinh {
    background-color: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.the-bai-viet-chinh:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-border-hover);
}

.the-bai-viet-anh-bia {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--color-bg-subtle);
    position: relative;
    display: block;
}

.the-bai-viet-anh-bia img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.the-bai-viet-chinh:hover .the-bai-viet-anh-bia img {
    transform: scale(1.04);
}

.the-bai-viet-than {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.the-bai-viet-tieu-de {
    font-size: var(--text-h3);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: var(--space-2);
}

.the-bai-viet-tieu-de a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.the-bai-viet-tieu-de a:hover {
    color: var(--color-primary-500);
}

.the-bai-viet-tom-tat {
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex: 1;
}

.the-bai-viet-chan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-bg-subtle);
    font-size: var(--text-caption);
    color: var(--color-text-muted);
}

/* ==========================================================================
   8. HỆ THỐNG NÚT BẤM (Button Primitives) & THẺ TRANG TĨNH
   ========================================================================== */
.btn,
.nut-chinh,
.nut-mo-san-pham {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-6);
    font-size: var(--text-body);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    user-select: none;
    white-space: nowrap;
}

/* Nút chính (Primary - Gấu Tangerine) */
.btn-primary,
.nut-chinh {
    background-color: var(--color-primary-500);
    color: #ffffff !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.nut-chinh:hover {
    background-color: var(--color-primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-primary);
}

.btn-primary:active,
.nut-chinh:active {
    background-color: var(--color-primary-700);
    transform: translateY(0);
}

/* Nút phụ công nghệ (Accent - Stripe Indigo) */
.btn-accent,
.nut-mo-san-pham {
    background-color: var(--color-accent-500);
    color: #ffffff !important;
    box-shadow: var(--shadow-sm);
}

.btn-accent:hover,
.nut-mo-san-pham:hover {
    background-color: var(--color-accent-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-accent);
}

.btn-accent:active,
.nut-mo-san-pham:active {
    background-color: var(--color-accent-700);
    transform: translateY(0);
}

/* Nút viền / Nút thứ cấp (Secondary Outline) */
.btn-secondary,
.btn-outline {
    background-color: var(--color-bg-surface);
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover,
.btn-outline:hover {
    background-color: var(--color-bg-subtle);
    border-color: var(--color-border-hover);
    color: var(--color-primary-600);
    transform: translateY(-1px);
}

.btn-secondary:active,
.btn-outline:active {
    background-color: var(--color-border-subtle);
    transform: translateY(0);
}

/* Nút cảnh báo / Xóa (Danger) */
.btn-danger {
    background-color: #ef4444;
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* Kích thước Nút */
.btn-sm {
    min-height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-caption);
    border-radius: var(--radius-sm);
}

.btn-lg {
    min-height: 48px;
    padding: 0 var(--space-8);
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

/* Thẻ Card Trang Tĩnh & Khung 404 */
.card,
.the-trang-tinh {
    background-color: var(--color-bg-surface);
    padding: var(--space-6) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-subtle);
}

.khung-404 {
    text-align: center;
    padding: var(--space-12) var(--space-4);
}

.so-404 {
    font-size: clamp(3.5rem, 8vw, 5rem);
    font-weight: 800;
    color: var(--color-primary-500);
    line-height: 1;
    margin-bottom: var(--space-4);
    letter-spacing: -0.04em;
}

.tieu-de-404 {
    font-size: var(--text-h1);
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.loi-nhan-404 {
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto var(--space-8) auto;
    line-height: 1.6;
}

/* ==========================================================================
   9. CHÂN TRANG (Footer - Đạt chuẩn WCAG AA Contrast >= 6.2:1 & Touch Target >= 44px)
   ========================================================================== */
.chan-trang {
    background-color: var(--color-text-primary);
    color: #cbd5e1;
    padding-top: var(--space-12);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.khung-chan-trang {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-bottom: var(--space-8);
}

.chan-trang-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.chan-trang-logo img {
    border-radius: var(--radius-full);
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.chan-trang-ten {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.chan-trang-mo-ta {
    font-size: 0.9375rem;
    color: #94a3b8;
    line-height: 1.65;
}

.chan-trang-tieu-de-nho {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.danh-sach-mxh,
.danh-sach-phu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.lien-ket-mxh {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: #cbd5e1;
    font-size: 0.9375rem;
    min-height: 44px;
    padding: 0 var(--space-1);
    transition: color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}

.lien-ket-mxh:hover {
    color: var(--color-primary-500);
    transform: translateX(3px);
}

.danh-sach-phu a {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9375rem;
    min-height: 44px;
    padding: 0 var(--space-1);
    transition: color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}

.danh-sach-phu a:hover {
    color: #ffffff;
    transform: translateX(3px);
}

.chan-trang-ban-quyen {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-4) 0;
    text-align: center;
    font-size: var(--text-caption);
    color: #94a3b8; /* Contrast 6.2:1 on #0f172a - Pass WCAG AA */
}

/* ==========================================================================
   10. LIGHTBOX PHÓNG TO ẢNH (Thuần JS & CSS)
   ========================================================================== */
.hop-phong-to {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.hop-phong-to.dang-mo {
    display: flex;
}

.khung-anh-phong-to {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.khung-anh-phong-to img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.chu-thich-phong-to {
    color: #ffffff;
    font-size: 0.95rem;
    margin-top: 0.75rem;
    text-align: center;
    max-width: 600px;
}

.nut-dong-phong-to {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: #ffffff;
    font-size: 2.2rem;
    line-height: 1;
    padding: 0.5rem;
    background: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.nut-dong-phong-to:hover {
    opacity: 1;
}

/* ==========================================================================
   11. PHẢN HỒI MÀN HÌNH LỚN (Tablet & Desktop Breakpoints)
   ========================================================================== */
@media (min-width: 640px) {
    .luoi-album {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .muc-album img {
        height: 180px;
    }

    .the-bai-viet-chi-tiet {
        padding: 2.25rem 2rem;
    }

    .tieu-de-bai-viet {
        font-size: 1.85rem;
    }

    .the-trang-tinh {
        padding: 2.5rem 2rem;
    }

    .khoi-gioi-thieu-trang-chu {
        flex-direction: row;
        text-align: left;
        padding: var(--space-8);
        gap: var(--space-8);
    }

    .anh-dai-dien-chu-web {
        width: 104px;
        height: 104px;
        flex-shrink: 0;
    }

    .nhom-nut-hero {
        justify-content: flex-start;
    }

    .khung-chan-trang {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .nut-menu-mobile {
        display: none;
    }

    .dieu-huong {
        display: block;
        position: static;
        width: auto;
        background-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-bottom: none;
    }

    .danh-sach-menu {
        flex-direction: row;
        padding: 0;
        gap: var(--space-1);
    }

    .lien-ket-menu {
        min-height: 38px;
        padding: 0.45rem 0.85rem;
        font-size: 0.9375rem;
        font-weight: 500;
    }
}

@media (min-width: 860px) {
    .the-bai-viet-chinh {
        flex-direction: row;
    }

    .the-bai-viet-anh-bia {
        width: 280px;
        height: auto;
        flex-shrink: 0;
    }

    .tieu-de-bai-viet {
        font-size: 2.1rem;
    }
}

/* ==========================================================================
   12. ĐỊNH DẠNG GIAI ĐOẠN 3: LAB, GAME, NHẠC, WIDGET & PHÂN TRANG
   ========================================================================== */

/* Tiêu đề & Dòng phụ giải thích tên */
.dau-trang-chuyen-muc {
    text-align: center;
    padding: 1.5rem 0 2rem 0;
}

.bieu-tuong-chuyen-muc {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.tieu-de-chuyen-muc {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--mau-chinh-hover);
    margin-bottom: 0.5rem;
}

.mo-ta-chuyen-muc {
    font-size: 1.05rem;
    color: var(--mau-chu-phu);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Lưới hiển thị sản phẩm (Lab & Game) */
.luoi-san-pham {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.the-san-pham {
    background-color: var(--mau-the);
    border-radius: var(--bo-goc);
    border: 1px solid var(--mau-vien);
    box-shadow: var(--do-bong);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

/* ==========================================================================
   12. TRANG DANH SÁCH ỨNG DỤNG & TRÒ CHƠI (lab.php & game.php)
   ========================================================================== */
.luoi-san-pham {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.the-san-pham {
    background-color: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.the-san-pham:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-border-hover);
}

.the-san-pham-anh-hop {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: var(--color-bg-subtle);
    display: block;
}

.the-san-pham-anh-hop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.the-san-pham:hover .the-san-pham-anh-hop img {
    transform: scale(1.04);
}

/* Nhãn Mới (đăng trong vòng 14 ngày - Contrast 4.6:1 WCAG AA) */
.nhan-moi {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ef4444, #ea580c);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    letter-spacing: 0.02em;
    z-index: 2;
}

.nhan-moi-video {
    top: 10px;
    right: 10px;
}

.the-san-pham-than {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.the-san-pham-tieu-de {
    font-size: var(--text-h3);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: var(--space-2);
}

.the-san-pham-tieu-de a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.the-san-pham-tieu-de a:hover {
    color: var(--color-primary-500);
}

.the-san-pham-mo-ta {
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.the-san-pham-chan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-bg-subtle);
    gap: var(--space-2);
    margin-top: auto;
}

.the-san-pham-thong-tin {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-caption);
    color: var(--color-text-muted);
}

.the-san-pham-phien-ban {
    font-family: var(--font-mono);
    font-size: var(--text-micro);
    font-weight: 600;
    color: var(--color-accent-600);
    background-color: var(--color-accent-50);
    border: 1px solid var(--color-accent-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.the-san-pham-dung-luong {
    font-size: var(--text-micro);
    color: var(--color-text-muted);
}

/* ==========================================================================
   13. YOUTUBE FACADE (Trang Gấu Yêu Nhạc & Widget Nhạc)
   ========================================================================== */
.luoi-video-nhac {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.the-video-nhac {
    background-color: var(--mau-the);
    border-radius: var(--bo-goc);
    border: 1px solid var(--mau-vien);
    box-shadow: var(--do-bong);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.the-video-nhac:hover {
    transform: translateY(-2px);
    box-shadow: var(--do-bong-noi);
}

.khung-video-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-facade-anh {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.khung-video-facade:hover .video-facade-anh {
    opacity: 0.92;
    transform: scale(1.03);
}

.nut-phat-facade {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.khung-video-facade:hover .nut-phat-facade {
    transform: translate(-50%, -50%) scale(1.12);
}

.khung-video-facade iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.the-nhac-than {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.the-nhac-tieu-de {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    color: var(--mau-chu-chinh);
}

.the-nhac-mo-ta {
    font-size: 0.95rem;
    color: var(--mau-chu-phu);
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
}

.the-nhac-chan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mau-vien);
    font-size: 0.85rem;
    color: var(--mau-chu-nhat);
}

.lien-ket-youtube-ngoai {
    color: var(--mau-chinh);
    font-weight: 600;
    font-size: 0.85rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.lien-ket-youtube-ngoai:hover {
    color: var(--mau-chinh-hover);
    text-decoration: underline;
}

/* ==========================================================================
   14. WIDGET TRANG CHỦ (Việc 25 - Đồng bộ hệ thống Tokens)
   ========================================================================== */
.khoi-widget-trang-chu {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-subtle);
}

.dau-khoi-widget {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.dau-khoi-widget .tieu-de-khoi {
    margin-bottom: 0;
    font-size: var(--text-h2);
    font-weight: 700;
}

.lien-ket-xem-tat-ca {
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--color-primary-500);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 var(--space-2);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.lien-ket-xem-tat-ca:hover {
    color: var(--color-primary-600);
    transform: translateX(3px);
}

.luoi-widget-san-pham,
.luoi-widget-nhac {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

.the-san-pham-widget .the-san-pham-anh-hop {
    height: 160px;
}

.the-nhac-tieu-de-widget {
    font-size: 1rem;
    font-weight: 600;
}

.the-nhac-mo-ta-widget {
    font-size: var(--text-caption);
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* ==========================================================================
   15. PHÂN TRANG (Việc 23b)
   ========================================================================== */
.thanh-phan-trang {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.nut-phan-trang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    min-height: 44px;
    min-width: 44px;
    border: 1.5px solid var(--mau-vien);
    border-radius: var(--bo-goc-nho);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mau-chu-chinh);
    background-color: var(--mau-the);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nut-phan-trang:hover:not(.vo-hieu) {
    border-color: var(--mau-chinh);
    color: var(--mau-chinh-hover);
    background-color: #fef3c7;
}

.nut-phan-trang.vo-hieu {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--mau-chu-nhat);
}

.danh-sach-so-trang {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.so-trang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.5rem;
    border: 1.5px solid var(--mau-vien);
    border-radius: var(--bo-goc-nho);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--mau-chu-chinh);
    background-color: var(--mau-the);
    transition: all 0.2s ease;
    text-decoration: none;
}

.so-trang:hover:not(.kich-hoat) {
    border-color: var(--mau-chinh);
    color: var(--mau-chinh-hover);
    background-color: #fef3c7;
}

.so-trang.kich-hoat {
    background-color: var(--mau-chinh);
    color: #ffffff !important;
    border-color: var(--mau-chinh);
    font-weight: 700;
}

/* ==========================================================================
   16. PHẢN HỒI MÀN HÌNH TABLET & DESKTOP CHO GIAI ĐOẠN 3
   ========================================================================== */
@media (min-width: 640px) {
    .luoi-san-pham {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .luoi-video-nhac {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .luoi-widget-san-pham,
    .luoi-widget-nhac {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 920px) {
    .luoi-san-pham {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .luoi-video-nhac {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .luoi-widget-san-pham,
    .luoi-widget-nhac {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   17. GIAO DIỆN YOUTUBE PLAYLIST HIỆN ĐẠI (Trang Nhạc & Widget Nhạc)
   ========================================================================== */
.khung-youtube-playlist {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
}

@media (min-width: 880px) {
    .khung-youtube-playlist {
        grid-template-columns: 1.8fr 1.2fr;
        gap: var(--space-6);
        padding: var(--space-6);
    }
}

/* Cột video chính */
.cot-chinh-video {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.khung-video-phat-chinh {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.khung-video-phat-chinh iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.thong-tin-video-chinh {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.dau-thong-tin-video {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.tieu-de-video-dang-phat {
    font-size: var(--text-h2);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.35;
    flex: 1;
    margin: 0;
    letter-spacing: -0.02em;
}

.nut-xem-youtube-goc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.85rem;
    background-color: #fee2e2;
    color: #991b1b !important; /* Contrast 6.8:1 - Pass WCAG AA */
    border-radius: var(--radius-sm);
    font-size: var(--text-caption);
    font-weight: 600;
    flex-shrink: 0;
    min-height: 40px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nut-xem-youtube-goc:hover {
    background-color: #fecaca;
    color: #7f1d1d !important;
    transform: translateY(-1px);
}

.phu-video-dang-phat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-caption);
    color: var(--color-text-muted);
}

.nhan-dang-chieu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #fee2e2;
    color: #991b1b; /* Contrast 6.8:1 - Pass WCAG AA */
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-micro);
    font-weight: 700;
}

/* Khối mô tả video đang phát bên dưới */
.khoi-mo-ta-video-chinh {
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-top: var(--space-1);
}

.nhan-mo-ta {
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
    font-size: var(--text-caption);
}

.noi-dung-mo-ta-chinh {
    word-break: break-word;
}

/* Cột danh sách playlist */
.cot-phu-playlist {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-canvas);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dau-danh-sach-playlist {
    padding: var(--space-4) var(--space-6);
    background-color: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border-subtle);
}

.tieu-de-playlist {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.so-luong-playlist {
    background-color: var(--color-primary-500);
    color: #ffffff;
    font-size: var(--text-micro);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.ghi-chu-playlist {
    font-size: var(--text-micro);
    color: var(--color-text-muted);
    margin-top: 4px;
    margin-bottom: 0;
}

.cuon-danh-sach-playlist {
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: var(--space-2);
    gap: var(--space-2);
    scrollbar-width: thin;
}

.muc-playlist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    background-color: var(--color-bg-surface);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 52px;
}

.muc-playlist-item:hover {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-200);
}

.muc-playlist-item.dang-phat-active {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-500);
    box-shadow: var(--shadow-sm);
}

.so-thu-tu-muc {
    font-size: var(--text-caption);
    font-weight: 700;
    color: var(--color-text-muted);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.muc-playlist-item.dang-phat-active .so-thu-tu {
    display: none;
}

.muc-playlist-item.dang-phat-active .bieu-tuong-song-am {
    display: inline-block;
    color: #ef4444;
    font-size: 0.85rem;
    animation: pulsePlay 1s infinite alternate;
}

.bieu-tuong-song-am {
    display: none;
}

@keyframes pulsePlay {
    from { opacity: 0.6; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.15); }
}

.anh-thumbnail-muc {
    position: relative;
    width: 104px;
    height: 58px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background-color: #000000;
}

.anh-thumbnail-muc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nhan-moi-playlist {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

.thong-tin-muc {
    flex: 1;
    min-width: 0;
}

.tieu-de-muc-playlist {
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.35;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.muc-playlist-item.dang-phat-active .tieu-de-muc-playlist {
    color: var(--color-primary-600);
    font-weight: 700;
}

.ngay-muc-playlist {
    font-size: var(--text-micro);
    color: var(--color-text-muted);
}

/* ==========================================================================
   18. HÀNG BÀI VIẾT NỔI BẬT TRANG CHỦ (Stripe-Style Amber Gradient)
   ========================================================================== */
.khoi-bai-viet-noi-bat {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(180deg, #fffbf5 0%, #ffffff 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.luoi-bai-viet-noi-bat {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .luoi-bai-viet-noi-bat {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 920px) {
    .luoi-bai-viet-noi-bat {
        grid-template-columns: repeat(3, 1fr);
    }
}

.the-bai-noi-bat {
    background-color: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid #fed7aa;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.the-bai-noi-bat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-primary-500);
}

.the-bai-noi-bat-anh {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    display: block;
    background-color: var(--color-bg-subtle);
}

.the-bai-noi-bat-anh img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.the-bai-noi-bat:hover .the-bai-noi-bat-anh img {
    transform: scale(1.04);
}

.nhan-noi-bat-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
    color: #ffffff; /* Contrast 5.2:1 - Pass WCAG AA */
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.4);
    letter-spacing: 0.5px;
}

.the-bai-noi-bat-than {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nhan-chu-de-nho {
    display: inline-block;
    font-size: var(--text-micro);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.the-bai-noi-bat-tieu-de {
    font-size: var(--text-h3);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: var(--space-2);
}

.the-bai-noi-bat-tieu-de a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.the-bai-noi-bat-tieu-de a:hover {
    color: var(--color-primary-500);
}

.the-bai-noi-bat-tom-tat {
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.the-bai-noi-bat-chan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mau-vien);
    font-size: 0.85rem;
    color: var(--mau-chu-nhat);
}

/* ==========================================================================
   19. THANH LỌC CHỦ ĐỀ TRANG DANH SÁCH BÀI VIẾT (Stripe-Style Pill Tabs)
   ========================================================================== */
.thanh-loc-chu-de {
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.danh-sach-tab-chu-de {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: 4px 2px var(--space-2) 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.danh-sach-tab-chu-de::-webkit-scrollbar {
    display: none;
}

.tab-chu-de {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 40px;
    box-shadow: var(--shadow-xs);
}

.tab-chu-de:hover {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-200);
    color: var(--color-primary-600);
    transform: translateY(-1px);
}

.tab-chu-de.kich-hoat {
    background-color: var(--color-primary-500);
    border-color: var(--color-primary-500);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-1px);
}

.danh-sach-tab-dang-bai {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-caption);
    flex-wrap: wrap;
}

.nhan-loc-dang-bai {
    font-weight: 700;
    color: var(--color-text-secondary);
    font-size: var(--text-micro);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nut-dang-bai {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    background-color: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: none;
    border: 1px solid var(--color-border-subtle);
    min-height: 32px;
    transition: all 0.15s ease;
}

.nut-dang-bai:hover {
    background-color: var(--color-accent-50);
    border-color: var(--color-accent-100);
    color: var(--color-accent-600);
}

.nut-dang-bai.kich-hoat {
    background-color: var(--color-accent-500);
    border-color: var(--color-accent-500);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: var(--shadow-glow-accent);
}

/* ==========================================================================
   20. BẢNG BIỂU & ĐỊNH DẠNG NỘI DUNG BÀI VIẾT (WORD CONTENT)
   ========================================================================== */
.noi-dung-bai-viet table {
}

/* ==============================================================================
   26. CHUYÊN MỤC TRUYỆN TRANH & TRÌNH ĐỌC STORYBOOK APPS 3D (GEMINI AI)
   ========================================================================== */

/* 26.1. Kệ trưng bày danh sách truyện tranh & Widget */
.luoi-truyen-tranh, .luoi-widget-truyen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.the-truyen-tranh {
    background-color: var(--mau-the);
    border-radius: var(--bo-goc);
    border: 1px solid var(--mau-vien);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.the-truyen-tranh:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--mau-vien-dam);
}

.the-truyen-anh-hop {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #f1f5f9;
}

.the-truyen-anh-hop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.the-truyen-tranh:hover .the-truyen-anh-hop img {
    transform: scale(1.04);
}

.cac-huy-hieu-truyen {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}

.nhan-so-trang {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
}

.nhan-giong-doc-ai {
    background-color: #ea580c;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.the-truyen-than {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.the-truyen-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.the-truyen-the-loai {
    color: var(--mau-chinh);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.the-truyen-tieu-de {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: var(--mau-chu-chinh);
}

.the-truyen-tieu-de a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.the-truyen-tieu-de a:hover {
    color: var(--mau-chinh);
}

.the-truyen-mo-ta {
    font-size: 0.9rem;
    color: var(--mau-chu-phu);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.the-truyen-chan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--mau-vien);
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--mau-chu-nhat);
}

.the-truyen-thong-tin-phu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 26.2. Header trang chi tiết truyện */
.khung-doc-truyen {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1rem;
}

.dau-bai-truyen {
    margin-bottom: 1.25rem;
}

.the-loai-va-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.nhan-quay-lai {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mau-chu-phu);
    text-decoration: none;
    padding: 4px 8px;
    background-color: var(--mau-bg-nhe);
    border-radius: 4px;
    transition: all 0.2s;
}

.nhan-quay-lai:hover {
    color: var(--mau-chinh);
    background-color: var(--color-primary-100);
}

.nhan-the-loai {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    background-color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.nhan-gemini-ai {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6366f1;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid #c7d2fe;
}

.tieu-de-truyen-chinh {
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--mau-chu-chinh);
    margin-bottom: 0.5rem;
}

.thong-tin-truyen-tac-gia {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--mau-chu-phu);
    margin-bottom: 0.75rem;
}

.mo-ta-dau-truyen {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--mau-chu-phu);
    background-color: var(--mau-the);
    border-left: 4px solid var(--mau-chinh);
    padding: 0.75rem 1.15rem;
    border-radius: 0 var(--bo-goc-nho) var(--bo-goc-nho) 0;
    margin-bottom: 1rem;
}

/* 26.3. Khung Master & Toàn Màn Hình */
.khung-storybook-master {
    position: relative;
    width: 100%;
    margin-bottom: 2.5rem;
}

body.khoa-cuon-body {
    overflow: hidden !important;
    touch-action: none;
}

.khung-storybook-master.toan-man-hinh-active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background-color: #07090e !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.khung-storybook-master.toan-man-hinh-active .thanh-cong-cu-doc {
    border-radius: 0;
    padding: 6px 12px;
    min-height: 40px;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.khung-storybook-master.toan-man-hinh-active .san-khau-sach-3d {
    flex: 1;
    min-height: 0;
    padding: 6px 10px;
}

.khung-storybook-master.toan-man-hinh-active .dieu-huong-chan-trang {
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    min-height: 42px;
}

/* 26.4. Toolbar & Viewer */
.thanh-cong-cu-doc {
    background-color: #0f172a;
    color: #ffffff;
    border-radius: var(--bo-goc) var(--bo-goc) 0 0;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nhom-cong-cu-trai, .nhom-cong-cu-phai {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nut-cong-cu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
    transition: all 0.15s ease;
    user-select: none;
}

.nut-cong-cu:hover, .nut-cong-cu.kich-hoat {
    background-color: var(--mau-chinh);
    color: #ffffff;
    border-color: var(--mau-chinh);
}

.nut-giong-doc.dang-phat {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    animation: pulseDoc 1.5s infinite;
}

@keyframes pulseDoc {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); }
}

.select-toc-do {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 0.825rem;
    min-height: 36px;
    outline: none;
    cursor: pointer;
}

.select-toc-do option {
    background-color: #1e293b;
    color: #ffffff;
}

.nhom-co-chu {
    display: flex;
    gap: 2px;
}

.nut-cong-cu-nho {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 36px;
}

.nut-cong-cu-nho:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.khung-storybook-viewer {
    border-radius: 0 0 var(--bo-goc) var(--bo-goc);
    border: 1px solid var(--mau-vien);
    border-top: none;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.khung-storybook-viewer.nen-sang {
    background-color: #f8fafc;
    color: #0f172a;
}

.khung-storybook-viewer.nen-vang-sepia {
    background-color: #fbf0d9;
    color: #5f4b32;
}

.khung-storybook-viewer.nen-toi {
    background-color: #090d16;
    color: #e2e8f0;
    border-color: #1e293b;
}

.san-khau-sach-3d {
    perspective: 2500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 480px;
    padding: 16px;
    background: radial-gradient(circle at center, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.1) 100%);
    overflow: hidden;
}

/* 26.5. Chế độ 2 trang 3D */
.cuon-sach-3d-2trang {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 14px 1fr;
    width: 100%;
    max-width: 980px;
    height: min(560px, calc(100vh - 180px));
    aspect-ratio: 16 / 10;
    transform-style: preserve-3d;
    box-shadow: 0 25px 60px -15px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.1);
    border-radius: 10px;
    background-color: #ffffff;
}

.trang-sach-2t-trai {
    background-color: #000000;
    border-radius: 10px 0 0 10px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    user-select: none;
    border-right: 1px solid rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trang-sach-2t-trai img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gay-sach-3d {
    width: 14px;
    height: 100%;
    background: linear-gradient(to right, #cbd5e1, #94a3b8 35%, #475569 50%, #94a3b8 65%, #e2e8f0);
    box-shadow: inset 2px 0 5px rgba(0,0,0,0.3), inset -2px 0 5px rgba(0,0,0,0.3);
    z-index: 10;
}

.trang-sach-2t-phai {
    background-color: #faf8f5;
    border-radius: 0 10px 10px 0;
    overflow-y: auto;
    position: relative;
    cursor: pointer;
    user-select: none;
    border-left: 1px solid rgba(0,0,0,0.06);
    box-shadow: inset 14px 0 28px -10px rgba(0,0,0,0.12);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.khung-storybook-viewer.nen-vang-sepia .trang-sach-2t-phai {
    background-color: #f7ebd0;
    color: #4a3b2c;
}

.khung-storybook-viewer.nen-toi .trang-sach-2t-phai {
    background-color: #131824;
    color: #e2e8f0;
    box-shadow: inset 14px 0 28px -10px rgba(0,0,0,0.45);
}

.so-trang-trai-badge {
    position: absolute;
    bottom: 8px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff !important;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 26.6. Tờ lật 3D chân thực */
.to-sach-lat-3d {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    pointer-events: none;
    z-index: 50;
    display: none;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0 10px 10px 0;
}

.mat-truoc-lat, .mat-sau-lat {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-sizing: border-box;
}

.mat-truoc-lat {
    transform: rotateY(0deg) translateZ(1px);
    -webkit-transform: rotateY(0deg) translateZ(1px);
}

.mat-sau-lat {
    transform: rotateY(180deg) translateZ(1px);
    -webkit-transform: rotateY(180deg) translateZ(1px);
}

/* ĐỊNH DẠNG MẶT CHỮ TRÊN TỜ LẬT 3D */
.mat-lat-chu {
    background-color: #faf8f5;
    color: #0f172a;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 14px 0 28px -10px rgba(0,0,0,0.12);
}

.khung-storybook-viewer.nen-vang-sepia .mat-lat-chu {
    background-color: #f7ebd0;
    color: #4a3b2c;
}

.khung-storybook-viewer.nen-toi .mat-lat-chu {
    background-color: #131824;
    color: #e2e8f0;
    box-shadow: inset 14px 0 28px -10px rgba(0,0,0,0.45);
}

/* ĐỊNH DẠNG MẶT TRANH MINH HỌA TRÊN TỜ LẬT 3D */
.mat-lat-anh {
    background-color: #000000;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mat-lat-anh img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Animation Lật Sang Trái (Tiến tới Trang Sau) */
.to-sach-lat-3d.lat-sang-trai-3d {
    display: block;
    animation: animeLatSangTrai 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes animeLatSangTrai {
    0% {
        transform: rotateY(0deg) scale(1);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    50% {
        transform: rotateY(-90deg) scale(1.03);
        box-shadow: -20px 25px 50px rgba(0,0,0,0.35);
    }
    100% {
        transform: rotateY(-180deg) scale(1);
        box-shadow: -5px 5px 15px rgba(0,0,0,0.15);
    }
}

/* Animation Lật Sang Phải (Quay lại Trang Trước) */
.to-sach-lat-3d.lat-sang-phai-3d {
    display: block;
    left: 0;
    right: auto;
    transform-origin: right center;
    border-radius: 10px 0 0 10px;
    animation: animeLatSangPhai 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.to-sach-lat-3d.lat-sang-phai-3d .mat-truoc-lat,
.to-sach-lat-3d.lat-sang-phai-3d .mat-sau-lat {
    border-radius: 10px 0 0 10px;
}

@keyframes animeLatSangPhai {
    0% {
        transform: rotateY(0deg) scale(1);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    50% {
        transform: rotateY(90deg) scale(1.03);
        box-shadow: 20px 25px 50px rgba(0,0,0,0.35);
    }
    100% {
        transform: rotateY(180deg) scale(1);
        box-shadow: 5px 5px 15px rgba(0,0,0,0.15);
    }
}

/* 26.7. Chế độ 1 trang vừa khít 100% */
.san-khau-sach-1trang {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.to-sach-don-1trang {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(520px, calc(100vw - 24px));
    height: 100%;
    max-height: min(680px, calc(100dvh - 120px));
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.khung-anh-1trang {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.khung-anh-1trang img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.khung-chu-1trang {
    flex: 0 0 auto;
    max-height: 38%;
    min-height: 85px;
    overflow-y: auto;
    padding: 12px 16px;
    background: #faf8f5;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.khung-storybook-viewer.nen-vang-sepia .khung-chu-1trang {
    background-color: #f7ebd0;
    color: #4a3b2c;
}

.khung-storybook-viewer.nen-toi .khung-chu-1trang {
    background-color: #131824;
    color: #e2e8f0;
}

.loi-ke-1trang {
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 500;
}

.to-sach-don-1trang.trang-1t-ra-trai {
    transform: translateX(-105%) rotateY(-18deg) scale(0.92);
    opacity: 0;
    box-shadow: -20px 20px 40px rgba(0,0,0,0.4);
}

.to-sach-don-1trang.trang-1t-ra-phai {
    transform: translateX(105%) rotateY(18deg) scale(0.92);
    opacity: 0;
    box-shadow: 20px 20px 40px rgba(0,0,0,0.4);
}

.to-sach-don-1trang.trang-1t-vao {
    animation: animeVao1T 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes animeVao1T {
    0% { transform: scale(0.93); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* NÚT LẬT TRANG NỔI */
.nut-chuyen-trang-noi {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    transition: all 0.2s ease;
    user-select: none;
}

.nut-chuyen-trang-noi:hover:not(:disabled) {
    background-color: var(--mau-chinh);
    transform: translateY(-50%) scale(1.1);
}

.nut-chuyen-trang-noi:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.nut-chuyen-trai { left: 8px; }
.nut-chuyen-phai { right: 8px; }

/* DRAWER THUMBNAILS */
.khung-drawer-thumbnails {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    background-color: rgba(15, 23, 42, 0.95);
    color: #ffffff;
}

.khung-drawer-thumbnails.mo {
    max-height: 160px;
    transition: max-height 0.3s ease-in-out;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nut-dong-drawer {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.dai-anh-thu-nho {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.the-trang-nho {
    position: relative;
    flex-shrink: 0;
    width: 68px;
    height: 48px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    padding: 0;
    transition: all 0.2s ease;
}

.the-trang-nho img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.the-trang-nho.kich-hoat {
    border-color: var(--mau-chinh);
    transform: scale(1.06);
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.6);
}

.the-trang-nho.kich-hoat img {
    opacity: 1;
}

.so-trang-nhan {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

/* THANH TIẾN TRÌNH */
.thanh-tien-trinh-doc-ngoai {
    height: 5px;
    background-color: rgba(0,0,0,0.08);
    width: 100%;
}

.thanh-tien-trinh-doc-trong {
    height: 100%;
    background-color: var(--mau-chinh);
    transition: width 0.3s ease;
}

/* ĐIỀU HƯỚNG CHÂN TRANG */
.dieu-huong-chan-trang {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    gap: 12px;
}

.nut-dieu-huong-lon {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
}

.chi-so-trang-chan {
    font-size: 0.95rem;
    color: inherit;
}

/* WEBTOON SCROLL */
.che-do-cuon-webtoon {
    padding: 20px 0;
    max-width: 720px;
    margin: 0 auto;
}

.the-trang-webtoon {
    margin-bottom: 2.5rem;
    background: inherit;
    border-bottom: 1px dashed rgba(0,0,0,0.15);
    padding-bottom: 2rem;
}

.so-thu-tu-webtoon {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mau-chinh);
    margin-bottom: 8px;
    text-align: center;
}

.khung-anh-webtoon {
    border-radius: var(--bo-goc-nho);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    background-color: #000;
}

.khung-anh-webtoon img {
    width: 100%;
    height: auto;
    display: block;
}

.loi-ke-webtoon {
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: center;
    padding: 0 1rem;
}

.ket-thuc-truyen-webtoon {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--mau-chinh);
    padding: 2rem 0;
    font-size: 1.2rem;
}

/* GỢI Ý TRUYỆN KHÁC & CHIA SẺ */
.khung-chia-se-va-khac {
    margin-top: 2rem;
}

.chia-se-mang-xa-hoi {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding: 1rem;
    background-color: var(--mau-the);
    border-radius: var(--bo-goc);
    border: 1px solid var(--mau-vien);
    font-size: 0.95rem;
    font-weight: 600;
}

.khoi-truyen-khac {
    margin-bottom: 2.5rem;
}

.tieu-de-truyen-khac {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--mau-chu-chinh);
    margin-bottom: 1.25rem;
}

.luoi-truyen-tranh-nho {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.the-truyen-tranh-nho .the-truyen-anh-hop {
    aspect-ratio: 3 / 4;
}

.the-truyen-tranh-nho .the-truyen-than {
    padding: 1rem;
}

.the-truyen-tranh-nho .the-truyen-tieu-de {
    font-size: 1rem;
}

/* RESPONSIVE CHO ĐIỆN THOẠI XOAY NGANG & MÀN HÌNH NHỎ */
@media (orientation: landscape) and (max-height: 540px) {
    .khung-storybook-master.toan-man-hinh-active .thanh-cong-cu-doc {
        padding: 3px 8px;
        min-height: 34px;
    }
    .nut-cong-cu {
        min-height: 28px;
        padding: 2px 6px;
        font-size: 0.725rem;
    }
    .select-toc-do {
        min-height: 28px;
        padding: 2px 4px;
        font-size: 0.725rem;
    }
    .san-khau-sach-3d {
        min-height: 0 !important;
        padding: 4px 6px;
    }
    .cuon-sach-3d-2trang {
        max-height: calc(100dvh - 78px) !important;
        height: 100% !important;
        aspect-ratio: auto;
    }
    .trang-sach-2t-phai, .mat-lat-chu {
        padding: 8px 12px !important;
    }
    .trang-chu-header {
        margin-bottom: 4px;
        padding-bottom: 2px;
    }
    .van-ban-loi-ke-sach {
        font-size: clamp(0.85rem, 2.6vh, 1rem) !important;
        line-height: 1.45;
    }
    .to-sach-don-1trang {
        max-height: calc(100dvh - 78px) !important;
    }
    .khung-storybook-master.toan-man-hinh-active .dieu-huong-chan-trang {
        min-height: 34px;
        padding: 3px 8px;
    }
    .nut-dieu-huong-lon {
        min-height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }
    .nut-chuyen-trang-noi {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* B. Màn hình điện thoại nhỏ (Mobile Portrait <= 640px) */
@media (max-width: 640px) {
    .luoi-truyen-tranh, .luoi-widget-truyen, .luoi-truyen-tranh-nho {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    .the-truyen-than {
        padding: 0.75rem !important;
    }
    .the-truyen-tieu-de {
        font-size: 0.925rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.35rem !important;
    }
    .the-truyen-mo-ta {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
        -webkit-line-clamp: 2 !important;
    }
    .the-truyen-chan {
        padding-top: 0.5rem !important;
    }
    .thanh-cong-cu-doc {
        padding: 6px 8px;
    }
    .txt-btn-fullscreen {
        display: none;
    }
    .san-khau-sach-3d {
        padding: 8px;
        min-height: 380px;
    }
    .nut-chuyen-trai { left: 4px; width: 40px; height: 40px; font-size: 18px; }
    .nut-chuyen-phai { right: 4px; width: 40px; height: 40px; font-size: 18px; }
    .dieu-huong-chan-trang {
        padding: 8px 10px;
    }
    .nut-dieu-huong-lon {
        padding: 0 12px;
        font-size: 13px;
        min-height: 40px;
    }
}




