/* ==========================================================================
   Cổng thông tin – giao diện bạn đọc
   ========================================================================== */
.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 20px; }
main { min-height: 60vh; outline: none; }

/* ---------- Thanh trên cùng ---------- */
.topbar { background: var(--brand-bar); color: #dce6f3; font-size: 13px; }
.topbar .container { display: flex; align-items: center; gap: 18px; min-height: 38px; }
.topbar a { color: #dfe8f5; }
.topbar a:hover { color: #fff; }
.topbar .ti { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar .ti .i { width: 14px; height: 14px; color: var(--cyan); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar .acc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #fff; }
.topbar .admin-link { background: var(--accent-500); color: #fff !important; padding: 3px 10px; border-radius: 99px; font-weight: 600; text-decoration: none !important; }

/* ---------- Đầu trang ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none !important; color: inherit; min-width: 0; }
.brand-logo { height: 52px; width: auto; flex: none; }
.brand-sep { width: 1px; align-self: stretch; margin: 6px 0; background: var(--line); flex: none; }
.brand .t1 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-600); }
.brand .t2 { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--brand-900); line-height: 1.25; }
.brand .t3 { font-size: 13px; color: var(--muted); font-style: italic; }
.header-search { margin-left: auto; display: flex; align-items: center; width: min(400px, 40%); position: relative; }
.header-search .input { padding-right: 46px; border-radius: 99px; background: var(--bg); border-color: var(--line); }
.header-search button { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand-700); color: #fff; display: grid; place-items: center; cursor: pointer; }
.nav-toggle { display: none; margin-left: auto; }

/* ---------- Menu chính ---------- */
.mainnav { background: var(--brand-700); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0, 23, 51, .18); }
.mainnav .container { display: flex; align-items: stretch; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.mainnav > .container > ul > li { position: relative; }
.mainnav .nl { display: flex; align-items: center; gap: 5px; height: 50px; padding: 0 15px; color: #e8eef8; font-weight: 600; font-size: 14.5px; text-decoration: none !important; border: 0; background: none; cursor: pointer; white-space: nowrap; position: relative; }
.mainnav .nl:hover, .mainnav li:focus-within > .nl { background: rgba(255, 255, 255, .08); color: #fff; }
.mainnav .nl.active { color: #fff; }
.mainnav .nl.active::after { content: ''; position: absolute; left: 15px; right: 15px; bottom: 0; height: 3px; background: var(--cyan); border-radius: 3px 3px 0 0; }
.mainnav .nl .i { width: 15px; height: 15px; opacity: .8; }
.mainnav .dd { position: absolute; top: 100%; left: 0; min-width: 250px; background: #fff; border-radius: 0 0 12px 12px; box-shadow: var(--shadow-lg); padding: 8px; display: none; flex-direction: column; border-top: 3px solid var(--accent-500); }
.mainnav li:hover > .dd, .mainnav li:focus-within > .dd, .mainnav li.open > .dd { display: flex; }
.mainnav .dd a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none !important; }
.mainnav .dd a:hover { background: var(--brand-50); color: var(--brand-800); }
.mainnav .dd a .i { color: var(--brand-500); width: 16px; height: 16px; }

/* ---------- Tiêu đề trang con ---------- */
.page-hero { background: linear-gradient(120deg, var(--brand-900), var(--brand-700) 60%, var(--brand-600)); color: #fff; position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 380px; height: 380px; border-radius: 50%; border: 50px solid rgba(0, 222, 223, .12); }
.page-hero .container { padding-top: 34px; padding-bottom: 34px; position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: 30px; margin: 6px 0 6px; }
.page-hero p { color: #c9d6ea; margin: 0; max-width: 760px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: #b7c7de; }
.crumbs a { color: #dfe8f5; }
.crumbs .i { width: 13px; height: 13px; }

.section { padding: 52px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.section-head .over { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-600); }
.section-head h2 { font-size: 25px; margin: 2px 0 0; }
.section-head .more { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.page-body { padding: 36px 0 60px; }

/* ---------- Banner trang chủ ---------- */
.hero { position: relative; height: 500px; background: var(--brand-900); overflow: hidden; }
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .8s ease; visibility: hidden; }
.slide.on { opacity: 1; visibility: visible; }
.slide::before { content: ''; position: absolute; inset: 0; }
.slide.ov-navy::before { background: linear-gradient(90deg, rgba(0, 23, 51, .92) 0%, rgba(0, 39, 87, .72) 45%, rgba(0, 39, 87, .12) 100%); }
.slide.ov-dark::before { background: linear-gradient(90deg, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .5) 50%, rgba(0, 0, 0, .05) 100%); }
.slide.ov-red::before, .slide.ov-gold::before { background: linear-gradient(90deg, rgba(60, 6, 15, .92) 0%, rgba(125, 15, 32, .66) 50%, rgba(125, 15, 32, .06) 100%); }
.slide .container { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; padding-bottom: 120px; }
.slide .sub { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 99px; background: rgba(0, 222, 223, .14); border: 1px solid rgba(0, 222, 223, .45); color: #b4f6f6; font-size: 13px; font-weight: 600; letter-spacing: .03em; }
.slide h2 { color: #fff; font-size: clamp(26px, 3.8vw, 42px); max-width: 860px; margin: 16px 0 12px; line-height: 1.18; }
.slide p { color: #dde6f3; font-size: 17px; max-width: 580px; margin: 0 0 24px; }
.hero-ctrl { position: absolute; bottom: 86px; left: 0; right: 0; z-index: 3; }
.hero-ctrl .container { display: flex; align-items: center; gap: 10px; }
.hero-dots { display: flex; gap: 8px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .4); cursor: pointer; padding: 0; transition: width .3s, background .3s; }
.hero-dots button.on { width: 30px; background: var(--cyan); }
.hero-arrows { margin-left: auto; display: flex; gap: 8px; }
.hero-arrows button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.hero-arrows button:hover { background: rgba(255, 255, 255, .2); }

.search-panel { position: relative; z-index: 5; margin-top: -64px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px 22px 18px; border: 1px solid var(--line); }
.search-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.search-tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.search-tabs button:hover { background: var(--brand-50); color: var(--brand-700); }
.search-tabs button.on { background: var(--brand-700); color: #fff; }
.search-row { display: flex; gap: 10px; }
.search-row .input { min-height: 54px; font-size: 16px; padding-left: 48px; border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a4' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 16px center / 20px; }
.search-row .btn { min-height: 54px; padding: 0 26px; border-radius: 12px; font-size: 15.5px; }
.search-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.search-hints a { padding: 3px 11px; border-radius: 99px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); text-decoration: none !important; }
.search-hints a:hover { border-color: var(--brand-200); color: var(--brand-700); }

/* ---------- Dịch vụ nhanh ---------- */
.services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.service { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none !important; color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-200); color: inherit; }
.service .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.service:nth-child(even) .ic { background: var(--accent-100); color: var(--accent-700); }
.service .ic .i { width: 23px; height: 23px; }
.service b { font-size: 15px; color: var(--brand-900); line-height: 1.35; }
.service span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Dải số liệu ---------- */
.stats-band { background: linear-gradient(110deg, var(--brand-900), var(--brand-700)); color: #fff; position: relative; overflow: hidden; }
.stats-band::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1.5px, transparent 1.5px); background-size: 22px 22px; }
.stats-band .container { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; padding-top: 34px; padding-bottom: 34px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 50px; height: 50px; border-radius: 50%; background: rgba(0, 222, 223, .14); color: var(--cyan); display: grid; place-items: center; flex: none; }
.stat b { display: block; font-size: 28px; line-height: 1.1; font-weight: 700; }
.stat span { font-size: 13.5px; color: #b9c9df; }

/* ---------- Tin tức ---------- */
.news-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 28px; }
.news-main { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.news-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .18s, transform .18s; color: inherit; text-decoration: none !important; }
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.news-card .thumb { aspect-ratio: 16 / 9; background: var(--brand-100) url('/img/cmc-mark.png') no-repeat center / 72px; overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .thumb img { transform: scale(1.04); }
.news-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card h3 { font-size: 17px; margin: 0; color: var(--brand-900); line-height: 1.4; }
.news-card.big h3 { font-size: 20px; }
.news-card p { font-size: 14px; color: var(--muted); margin: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .i { width: 14px; height: 14px; }
.cat-link { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-600); }
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-mini { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: start; color: inherit; text-decoration: none !important; }
.news-mini:hover h4 { color: var(--brand-600); }
.news-mini .thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--brand-100) url('/img/cmc-mark.png') no-repeat center / 44px; }
.news-mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-mini h4 { font-size: 15px; margin: 0 0 4px; line-height: 1.4; color: var(--brand-900); transition: color .15s; }

.notice-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.notice-box .hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--brand-700); color: #fff; font-weight: 700; font-size: 16px; }
.notice-box .hd .i { color: var(--cyan); }
.notice-box .hd a { margin-left: auto; color: #dfe8f5; font-size: 13px; font-weight: 500; }
.notice { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.notice:last-child { border-bottom: 0; }
.notice:hover { background: var(--brand-50); color: inherit; }
.notice:hover b { color: var(--brand-600); }
.datebox { width: 56px; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: #fff; flex: none; }
.datebox .d { font-size: 21px; font-weight: 700; color: var(--brand-800); line-height: 1.5; }
.datebox .m { font-size: 11.5px; font-weight: 700; background: var(--accent-500); color: #fff; padding: 2px 0; text-transform: uppercase; }
.notice b { font-size: 14.5px; line-height: 1.45; color: var(--brand-900); display: block; }

/* ---------- Tài liệu (thẻ sách) ---------- */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 22px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.book { scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none !important; }
.book:hover { color: inherit; }
.book .cover { transition: transform .2s, box-shadow .2s; }
.book:hover .cover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 14px 26px rgba(15, 32, 60, .28); }
.book h4 { font-size: 14.5px; margin: 0; line-height: 1.4; color: var(--brand-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book .au { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.avail::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.avail.ok { color: var(--success); }
.avail.no { color: var(--danger); }
.avail.dig { color: var(--info); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 22px; }

/* ---------- Sự kiện ---------- */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.event-row { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; color: inherit; text-decoration: none !important; transition: box-shadow .18s, border-color .18s; }
.event-row:hover { box-shadow: var(--shadow); border-color: var(--brand-200); color: inherit; }
.event-date { border-radius: 12px; background: var(--brand-700); color: #fff; text-align: center; padding: 8px 0; height: max-content; }
.event-date .d { font-size: 26px; font-weight: 700; line-height: 1.1; }
.event-date .m { font-size: 12px; font-weight: 600; color: #c9f5f5; text-transform: uppercase; }
.event-date.past { background: #e9edf3; color: var(--muted); }
.event-date.past .m { color: var(--muted); }
.event-row h4 { margin: 4px 0 6px; font-size: 16px; line-height: 1.4; color: var(--brand-900); }
.gbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.gbadge::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--gc, var(--brand-600)); }
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.event-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none !important; transition: box-shadow .18s, transform .18s; }
.event-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.event-card .thumb { aspect-ratio: 16 / 8; position: relative; background: var(--brand-100); }
.event-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-card .thumb .event-date { position: absolute; left: 14px; bottom: -22px; width: 64px; box-shadow: var(--shadow); border: 3px solid #fff; }
.event-card .body { padding: 30px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.event-card h3 { font-size: 17px; margin: 0; color: var(--brand-900); line-height: 1.4; }

/* ---------- Hỏi đáp ---------- */
.faq-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); color: inherit; text-decoration: none !important; }
.faq-item:hover b { color: var(--brand-600); }
.faq-item .q { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-100); color: var(--accent-700); display: grid; place-items: center; font-weight: 800; flex: none; font-family: var(--font-head); }
.faq-item b { display: block; color: var(--brand-900); font-size: 15px; line-height: 1.45; transition: color .15s; }
.qa-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.qa-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); color: inherit; }
.qa-card h3 { font-size: 17px; margin: 6px 0 8px; display: flex; gap: 10px; }
.qa-card h3::before { content: 'H'; flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--brand-700); color: #fff; display: grid; place-items: center; font-size: 13px; margin-top: 1px; }
.qa-card .ans { display: flex; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.qa-card .ans::before { content: 'Đ'; flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-500); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.answer-box { background: linear-gradient(180deg, var(--brand-50), #fff 140px); border: 1px solid var(--brand-200); border-radius: var(--radius); padding: 22px 24px; }

/* ---------- CSDL điện tử ---------- */
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.db-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.db-tile:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); color: inherit; }
.db-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; background: var(--dc, var(--brand-600)); flex: none; letter-spacing: -.02em; }
.db-tile b { display: block; font-size: 14.5px; color: var(--brand-900); line-height: 1.35; }
.db-tile span { font-size: 12.5px; color: var(--muted); }
.db-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.db-card .top { display: flex; gap: 14px; align-items: center; }
.db-card h3 { font-size: 16.5px; margin: 0; }
.db-card p { font-size: 14px; color: var(--ink-2); margin: 0; }
.db-card .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 6px; }

/* ---------- Đa phương tiện ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.media-card { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none !important; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.media-card .thumb { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--brand-100); }
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.media-card:hover .thumb img { transform: scale(1.05); }
.media-card .play { position: absolute; inset: 0; display: grid; place-items: center; }
.media-card .play span { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--brand-700); box-shadow: var(--shadow); }
.media-card .play .i { fill: currentColor; margin-left: 3px; }
.media-card .dur, .media-card .cnt { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 23, 51, .8); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 6px; display: inline-flex; gap: 5px; align-items: center; }
.media-card h4 { margin: 0; font-size: 15.5px; color: var(--brand-900); line-height: 1.4; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(5, 12, 24, .94); z-index: 950; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-height: 78vh; max-width: min(1100px, 100%); border-radius: 8px; }
.lightbox .cap { color: #e3e9f3; margin-top: 14px; text-align: center; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox .prev { left: 20px; } .lightbox .next { right: 20px; }
.lightbox .close { position: absolute; top: 18px; right: 18px; }
.video-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.video-placeholder img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.45); }
.video-placeholder div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 20px; gap: 8px; }

/* ---------- Bố cục có thanh bên ---------- */
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.with-side.left { grid-template-columns: 270px minmax(0, 1fr); }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.side-card h3 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.side-card h3 .i { color: var(--accent-600); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-bottom: 1px solid var(--line-2); }
.side-list li:last-child { border-bottom: 0; }
.side-list a, .side-list button { display: flex; align-items: center; gap: 8px; padding: 9px 4px; color: var(--ink-2); font-size: 14px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none !important; }
.side-list a:hover, .side-list button:hover { color: var(--brand-700); }
.side-list .n { margin-left: auto; font-size: 12px; color: var(--faint); background: var(--bg); padding: 1px 8px; border-radius: 99px; }
.side-list .active { color: var(--brand-700); font-weight: 700; }
.facet { margin-bottom: 18px; }
.facet h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.facet .check { display: flex; width: 100%; padding: 4px 0; }
.facet .check .n { margin-left: auto; font-size: 12px; color: var(--faint); }

/* ---------- Tra cứu ---------- */
.search-top { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.search-top form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-top .select { width: 190px; flex: none; }
.search-top .input { flex: 1; min-width: 220px; }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.result-bar .count { font-size: 15px; }
.result-bar .select { width: auto; min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.result { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 18px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; transition: border-color .15s, box-shadow .15s; }
.result:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.result h3 { font-size: 17px; margin: 0 0 4px; line-height: 1.4; }
.result h3 a { color: var(--brand-900); }
.result .au { color: var(--ink-2); font-size: 14px; margin-bottom: 6px; }
.result .snip { font-size: 14px; color: var(--ink-2); background: #fbfcfe; border-left: 3px solid var(--brand-500); padding: 8px 12px; border-radius: 0 8px 8px 0; margin: 10px 0; white-space: pre-line; }
.result .snip .src { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-600); margin-bottom: 2px; }
.result .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.active-filters .chip .i { width: 13px; height: 13px; }
.filter-toggle { display: none; }

/* ---------- Chi tiết tài liệu ---------- */
.doc-detail { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; }
.doc-detail .cover { width: 100%; }
.doc-title { font-size: 26px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 170px 1fr; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.kv > div:nth-child(odd) { color: var(--muted); font-weight: 500; }
.avail-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.avail-box .big { font-size: 26px; font-weight: 700; color: var(--brand-800); }
.meter { height: 8px; border-radius: 99px; background: var(--brand-100); overflow: hidden; margin: 8px 0 14px; }
.meter span { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.kw { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Trình đọc toàn văn ---------- */
.reader-bar { position: sticky; top: 50px; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.reader-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.reader-bar .ttl { font-weight: 700; color: var(--brand-900); min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-find { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px 4px 3px 10px; }
.reader-find input { border: 0; background: none; outline: none; width: 200px; min-height: 30px; font-size: 14px; }
.reader-find .cnt { font-size: 13px; color: var(--muted); min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.reader { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; padding: 30px 0 70px; }
.toc { position: sticky; top: 130px; align-self: start; font-size: 14px; }
.toc h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--line); color: var(--ink-2); line-height: 1.4; }
.toc a:hover { border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; background: var(--brand-50); }
.paper { background: var(--paper); border: 1px solid #efe7d6; border-radius: 6px; box-shadow: 0 10px 30px rgba(60, 45, 15, .08); padding: 48px 56px; max-width: 860px; }
.paper .prose { font-family: var(--font-serif); font-size: var(--reader-size, 17px); line-height: 1.85; color: #2a2518; }
.paper .prose h2, .paper .prose h3 { scroll-margin-top: 130px; } /* chừa chỗ cho menu + thanh công cụ dính khi chọn mục lục */
.paper .doc-head { border-bottom: 2px solid var(--brand-500); padding-bottom: 16px; margin-bottom: 26px; }
.paper .doc-head h1 { font-size: 25px; }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 24px; }

/* ---------- Tài khoản ---------- */
.profile-card { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.avatar { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-600), var(--brand-900)); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; flex: none; border: 3px solid var(--cyan); }
.profile-card h2 { margin: 0; font-size: 21px; }
.policy-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pill { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.pill b { display: block; font-size: 18px; color: var(--brand-800); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--brand-700); }
.tabs button.on { color: var(--brand-800); border-bottom-color: var(--accent-500); }
.tabs .n { background: var(--brand-100); color: var(--brand-700); border-radius: 99px; font-size: 12px; padding: 0 8px; }
.loan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand-50); border-radius: 10px; margin-bottom: 12px; }

/* ---------- Đăng nhập / Đăng ký ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 620px; margin: 40px auto 60px; max-width: 1060px; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.auth-art { background: linear-gradient(150deg, var(--brand-900), var(--brand-600)); color: #fff; padding: 44px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -90px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; border: 44px solid rgba(0, 222, 223, .14); }
.auth-art h2 { color: #fff; font-size: 27px; margin: 22px 0 10px; }
.auth-art p { color: #c9d6ea; }
.auth-art ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-art li { display: flex; gap: 10px; align-items: flex-start; color: #e3eaf5; }
.auth-art li .i { color: var(--cyan); margin-top: 3px; }
.auth-form { padding: 44px; }
.auth-form h1 { font-size: 26px; margin-bottom: 4px; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.demo-accounts .row-wrap button { font-size: 12.5px; }

/* ---------- Chat hỗ trợ trực tuyến ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 800; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 99px; border: 0; background: var(--brand-700); color: #fff; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 23, 51, .35); cursor: pointer; }
.chat-fab:hover { background: var(--brand-800); }
.chat-fab .dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa3b2; box-shadow: 0 0 0 2px var(--brand-700); }
.chat-fab .dot.on { background: #3ddc84; }
.chat-panel { position: fixed; right: 20px; bottom: 84px; z-index: 800; width: min(370px, calc(100vw - 24px)); height: min(540px, calc(100vh - 110px)); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); animation: pop .2s ease; }
.chat-head { background: linear-gradient(120deg, var(--brand-800), var(--brand-600)); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.chat-head .av { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; padding: 5px; }
.chat-head .av img { width: 100%; height: auto; }
.chat-head b { display: block; font-size: 15px; }
.chat-head small { color: #c9d6ea; font-size: 12.5px; }
.chat-head button { margin-left: auto; color: #fff; }
.chat-head button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--brand-700); color: #fff; border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: 11.5px; font-weight: 700; color: var(--accent-700); margin-bottom: 2px; }
.msg time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.chat-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-foot textarea { flex: 1; resize: none; min-height: 42px; max-height: 110px; }
.chat-intro { padding: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Chân trang ---------- */
.site-footer { background: var(--brand-950); color: #b9c6da; margin-top: 30px; font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr; gap: 34px; padding: 48px 20px 36px; }
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; position: relative; padding-bottom: 10px; }
.site-footer h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 36px; height: 2px; background: var(--cyan); }
.site-footer a { color: #d6e0ee; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer .ci { display: flex; gap: 10px; margin-bottom: 10px; }
.site-footer .ci .i { color: var(--cyan); margin-top: 3px; width: 16px; height: 16px; }
.site-footer .foot-logo { height: 46px; width: auto; margin-bottom: 14px; }
.site-footer .foot-name { font-family: var(--font-head); color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.site-footer .bottom { border-top: 1px solid rgba(255, 255, 255, .08); }
.site-footer .bottom .container { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 16px; padding-bottom: 16px; font-size: 13px; }
.site-footer .bottom .visits { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Đáp ứng thiết bị ---------- */
@media (max-width: 1100px) {
  .services { grid-template-columns: repeat(3, 1fr); }
  .stats-band .container { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .header-search { display: none; }
  .nav-toggle { display: inline-flex; }
  .mainnav { position: static; display: none; }
  .mainnav.open { display: block; }
  .mainnav .container { padding: 0; }
  .mainnav ul { flex-direction: column; width: 100%; }
  .mainnav .nl { height: 48px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .mainnav .nl.active::after { display: none; }
  .mainnav .dd { position: static; display: none; box-shadow: none; border-radius: 0; background: var(--brand-800); border-top: 0; padding: 4px 0 8px 20px; }
  .mainnav li.open > .dd { display: flex; }
  .mainnav li:hover > .dd { display: none; }
  .mainnav li.open:hover > .dd { display: flex; }
  .mainnav .dd a { color: #dfe8f5; }
  .mainnav .dd a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .with-side, .with-side.left, .two-col, .doc-detail, .reader { grid-template-columns: 1fr; }
  .doc-detail .cover-col { max-width: 220px; }
  .toc { display: none; }
  .filter-toggle { display: inline-flex; }
  .search-side { display: none; }
  .search-side.open { display: block; }
  .auth-wrap { grid-template-columns: 1fr; margin: 20px 16px 40px; }
  .auth-art { display: none; }
  .reader-bar { top: 0; }
}
@media (max-width: 720px) {
  .topbar .hide-sm { display: none; }
  .site-header .container { min-height: 76px; gap: 12px; }
  .brand-logo { height: 36px; }
  .brand-sep, .brand-text { display: none; }
  .hero { height: 440px; }
  .slide p { font-size: 15px; }
  .services { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stats-band .container { grid-template-columns: repeat(2, 1fr); }
  .news-main { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .search-top .select { width: 100%; }
  .result { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; font-size: 13px; }
  .paper { padding: 26px 20px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 23px; }
  .section { padding: 38px 0; }
  .section-head h2 { font-size: 22px; }
  .auth-form { padding: 26px 20px; }
  .chat-fab .lbl { display: none; }
  .chat-fab { padding: 14px; }
  .reader-find input { width: 120px; }
}
