/* ==========================================================================
   MODULE CSS TOÀN MÀN HÌNH CHUYÊN NGHIỆP: CHÍNH SÁCH, ĐIỀU KHOẢN, GIỚI THIỆU & FAQ
   Tối ưu 100% cho Mọi Thiết Bị (Mobile, Tablet, Desktop)
   Hỗ trợ Nền Tối / Sáng & Song Ngữ VI / EN
   ========================================================================== */

/* 1. MỤC CHÍNH SÁCH ĐƠN TRONG SIDEBAR DRAWER */
.sidebar-policy-item {
    margin: 20px 0 !important;
    list-style: none;
}
.sidebar-policy-item .menu-link-doc {
    color: #ccc !important;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 6px 0;
}
.sidebar-policy-item .menu-link-doc:hover,
.sidebar-policy-item .menu-link-doc:active {
    color: #ff5252 !important;
    padding-left: 8px;
}
.sidebar-policy-item .menu-link-doc i {
    color: #ff5252;
    font-size: 19px;
    width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}
.sidebar-policy-item .menu-link-doc:hover i {
    transform: scale(1.18);
}

/* Fallback tương thích menu dropdown cũ nếu có */
.sidebar-menu .menu-dropdown-item {
    position: relative;
    list-style: none;
    margin: 15px 0 !important;
}
.sidebar-menu .menu-dropdown-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    color: #ccc;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 6px 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-menu .menu-dropdown-btn:hover,
.sidebar-menu .menu-dropdown-btn.open {
    color: #ff5252;
    padding-left: 6px;
}
.sidebar-menu .menu-dropdown-btn .menu-btn-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.sidebar-menu .submenu-caret {
    font-size: 14px;
    color: #888;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s;
    margin-left: auto;
    padding-right: 5px;
}
.sidebar-menu .menu-dropdown-btn.open .submenu-caret {
    transform: rotate(180deg);
    color: #ff5252;
}

.sidebar-submenu {
    list-style: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    margin: 0;
    padding: 0 0 0 15px;
    border-left: 2px solid rgba(255, 82, 82, 0.3);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0 0 12px 12px;
}
.sidebar-submenu.open {
    max-height: 350px;
    opacity: 1;
    margin: 8px 0 12px 10px;
    padding: 8px 0 8px 14px;
}
.sidebar-submenu li {
    margin: 8px 0 !important;
}
.sidebar-submenu li a {
    color: #bbb !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-submenu li a:hover,
.sidebar-submenu li a:active {
    color: #ffffff !important;
    background: rgba(255, 82, 82, 0.2);
    transform: translateX(5px);
}
.sidebar-submenu li a i {
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: #ff7875;
}

/* 2. ĐỊNH NGHĨA BIẾN THEME (NỀN TỐI & NỀN SÁNG HOÀN TOÀN KHÔNG BỊ TRÀN CHỮ) */
#fullscreen-doc-view.doc-theme-dark {
    --doc-bg: #0c0d12;
    --doc-bg-gradient: radial-gradient(circle at 85% 15%, #181a24 0%, #0c0d12 70%);
    --doc-header-bg: #12131b;
    --doc-card-bg: rgba(22, 24, 34, 0.95);
    --doc-card-hover: rgba(30, 33, 48, 1);
    --doc-card-border: rgba(255, 255, 255, 0.1);
    --doc-text: #e2e8f0;
    --doc-text-muted: #94a3b8;
    --doc-heading: #ffffff;
    --doc-accent: #ff4d4f;
    --doc-accent-hover: #ff7875;
    --doc-tab-bg: rgba(255, 255, 255, 0.08);
    --doc-tab-active-bg: #ff4d4f;
    --doc-tab-active-text: #ffffff;
    --doc-input-bg: #161823;
    --doc-input-border: rgba(255, 255, 255, 0.15);
    --doc-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --doc-callout-info-bg: rgba(24, 144, 255, 0.12);
    --doc-callout-info-border: rgba(24, 144, 255, 0.35);
    --doc-callout-warn-bg: rgba(250, 173, 20, 0.12);
    --doc-callout-warn-border: rgba(250, 173, 20, 0.4);
    --doc-callout-danger-bg: rgba(255, 77, 79, 0.14);
    --doc-callout-danger-border: rgba(255, 77, 79, 0.45);
}

#fullscreen-doc-view.doc-theme-light {
    --doc-bg: #f8fafc;
    --doc-bg-gradient: radial-gradient(circle at 85% 15%, #edf2f7 0%, #f8fafc 70%);
    --doc-header-bg: #ffffff;
    --doc-card-bg: #ffffff;
    --doc-card-hover: #f1f5f9;
    --doc-card-border: #cbd5e1;
    --doc-text: #334155;
    --doc-text-muted: #64748b;
    --doc-heading: #0f172a;
    --doc-accent: #e50914;
    --doc-accent-hover: #b91c1c;
    --doc-tab-bg: #e2e8f0;
    --doc-tab-active-bg: #e50914;
    --doc-tab-active-text: #ffffff;
    --doc-input-bg: #ffffff;
    --doc-input-border: #94a3b8;
    --doc-shadow: 0 6px 20px rgba(100, 116, 139, 0.12);
    --doc-callout-info-bg: #eff6ff;
    --doc-callout-info-border: #60a5fa;
    --doc-callout-warn-bg: #fffbeb;
    --doc-callout-warn-border: #f59e0b;
    --doc-callout-danger-bg: #fef2f2;
    --doc-callout-danger-border: #ef4444;
}

/* 3. KHUNG TOÀN MÀN HÌNH CHÍNH (FULLSCREEN CONTAINER) */
#fullscreen-doc-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1000000;
    display: none;
    flex-direction: column;
    background: var(--doc-bg);
    background-image: var(--doc-bg-gradient);
    color: var(--doc-text);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
#fullscreen-doc-view.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}
#fullscreen-doc-view.closing {
    opacity: 0 !important;
    transform: scale(0.98) !important;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 1, 1), transform 0.22s cubic-bezier(0.4, 0, 1, 1) !important;
}

/* THANH PROGRESS LOADING TRÊN CÙNG (YOUTUBE / GITHUB STYLE) */
.doc-top-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #ff4d4f 0%, #f5c518 50%, #00f2fe 100%);
    box-shadow: 0 0 10px rgba(255, 77, 79, 0.8), 0 0 5px rgba(245, 197, 24, 0.6);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}
.doc-top-progress.active {
    opacity: 1;
}

/* 4. THANH HEADER CỐ ĐỊNH (SOLID TOP BAR KHÔNG BỊ TRÀN CHỮ) */
.doc-top-bar {
    flex-shrink: 0;
    background: var(--doc-header-bg);
    border-bottom: 1px solid var(--doc-card-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 16px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
}

.doc-top-bar-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    min-width: 0;
}

.doc-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.doc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--doc-tab-bg);
    color: var(--doc-text);
    border: 1px solid var(--doc-card-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.doc-back-btn:hover,
.doc-back-btn:active {
    background: var(--doc-accent);
    color: #fff;
    border-color: var(--doc-accent);
}

.doc-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--doc-heading);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-brand-title .badge {
    font-size: 10px;
    background: linear-gradient(135deg, #f5c518, #ff8c00);
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* CÁC NÚT ĐIỀU KHIỂN (THEME & NGÔN NGỮ) */
.doc-top-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.doc-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: var(--doc-tab-bg);
    color: var(--doc-text);
    border: 1px solid var(--doc-card-border);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.doc-control-btn:hover,
.doc-control-btn:active {
    background: var(--doc-card-hover);
    border-color: var(--doc-accent);
}

/* NÚT CHUYỂN NGÔN NGỮ NỔI BẬT (LUÔN HIỂN THỊ CỜ & MÃ VI/EN RÕ NÉT) */
.doc-lang-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.doc-theme-light .doc-lang-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
.doc-lang-btn:hover,
.doc-lang-btn:active {
    background: var(--doc-accent);
    border-color: var(--doc-accent);
    color: #ffffff;
    transform: scale(1.04);
}
.doc-lang-flag {
    font-size: 15px;
    line-height: 1;
}
.doc-lang-code {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.doc-close-icon-btn {
    display: none !important; /* Đã có nút Quay lại trên header, loại bỏ hoàn toàn nút X để tránh chật chội */
}

/* 4 TAB SWITCHER (4 CỘT CÂN ĐỐI 100% CHIỀU RỘNG, KHÔNG BỊ TRÀN HAY MẤT TAB) */
.doc-nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: var(--doc-tab-bg);
    padding: 4px;
    border-radius: 25px;
    border: 1px solid var(--doc-card-border);
    width: 100%;
    box-sizing: border-box;
}
.doc-tab-btn {
    padding: 8px 4px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: var(--doc-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.doc-tab-btn:hover {
    color: var(--doc-heading);
}
.doc-tab-btn.active {
    background: var(--doc-tab-active-bg);
    color: var(--doc-tab-active-text);
    box-shadow: 0 3px 10px rgba(229, 9, 20, 0.35);
}

/* 5. VÙNG CUỘN NỘI DUNG (SCROLL VIEWPORT) */
.doc-scroll-viewport {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 16px 80px 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
}
.doc-container {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* HIỆU ỨNG LOADING TOÀN MÀN HÌNH & CHUYỂN MỤC CHUYÊN NGHIỆP */
.doc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: rgba(12, 13, 18, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
}
.doc-theme-light .doc-loading-overlay {
    background: rgba(248, 250, 252, 0.82);
}
.doc-loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.doc-spinner-box {
    position: relative;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.doc-spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(255, 77, 79, 0.15);
    border-top-color: var(--doc-accent);
    border-right-color: #f5c518;
    animation: docSpinnerRotate 0.75s linear infinite;
}
.doc-spinner-center-icon {
    font-size: 20px;
    color: var(--doc-accent);
    animation: docSpinnerPulse 1.2s ease-in-out infinite alternate;
}
.doc-loading-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--doc-heading);
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
@keyframes docSpinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes docSpinnerPulse {
    0% { transform: scale(0.88); opacity: 0.75; }
    100% { transform: scale(1.12); opacity: 1; filter: drop-shadow(0 0 6px var(--doc-accent)); }
}

/* 6. TAB PANES ENTRY ANIMATION */
.doc-tab-pane {
    display: none;
}
.doc-tab-pane.active {
    display: block;
    animation: docPaneEntry 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes docPaneEntry {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* TIÊU ĐỀ TRANG TRONG NỘI DUNG (HERO BANNER CHUYÊN NGHIỆP & ĐỘ TƯƠNG PHẢN CAO) */
.doc-page-header {
    text-align: center;
    margin-bottom: 22px;
    padding: 24px 20px 22px 20px;
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--doc-shadow);
}
.doc-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff4d4f 0%, #f5c518 50%, #ff4d4f 100%);
}
.doc-header-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 77, 79, 0.12);
    color: var(--doc-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 77, 79, 0.3);
}
.doc-theme-light .doc-header-icon-badge {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}
.doc-page-header h1 {
    font-size: 23px;
    font-weight: 800;
    color: var(--doc-heading);
    margin: 0 0 10px 0;
    letter-spacing: 0.3px;
    line-height: 1.4;
    word-break: break-word;
    text-transform: uppercase;
}
.doc-header-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: var(--doc-text) !important;
    margin: 0 auto;
    max-width: 720px;
    line-height: 1.6;
}
.doc-page-header .doc-badge-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 13px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 700;
}
.doc-theme-light .doc-page-header .doc-badge-date {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

/* THANH MỤC LỤC ĐIỀU HƯỚNG NHANH (QUICK TOC CHIPS) */
.doc-toc-wrapper {
    margin-bottom: 22px;
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.doc-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--doc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.doc-toc-header i {
    color: var(--doc-accent);
}
.doc-toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.doc-toc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--doc-tab-bg);
    border: 1px solid var(--doc-card-border);
    color: var(--doc-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.doc-toc-chip:hover,
.doc-toc-chip:active {
    background: var(--doc-accent);
    color: #ffffff;
    border-color: var(--doc-accent);
    transform: translateY(-2px);
}
.doc-toc-chip .badge-num {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

/* HIỆU ỨNG NHẤP NHÁY NỔI BẬT KHI NHẢY TỚI MỤC */
.doc-highlight-target {
    animation: docTargetPulse 1.8s ease;
}
@keyframes docTargetPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.7);
        border-color: #ff4d4f;
    }
    50% {
        box-shadow: 0 0 22px 4px rgba(255, 77, 79, 0.5);
        border-color: #ff4d4f;
    }
    100% {
        box-shadow: var(--doc-shadow);
        border-color: var(--doc-card-border);
    }
}

/* 7. PHẦN FAQ: SEARCH BAR & CATEGORIES */
.faq-search-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto 20px auto;
    width: 100%;
    box-sizing: border-box;
}
.faq-search-wrapper i.search-ico {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--doc-text-muted);
    font-size: 16px;
}
.faq-search-input {
    width: 100%;
    padding: 14px 44px 14px 46px;
    border-radius: 30px;
    background: var(--doc-input-bg);
    border: 2px solid var(--doc-input-border);
    color: var(--doc-heading);
    font-size: 15px;
    box-shadow: var(--doc-shadow);
    transition: all 0.25s ease;
    outline: none;
    box-sizing: border-box;
}
.faq-search-input:focus {
    border-color: var(--doc-accent);
}
.faq-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--doc-text-muted);
    font-size: 17px;
    cursor: pointer;
    display: none;
    padding: 4px;
}

/* CATEGORY CHIPS (VUỐT NGANG MƯỢT TRÊN MOBILE) */
.faq-cat-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px 2px 8px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.faq-cat-filter::-webkit-scrollbar {
    display: none;
}
.faq-cat-chip {
    padding: 7px 14px;
    border-radius: 18px;
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    color: var(--doc-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.faq-cat-chip:hover {
    color: var(--doc-heading);
    border-color: var(--doc-accent);
}
.faq-cat-chip.active {
    background: var(--doc-accent);
    color: #fff;
    border-color: var(--doc-accent);
}

/* FAQ ACCORDION LIST */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-item {
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.faq-item.open {
    border-color: var(--doc-accent);
}
.faq-question {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 12px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.faq-q-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--doc-heading);
    line-height: 1.45;
    flex: 1;
}
.faq-chevron {
    font-size: 14px;
    color: var(--doc-text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
    flex-shrink: 0;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: var(--doc-accent);
}
.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    padding: 0 18px;
}
.faq-item.open .faq-answer {
    max-height: 3000px;
    opacity: 1;
    padding: 0 18px 18px 18px;
}
.faq-answer-inner {
    font-size: 14px;
    line-height: 1.7;
    color: var(--doc-text);
    border-top: 1px solid var(--doc-card-border);
    padding-top: 14px;
}
.faq-answer-inner strong {
    color: var(--doc-heading);
}
.faq-answer-inner a {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 600;
}

/* 8. CARDS VÀ ALERT CALLOUTS (ĐIỀU KHOẢN & CHÍNH SÁCH) */
.doc-section-card {
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 16px;
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: var(--doc-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    scroll-margin-top: 15px;
    position: relative;
}
.doc-section-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--doc-heading);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.45;
}
.doc-section-card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--doc-accent);
    border-radius: 2px;
    flex-shrink: 0;
}
.doc-body-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--doc-text);
}
.doc-body-text strong {
    color: var(--doc-heading);
    font-weight: 700;
}
.doc-body-text ul {
    margin: 12px 0;
    padding-left: 20px;
}
.doc-body-text ul li {
    margin: 10px 0;
    line-height: 1.75;
}
.doc-body-text code {
    background: var(--doc-tab-bg);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
    color: #ff7875;
}

.doc-callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.65;
}
.doc-callout i {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}
.doc-callout.warning {
    background: var(--doc-callout-warn-bg);
    border: 1px solid var(--doc-callout-warn-border);
    color: #d97706;
}
.doc-callout.danger {
    background: var(--doc-callout-danger-bg);
    border: 1px solid var(--doc-callout-danger-border);
    color: #ef4444;
}
.doc-callout.info {
    background: var(--doc-callout-info-bg);
    border: 1px solid var(--doc-callout-info-border);
    color: #2563eb;
}

/* 9. GIỚI THIỆU: HERO, AUTHORS GRID & TECH GRID */
.about-hero-box {
    text-align: center;
    padding: 28px 18px;
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--doc-shadow);
}
.about-hero-box p {
    font-size: 16px;
    line-height: 1.75;
    max-width: 750px;
    margin: 0 auto;
    color: var(--doc-text);
}

.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0 24px 0;
}
.author-card {
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.author-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.author-avatar-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e50914, #ff5252);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}
.author-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--doc-heading);
    margin: 0;
}
.author-card-role {
    font-size: 11px;
    color: #f5c518;
    font-weight: 600;
    text-transform: uppercase;
}
.author-card-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--doc-text-muted);
    margin: 0;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 18px 0 24px 0;
}
.tech-card {
    background: var(--doc-card-bg);
    border: 1px solid var(--doc-card-border);
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
}
.tech-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(229, 9, 20, 0.1);
    color: var(--doc-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 12px auto;
}
.tech-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--doc-heading);
    margin: 0 0 8px 0;
}
.tech-card p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--doc-text-muted);
    margin: 0;
}

/* NÚT CUỘN NHANH LÊN ĐẦU TRANG */
.doc-back-to-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--doc-accent);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}
.doc-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.doc-back-to-top:hover {
    transform: translateY(-3px) scale(1.08);
    background: var(--doc-accent-hover);
}

/* 10. TỐI ƯU ĐẶC BIỆT CHO MÀN HÌNH NHỎ (MOBILE < 500PX) */
@media (max-width: 500px) {
    .doc-top-bar {
        padding: 8px 10px;
        gap: 8px;
    }
    .doc-top-bar-row1 {
        gap: 6px;
    }
    .doc-brand-title {
        font-size: 13px;
        gap: 4px;
    }
    .doc-brand-title .badge {
        display: none; /* Ẩn huy hiệu nhỏ để tránh tràn dòng */
    }
    .doc-control-btn .doc-btn-label {
        display: none; /* Chỉ ẩn chữ của nút Theme khi màn hình quá hẹp */
    }
    .doc-control-btn {
        padding: 6px 9px;
    }
    .doc-lang-btn {
        padding: 6px 10px;
    }
    .doc-lang-btn .doc-lang-code {
        display: inline-block !important; /* Luôn hiển thị VI / EN */
    }
    .doc-lang-btn .doc-lang-flag {
        display: inline-block !important; /* Luôn hiển thị cờ 🇻🇳 / 🇬🇧 */
    }
    .doc-back-btn {
        padding: 6px 10px;
    }
    .doc-back-btn span {
        font-size: 12px;
    }
    .doc-tab-btn {
        font-size: 12px;
        padding: 7px 2px;
        gap: 4px;
    }
    .doc-tab-btn i {
        font-size: 11px;
    }
    .doc-page-header {
        padding: 18px 14px;
        margin-bottom: 18px;
    }
    .doc-page-header h1 {
        font-size: 18px;
    }
    .doc-header-subtitle {
        font-size: 14px;
    }
    .doc-section-card {
        padding: 18px 14px;
    }
    .doc-section-card h2 {
        font-size: 16px;
    }
    .doc-body-text {
        font-size: 14px;
    }
    .doc-toc-wrapper {
        padding: 10px 12px;
    }
    .doc-toc-chip {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 380px) {
    .doc-brand-title span:first-of-type {
        display: none; /* Ẩn chữ CHUNHATPHAM trên màn hình cực nhỏ, chỉ giữ lại icon khiên để tuyệt đối không chật chội */
    }
    .doc-back-btn {
        padding: 5px 8px;
    }
    .doc-top-controls {
        gap: 4px;
    }
    .doc-control-btn {
        padding: 5px 8px;
    }
    .doc-lang-btn {
        padding: 5px 8px;
    }
}
