/* ═══ TAP HO SO - DUAL TRACK READING CANVAS ═══ */

/* 1. SINGLE SOURCE OF TRUTH: FONTS */
@font-face { font-family: 'FD Aeonik Extended'; text-transform: uppercase; src: url('https://fedu.vn/k/fonts/FDAeonikExtended-Bold.woff2') format('woff2'); font-weight: 700; }
@font-face { font-family: 'FD Aeonik'; src: url('https://fedu.vn/k/fonts/FDAeonikMedium.ttf') format('truetype'); font-weight: 600; }
@font-face { font-family: 'Tiempos Text'; src: url('https://fedu.vn/k/fonts/FDTiemposText-Medium.woff2') format('woff2'); font-weight: 500; }

:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --border: #e2e8f0;
}

body {
    margin: 0; padding: 0;
    background: var(--bg-color);
    font-family: 'Tiempos Text', serif;
    color: var(--text-main);
    line-height: 1.7;
    font-size: 17px;
}

/* 2. GATEKEEPER (MÃ PIN SHA-256) */
#gatekeeper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff; z-index: 99999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: 'FD Aeonik', sans-serif;
}
.gk-title { font-size: 24px; margin-bottom: 20px; text-transform: uppercase; }
.gk-input { 
    font-size: 32px; padding: 10px; width: 200px; text-align: center;
    letter-spacing: 10px; border: 2px solid var(--border); border-radius: 8px; outline: none;
}
.gk-input:focus { border-color: var(--accent); }

/* 3. DUAL-TRACK LAYOUT (2 CỘT) */
.layout-wrapper {
    display: flex; max-width: 1300px; margin: 0 auto;
    visibility: hidden; /* Bị ẩn cho đến khi nhập PIN */
    opacity: 0; transition: opacity 0.4s ease;
}
.layout-wrapper.auth-ok { visibility: visible; opacity: 1; }

/* 4. SIDEBAR (CỘT TRÁI - STICKY MỤC LỤC) */
.sidebar {
    width: 320px; padding: 40px 20px; flex-shrink: 0;
    height: 100vh; position: sticky; top: 0; overflow-y: auto;
    border-right: 1px solid var(--border); background: var(--sidebar-bg);
    font-family: 'FD Aeonik', sans-serif;
}
.sidebar-title { 
    font-family: 'FD Aeonik Extended', sans-serif; text-transform: uppercase; font-size: 18px; 
    margin-bottom: 24px; border-bottom: 2px solid var(--text-main); 
    padding-bottom: 12px; text-transform: uppercase; letter-spacing: 0.02em; 
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 12px; }
.toc-h2 a { font-weight: 700; color: var(--text-main); text-decoration: none; font-size: 15px; display: block; }
.toc-h3 a { font-weight: 500; color: var(--text-muted); text-decoration: none; font-size: 14px; padding-left: 12px; display: block; transition: color 0.2s; }
.toc-h3 a:hover, .toc-h3 a.active { color: var(--accent); }

/* 5. CANVAS (CỘT PHẢI - ĐỌC CHUYÊN SÂU) */
.canvas {
    flex: 1; padding: 60px 80px; max-width: 900px; background: #ffffff;
    min-height: 100vh;
}

/* 6. TYPOGRAPHY & BLOCKS NỘI DUNG */
h1.title-hero { 
    font-family: 'FD Aeonik Extended', sans-serif; text-transform: uppercase; font-size: 36px; 
    line-height: 1.2; margin-bottom: 30px; text-transform: uppercase; letter-spacing: -0.01em; 
}
h2 { 
    font-family: 'FD Aeonik', sans-serif; font-size: 26px; margin-top: 50px; 
    border-bottom: 1px solid var(--border); padding-bottom: 10px; text-transform: uppercase; 
}
h3 { font-family: 'FD Aeonik', sans-serif; font-size: 20px; margin-top: 40px; color: var(--accent); }
.code-box { background: var(--bg-color); border: 1px solid var(--border); padding: 24px; border-radius: 12px; margin-bottom: 24px; }
blockquote.luc-bat { font-style: italic; background: #f1f5f9; border-left: 4px solid var(--accent); padding: 12px 20px; margin: 20px 0; }
.cb-label { font-family: 'FD Aeonik', sans-serif; font-weight: 700; font-size: 14px; color: #475569; text-transform: uppercase; }

/* 7. RESPONSIVE DI ĐỘNG */
@media (max-width: 900px) {
    .layout-wrapper { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
    .canvas { padding: 30px 20px; }
}
