/* Font tự host (Inter, Plus Jakarta Sans — SIL Open Font License, nguồn Google Fonts): không cần kết nối tới
   fonts.googleapis.com / fonts.gstatic.com. Font biến thiên (variable): một file cho mọi độ đậm. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =========================================================================
   Hentai18 — giao diện mới (phong cách streaming tối, lấy cảm hứng từ Dramaflix)
   ========================================================================= */
:root {
    --bg: #08080a;
    --bg-2: #0e0e12;
    --surface: #141419;
    --surface-2: #1c1c23;
    --surface-3: #26262e;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --text: #f5f5f7;
    --text-2: #b4b4be;
    --muted: #8b8b96;
    --accent: #e2497b;
    --accent-2: #ec6a95;
    --accent-dark: #c03e69;
    --accent-soft: rgba(226, 73, 123, .16);
    --gold: #f5c518;
    --green: #22c55e;
    --radius: 12px;
    --radius-sm: 8px;
    --header-h: 64px;
    --wrap: 1440px;
    --gutter: clamp(16px, 3vw, 40px);
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.hx {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.hx a { color: inherit; text-decoration: none; }
.hx img { max-width: 100%; display: block; }
.hx button { font: inherit; color: inherit; }
.hx h1, .hx h2, .hx h3, .hx h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
/* Tiêu đề lớn dùng Plus Jakarta Sans, chữ thường và tiêu đề thẻ truyện dùng Inter (như dramaflix) */
.hx h1, .hx h2 { font-family: var(--font-display); }
.hx h3, .hx h4 { font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.hx-noscroll, .hx-noscroll body { overflow: hidden; }
.hx p { margin: 0 0 1em; }
.hx ul { margin: 0; padding: 0; list-style: none; }
/* Viền focus cho nút / link khi dùng bàn phím. Ô nhập liệu có hiệu ứng riêng trên khung bao ngoài. */
.hx :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.hx input:focus, .hx textarea:focus, .hx select:focus,
.hx input:focus-visible, .hx textarea:focus-visible, .hx select:focus-visible { outline: none; }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hx-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.hx-main { padding-top: var(--header-h); min-height: 60vh; }
.hx-main.has-hero { padding-top: 0; }

/* ---------- Nút ---------- */
.hx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px;
    font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: background .15s, transform .15s, border-color .15s, color .15s;
}
.hx-btn:active { transform: scale(.97); }
.hx-btn-light { background: #fff; color: #0b0b0d !important; }
.hx-btn-light:hover { background: #e4e4e8; }
.hx-btn-glass { background: rgba(255,255,255,.08); border-color: var(--line-2); color: var(--text) !important; backdrop-filter: blur(8px); }
.hx-btn-glass:hover { background: rgba(255,255,255,.16); }
.hx-btn-accent { background: var(--accent); color: #fff !important; }
.hx-btn-accent:hover { background: var(--accent-dark); }
.hx-btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.hx-btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.hx-btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: #fff !important; }

.hx-badge {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
    font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1;
}
.hx-badge-new { background: var(--accent); color: #fff; }
.hx-badge-dark { background: rgba(255,255,255,.12); color: var(--text); }
.hx-badge-raw { background: #f5c518; color: #111; }
/* Nhãn RAW sát góc trên-trái ảnh bìa */
.hx-card-raw { position: absolute; top: 0; left: 0; z-index: 3; padding: 4px 9px 4px 8px; border-radius: 0 0 8px 0; background: #f5c518; color: #111; font-size: 11px; font-weight: 900; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hx-card-raw + .hx-card-badges { top: 30px; }
.hx-search em.hx-badge-raw { height: 18px; padding: 0 6px; font-size: 10px; font-style: normal; vertical-align: 1px; }
.hx-badge-done { background: var(--green); color: #04130a; }

.hx-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--text-2) !important; font-size: 13px; font-weight: 600; white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.hx-chip:hover { background: var(--surface-2); color: #fff !important; border-color: var(--line-2); }
.hx-chip.is-active { background: #fff; color: #0b0b0d !important; border-color: #fff; }
.hx-chip .count { color: var(--muted); font-weight: 500; }
.hx-chip.is-active .count { color: #555; }

/* ---------- Header ---------- */
.hx-header {
    position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
    transition: background .25s, border-color .25s, backdrop-filter .25s;
    border-bottom: 1px solid transparent;
    background: linear-gradient(to bottom, rgba(8,8,10,.85), rgba(8,8,10,0));
}
.hx-header.is-solid, .hx-header.is-static { background: rgba(8,8,10,.92); border-bottom-color: var(--line); backdrop-filter: saturate(160%) blur(14px); }
.hx-header-inner { display: flex; align-items: center; gap: 28px; height: 100%; }
.hx-logo { display: flex; align-items: center; flex-shrink: 0; }
.hx-logo img { height: 32px; width: auto; }
.hx-wordmark { color: var(--accent); font-size: 24px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.hx-wordmark b { color: #fff; font-weight: 900; }
.hx-logo img + .hx-wordmark { display: none; }
.hx-nav { display: flex; align-items: center; gap: 2px; height: 100%; min-width: 0; }
.hx-nav > a, .hx-nav-more > button {
    position: relative; display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 12px;
    border: 0; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.hx-nav > a:hover, .hx-nav-more > button:hover { color: #fff; }
.hx-nav > a.is-active { color: #fff; }
.hx-nav > a.is-active::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 12px; height: 3px; border-radius: 3px; background: var(--accent);
}
.hx-nav-more { position: relative; height: 100%; }
.hx-dropdown {
    position: absolute; top: calc(100% - 6px); left: 0; z-index: 120; min-width: 220px; padding: 8px;
    border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20,20,25,.98);
    box-shadow: 0 20px 50px rgba(0,0,0,.6); opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.hx-nav-more:hover .hx-dropdown, .hx-nav-more:focus-within .hx-dropdown { opacity: 1; visibility: visible; transform: none; }
.hx-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.hx-dropdown a:hover { background: var(--surface-2); color: #fff; }
.hx-header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hx-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); color: var(--text); cursor: pointer;
}
.hx-icon-btn:hover { background: rgba(255,255,255,.12); }
.hx-burger { display: none; }

/* Menu thành viên (dùng lại component u-menu) */
.hx-header .u-menu .u-btn { height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; display: inline-flex; align-items: center; }
.hx-header .u-menu .u-btn:not(.u-btn-ghost) { background: #fff; border-color: #fff; color: #0b0b0d !important; }
.hx-header .u-menu .u-btn-ghost { border-color: transparent; }
.hx-header .u-menu-dropdown { border-radius: var(--radius); background: rgba(20,20,25,.98); border-color: var(--line); }

/* Drawer mobile */
.hx-drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.hx-drawer.is-open { visibility: visible; }
.hx-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.hx-drawer.is-open .hx-drawer-backdrop { opacity: 1; }
.hx-drawer-panel {
    position: absolute; inset: 0 auto 0 0; width: min(320px, 86vw); overflow-y: auto; padding: 18px;
    background: var(--bg-2); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .25s;
}
.hx-drawer.is-open .hx-drawer-panel { transform: none; }
.hx-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hx-drawer-title { margin: 18px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-drawer nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; }
.hx-drawer nav a:hover, .hx-drawer nav a.is-active { background: var(--surface); color: #fff; }

/* Tìm kiếm */
.hx-search { position: fixed; inset: 0; z-index: 210; display: none; padding: 80px var(--gutter) 24px; background: rgba(8,8,10,.9); backdrop-filter: blur(12px); }
.hx-search.is-open { display: block; }
.hx-search-box { position: relative; max-width: 720px; margin: 0 auto; }
.hx-search-form { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
.hx-search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.18); }
.hx-search-form input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: #fff; font: 500 17px var(--font); }
.hx-search-form input::placeholder { color: var(--muted); }
.hx-search-close { position: absolute; top: 18px; right: var(--gutter); }
.hx-search-results { margin-top: 14px; max-height: calc(100vh - 190px); overflow-y: auto; border-radius: var(--radius); }
.hx-search-results:empty { display: none; }
.hx-search-results ul { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hx-search-results li a { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 10px; color: var(--text); font-weight: 600; }
.hx-search-results li a:hover { background: var(--surface-2); }
.hx-search-results img { width: 44px; height: 62px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.hx-search-results .chapter-name { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.hx-search-results .not-found { padding: 18px; color: var(--muted); text-align: center; }
.hx-search-hint { margin-top: 18px; color: var(--muted); font-size: 13px; text-align: center; }
.hx-search-hint .hx-chip { margin: 4px; }

/* ---------- Hero ---------- */
.hx-hero { position: relative; min-height: min(78vh, 720px); padding-top: var(--header-h); overflow: hidden; isolation: isolate; }
.hx-hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center 30%; filter: blur(42px) saturate(1.2); opacity: .55; transform: scale(1.1); transition: background-image .4s; }
.hx-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, var(--bg) 8%, rgba(8,8,10,.75) 45%, rgba(8,8,10,.25) 100%), linear-gradient(0deg, var(--bg) 2%, rgba(8,8,10,0) 40%);
}
.hx-hero-slides { position: relative; }
.hx-slide { display: none; align-items: center; gap: 48px; min-height: calc(min(78vh, 720px) - var(--header-h) - 120px); padding: 32px 0 16px; }
.hx-slide.is-active { display: flex; justify-content: space-between; animation: hx-fade .5s ease; }
@keyframes hx-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hx-slide-info { flex: 1; min-width: 0; max-width: 660px; }
/* Khoảng cách trong hero theo nhịp 16 / 12 / 16 / 28px như dramaflix */
.hx-slide-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.hx-slide-badges .hx-badge { height: 26px; padding: 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.hx-slide-badges .hx-badge-dark { border-radius: 999px; background: rgba(255,255,255,.1); }
.hx-slide-title a { color: inherit; }
.hx-slide-title { margin: 0 !important; font-family: var(--font-display); font-size: clamp(30px, 4vw, 54px); font-weight: 800 !important; line-height: 1.04 !important; letter-spacing: -.025em !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-slide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 12px 0 0; color: #b4b4be; font-size: 14px; font-weight: 600; line-height: 21px; }
.hx-slide-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hx-slide-meta .star { color: var(--gold); }
.hx-slide-desc { max-width: 600px; margin: 16px 0 0 !important; color: #b4b4be; font-size: 16px; line-height: 26px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-slide-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hx-slide-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hx-slide-actions .hx-btn { height: 48px; padding: 0 28px; font-size: 16px; font-weight: 800; }
.hx-slide-actions .hx-btn-glass { border-color: rgba(255,255,255,.06); background: rgba(255,255,255,.12); color: #fff !important; }
.hx-slide-poster { flex-shrink: 0; width: min(300px, 26vw); margin-right: clamp(0px, 4vw, 80px); }
.hx-slide-poster a { display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px var(--line); }
.hx-slide-poster img { width: 100%; height: 100%; object-fit: cover; }

.hx-hero-thumbs { position: relative; display: flex; align-items: center; gap: 16px; padding: 10px 0 30px; }
/* Dãy ảnh nhỏ trải hết chiều ngang giữa 2 nút tròn (như dramaflix), cuộn ngang khi nhiều truyện */
.hx-hero-thumbs .hx-thumbs { display: flex; flex: 1; min-width: 0; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px; }
.hx-hero-thumbs .hx-thumbs::-webkit-scrollbar { display: none; }
.hx-thumb { flex-shrink: 0; width: 64px; aspect-ratio: 2 / 3; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: var(--surface); opacity: .55; cursor: pointer; transition: opacity .15s, border-color .15s, transform .15s; }
.hx-thumb { border-radius: 10px; opacity: 1; }
/* Chỉ ảnh đang chọn sáng; các ảnh khác tối đi (giảm độ sáng ảnh, không làm trong suốt) như dramaflix */
.hx-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.4) saturate(.75); transition: filter .25s ease; }
.hx-thumb:hover img { filter: brightness(.75) saturate(.9); }
.hx-thumb.is-active { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(226,73,123,.35); }
.hx-thumb.is-active img { filter: none; }
.hx-hero-arrow { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(20,20,25,.7); color: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.hx-hero-arrow:hover { background: var(--surface-3); border-color: rgba(255,255,255,.28); }

/* ---------- Section & rail ---------- */
.hx-section { padding: 22px 0 18px; }
.hx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.hx-section-title { display: flex; align-items: center; gap: 10px; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.025em; }
.hx-section-title .ic { color: var(--accent); }
.hx-see-all { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2) !important; font-size: 14px; font-weight: 600; white-space: nowrap; }
.hx-see-all:hover { color: #fff !important; }
.hx-section-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.hx-rail { position: relative; }
.hx-rail-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 5 * 16px) / 6.3); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px;
}
.hx-rail-track::-webkit-scrollbar { display: none; }
.hx-rail-track > * { scroll-snap-align: start; }
.hx-rail-btn {
    position: absolute; top: calc(50% - 40px); z-index: 5; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; background: rgba(20,20,25,.92);
    color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .15s; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.hx-rail:hover .hx-rail-btn:not([disabled]) { opacity: 1; }
.hx-rail-btn:hover { background: var(--surface-3); }
.hx-rail-btn[disabled] { opacity: 0 !important; pointer-events: none; }
.hx-rail-prev { left: -18px; }
.hx-rail-next { right: -18px; }

/* Thẻ truyện */
.hx-card { position: relative; min-width: 0; }
.hx-card-cover {
    position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: var(--radius);
    background: var(--surface) center / cover no-repeat; box-shadow: 0 0 0 1px var(--line);
}
.hx-card-cover img, .hx-slide-poster img, .hx-thumb img, .hx-detail-poster img { color: transparent; font-size: 0; }
.hx-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s; }
.hx-card-cover::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(to top, rgba(0,0,0,.85), transparent); pointer-events: none; }
.hx-card:hover .hx-card-cover img { transform: scale(1.06); filter: brightness(1.08); }
.hx-card-badges { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.hx-card-ep { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(4px); }
.hx-card-rate { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: 12px; font-weight: 700; }
.hx-card-title { margin-top: 10px !important; font-family: var(--font) !important; font-size: 14px !important; font-weight: 600 !important; line-height: 1.375 !important; letter-spacing: 0 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-card-title a:hover { color: var(--accent-2); }
.hx-card-meta { margin-top: 4px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-card-meta a:hover { color: #fff; }
.hx-card-remove { position: absolute; top: 8px; right: 8px; z-index: 3; display: none; }
.is-editing .hx-card-remove { display: inline-flex; }

.hx-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 16px; }
/* Lưới danh sách truyện: 6 cột trên máy tính, giảm dần theo bề rộng màn hình */
@media (max-width: 1180px) { .hx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 980px)  { .hx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Card ngang (top list) */
.hx-rank { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.hx-rank-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.hx-rank-item:hover { background: var(--surface-2); }
.hx-rank-num { width: 34px; color: var(--accent); font-size: 26px; font-weight: 900; text-align: center; }
.hx-rank-item img { width: 56px; height: 80px; border-radius: 8px; object-fit: cover; }
.hx-rank-item h3 { font-size: 15px !important; }

/* ---------- Đầu trang danh sách ---------- */
.hx-page-head { padding: 34px 0 10px; }
.hx-page-head h1 { font-size: clamp(26px, 3.4vw, 40px); }
.hx-page-intro { max-width: 860px; margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.hx-page-intro p:last-child { margin-bottom: 0; }
.hx-filterbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); overflow-x: auto; scrollbar-width: none; }
.hx-filterbar::-webkit-scrollbar { display: none; }
.hx-filterbar-label { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; }
.hx-filterbar-label .ic { color: var(--accent); }

.hx-empty { padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); text-align: center; }
.hx-empty .ic { margin-bottom: 10px; color: var(--surface-3); }

.hx-loadmore { display: flex; justify-content: center; margin: 34px 0 10px; }

/* Phân trang của CodeIgniter */
.hx-pager { display: flex; justify-content: center; margin: 40px 0 10px; }
.hx-pager .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hx-pager .pagination li a, .hx-pager .pagination li span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font-weight: 700;
}
.hx-pager .pagination li a:hover { background: var(--surface-2); color: #fff; }
.hx-pager .pagination li.active a, .hx-pager .pagination li.active span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Danh sách A-Z (tags, artists, groups...) */
.hx-az { display: flex; flex-wrap: wrap; gap: 6px; }
.hx-az a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font-weight: 700; }
.hx-az a:hover { background: var(--surface-2); color: #fff; }
.hx-az a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hx-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 22px; }
.hx-terms a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 600; transition: background .15s, border-color .15s; }
.hx-terms a:hover { background: var(--surface-2); border-color: var(--line-2); }
.hx-terms h3 { font-size: 14.5px !important; font-weight: 600 !important; letter-spacing: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-terms .count { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; }

/* Breadcrumb */
.hx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 22px; color: var(--muted); font-size: 13px; }
.hx-crumbs a:hover { color: #fff; }
.hx-crumbs .ic { opacity: .6; }
.hx-crumbs [aria-current] { color: var(--text-2); }

/* ---------- Trang chi tiết ---------- */
.hx-detail-hero { position: relative; padding-top: var(--header-h); overflow: hidden; isolation: isolate; }
.hx-detail-hero .hx-hero-bg { opacity: .45; }
.hx-detail-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--bg) 0%, rgba(8,8,10,.7) 50%, rgba(8,8,10,.55) 100%); }
.hx-detail { display: flex; gap: 40px; padding: 24px 0 36px; }
.hx-detail-poster { flex-shrink: 0; width: 260px; }
.hx-detail-poster .cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px var(--line); }
.hx-detail-poster .cover img { width: 100%; height: 100%; object-fit: cover; }
.hx-detail-info { flex: 1; min-width: 0; }
/* Pill Category / Artist / Status phía trên tiêu đề */
.hx-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.hx-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; transition: background .15s; }
a.hx-pill:hover { background: rgba(255,255,255,.2); }
.hx-pill .ic { opacity: .8; }
.hx-pill-artist { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.hx-pill-status, .hx-pill-done { height: 24px; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 900; }
.hx-pill-status { background: #e50914; }
.hx-pill-done { background: #16a34a; }
.hx-detail-info h1 { font-size: clamp(30px, 4vw, 52px); font-weight: 800; line-height: 1.06; letter-spacing: -.025em; }
.hx-detail-alt { margin-top: 8px; color: var(--text-2); font-size: 15px; font-weight: 500; }
.hx-detail-alt span { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hx-btn[hidden] { display: none; }
.hx-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: #b4b4be; font-size: 14px; font-weight: 600; }
.hx-stats > span, .hx-stat-link { display: inline-flex; align-items: center; gap: 6px; }
.hx-stat-link { color: inherit; transition: color .15s; }
.hx-stat-link[hidden] { display: none; }
.hx-stat-link:hover { color: #f5f5f7; }
.hx-stat-link:hover .ic { color: var(--accent-2); }
#comments { scroll-margin-top: 90px; }
html { scroll-behavior: smooth; }
.hx-stats .ic { color: #b4b4be; }
.hx-stats .star { color: var(--gold); }
.hx-detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hx-detail-actions .hx-btn { height: 48px; padding: 0 24px; font-size: 15px; font-weight: 700; }
.hx-detail-actions .hx-btn-light { padding: 0 28px; background: #fff; color: #08080a !important; font-size: 16px; font-weight: 800; }
.hx-detail-actions .hx-btn-light:hover { background: #e6e6e6; }
.hx-detail-actions .hx-btn-glass { border-color: rgba(255,255,255,.06); background: rgba(255,255,255,.12); color: #fff !important; }
.hx-detail-actions .hx-btn-glass:hover { background: rgba(255,255,255,.2); }
/* Save đã bật: nền hồng sẫm, viền hồng, icon tô đặc (như "In My List" của dramaflix) */
.hx-detail-actions .hx-btn-glass.is-on { border-color: rgba(226,73,123,.45); background: rgba(226,73,123,.2); }
.hx-detail-actions .hx-btn-glass.is-on:hover { background: rgba(226,73,123,.3); }
.hx-detail-actions .hx-btn-glass.is-on .ic { color: var(--accent); fill: currentColor; }
.hx-detail-actions .hx-btn-glass .ic { transition: transform .2s; }
.hx-detail-actions .hx-btn-glass.is-on .ic-bookmark { animation: hx-pop .35s ease; }
/* Giới thiệu truyện */
.hx-synopsis { max-width: 780px; margin-top: 22px; }
.hx-synopsis-text { display: -webkit-box; margin: 0 !important; overflow: hidden; color: #b4b4be; font-size: 16px; line-height: 26px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.hx-synopsis.is-open .hx-synopsis-text { display: block; -webkit-line-clamp: unset; }
.hx-synopsis-more { margin-top: 6px; padding: 0; border: 0; background: none; color: #f5f5f7; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.hx-synopsis-more:hover { text-decoration: underline; }
.hx-synopsis-more[hidden] { display: none; }
/* Dải thông tin nhanh */
.hx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; margin: 24px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.hx-fact { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; background: rgba(14,14,18,.82); backdrop-filter: blur(8px); }
.hx-fact-icon { grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); }
.hx-fact-icon.is-green { background: rgba(34,197,94,.14); color: var(--green); }
.hx-fact dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-fact dd { margin: 2px 0 0; overflow: hidden; color: var(--text); font-size: 15px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.hx-fact dd a:hover { color: var(--accent-2); }
.hx-status { display: inline-flex; align-items: center; gap: 7px; }
.hx-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(226,73,123,.6); animation: hx-pulse 1.8s infinite; }
.hx-status.is-done::before { background: var(--green); box-shadow: none; animation: none; }
@keyframes hx-pulse { 70% { box-shadow: 0 0 0 7px rgba(226,73,123,0); } 100% { box-shadow: 0 0 0 0 rgba(226,73,123,0); } }

/* Tác giả / nhóm dịch */
/* Hàng Credits / Genres có nhãn */
.hx-taxo { display: grid; gap: 14px; margin-top: 20px; }
.hx-taxo-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 12px; }
.hx-taxo-label { display: inline-flex; align-items: center; gap: 6px; height: 32px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-taxo-label .ic { color: var(--accent-2); }
.hx-credits { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-person { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 32px; padding: 0 14px 0 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); transition: border-color .15s, background .15s, transform .15s; }
.hx-person:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }
.hx-person-avatar { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, hsl(var(--hue), 60%, 52%), hsl(calc(var(--hue) + 40), 55%, 32%)); color: #fff; font-size: 14px; font-weight: 800; }
.hx-person-text { display: flex; align-items: baseline; gap: 6px; min-width: 0; line-height: 1.2; }
.hx-person-avatar { font-size: 12px !important; }
.hx-person-text strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.hx-person-text small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.hx-person-text small::before { content: "· "; }

/* Thể loại */
.hx-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hx-detail-info .hx-genre { height: 32px; padding: 0 14px; border: 1px solid rgba(255,255,255,.06); border-radius: 999px; background: rgba(255,255,255,.08); color: #b4b4be; font-size: 13px; font-weight: 600; }
.hx-detail-info .hx-genre:hover { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.16); color: #fff; }
.hx-genre { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.hx-genre:hover { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.hx-genre[hidden] { display: none; }
.hx-genre-more { border-style: dashed; color: var(--accent-2); font-family: inherit; }

/* Thanh đánh giá (một hàng) */
.hx-rate {
    display: inline-flex; align-items: center; gap: 18px; max-width: 100%; margin-top: 20px; padding: 8px 18px 8px 10px;
    border: 1px solid var(--line); border-radius: 16px;
    background: linear-gradient(90deg, rgba(226,73,123,.12), rgba(14,14,18,.8) 45%); backdrop-filter: blur(8px);
}
.hx-rate-score { display: flex; align-items: center; gap: 10px; padding-right: 18px; border-right: 1px solid var(--line); }
.hx-rate-num { display: flex; align-items: baseline; gap: 2px; padding-left: 6px; line-height: 1; }
.hx-rate-num [data-rate-avg] { font-size: 30px; font-weight: 900; letter-spacing: -.04em; background: linear-gradient(180deg, #fff, #f7c6d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-rate-num small { color: var(--muted); font-size: 13px; font-weight: 700; }
.hx-rate-meta { display: flex; flex-direction: column; gap: 3px; }
.hx-rate-stars { position: relative; display: inline-block; line-height: 0; }
.hx-rate-stars .bg, .hx-rate-stars .fg { display: flex; gap: 1px; white-space: nowrap; }
.hx-rate-stars .bg { color: var(--surface-3); }
.hx-rate-stars .fg { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); overflow: hidden; color: var(--gold); transition: width .5s ease; }
.hx-rate-stars .ic, .hx-rate-pick .ic { fill: currentColor; stroke: currentColor; stroke-width: 1; }
.hx-rate-count { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.hx-rate-count span { color: var(--text-2); }

.hx-rate-input { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; row-gap: 1px; min-width: 0; }
.hx-rate-label { grid-column: 1 / -1; padding-left: 4px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-rate-pick { display: flex; gap: 2px; }
.hx-rate-pick button { display: inline-flex; padding: 3px; border: 0; border-radius: 8px; background: none; color: var(--surface-3); cursor: pointer; transition: color .12s, transform .12s; }
.hx-rate-pick button:hover { transform: scale(1.15); }
.hx-rate-pick button .ic { fill: none !important; stroke-width: 1.6 !important; }
.hx-rate-pick button.is-on { color: var(--gold); }
.hx-rate-pick button.is-on .ic { fill: currentColor !important; }
.hx-rate-pick.is-locked button { cursor: default; transform: none; }
.hx-rate-pick.is-locked button:not(.is-on) { opacity: .5; }
.hx-rate-hint { min-width: 118px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.hx-rate-hint strong { color: var(--gold); }
.hx-rate.is-voted .hx-rate-hint { color: var(--green); }
@keyframes hx-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hx-rate-pick button.is-pop { animation: hx-pop .35s ease; }

.hx-panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
.hx-panel + .hx-panel { margin-top: 20px; }
.hx-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hx-panel-head h2 { display: flex; align-items: baseline; gap: 10px; font-size: 28px; letter-spacing: 0; }
.hx-panel-head h2 small { color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.hx-input {
    height: 40px; min-width: 220px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: #fff; font: 500 14px var(--font); outline: 0;
}
.hx-input { transition: border-color .15s, box-shadow .15s; }
.hx-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.15); }
.hx-select { transition: border-color .15s, box-shadow .15s; }
.hx-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.15); }

.hx-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 440px; overflow-y: auto; padding: 6px 4px 0 0; }
.hx-eps.is-expanded { max-height: none; }
.hx-ep {
    position: relative; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text) !important;
    transition: background .15s, border-color .15s, transform .15s;
}
.hx-ep[hidden] { display: none; }
.hx-ep:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.hx-ep-name { overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.hx-ep-date { overflow: hidden; color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.hx-ep-new { position: absolute; top: -6px; right: 8px; padding: 1px 6px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.hx-ep:hover .hx-ep-name { color: var(--accent-2); }
.hx-ep.is-read { border-color: rgba(226,73,123,.5); background: var(--accent-soft); }
.hx-ep.is-read .hx-ep-date::after { content: " · Read"; color: var(--accent-2); font-weight: 700; }
.hx-ep.is-latest { border-color: var(--accent); }
.hx-eps-more { margin-top: 14px; text-align: center; }

.hx-prose { color: var(--text-2); font-size: 15px; line-height: 1.75; }
.hx-prose h2, .hx-prose h3 { margin: 1.4em 0 .5em; color: #fff; font-size: 19px; }
.hx-prose a { color: var(--accent-2); }
.hx-prose ul { margin: 0 0 1em; padding-left: 20px; list-style: disc; }
.hx-prose li { margin: 4px 0; }
.hx-prose strong { color: #fff; }
.hx-collapse { position: relative; max-height: 220px; overflow: hidden; }
.hx-collapse::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(to top, var(--bg-2), transparent); }
.hx-collapse.is-open { max-height: none; }
.hx-collapse.is-open::after { display: none; }
.hx-collapse-btn { margin-top: 10px; }

.hx-share { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-share a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; }
.hx-share a:hover { background: var(--surface-2); color: #fff; }

.hx-keywords { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-keywords a { padding: 6px 12px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 13px; }
.hx-keywords a:hover { color: #fff; background: var(--surface-2); }

/* FAQ */
.hx-faq-list { display: grid; gap: 10px; }
.hx-faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, background .15s; }
.hx-faq-item[open] { border-color: rgba(226,73,123,.35); background: linear-gradient(180deg, rgba(226,73,123,.06), var(--surface) 70%); }
.hx-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; cursor: pointer; list-style: none; }
.hx-faq-item summary::-webkit-details-marker { display: none; }
.hx-faq-item summary h3 { font-size: 15.5px !important; font-weight: 700 !important; letter-spacing: 0 !important; line-height: 1.4 !important; }
.hx-faq-item summary:hover h3 { color: var(--accent-2); }
.hx-faq-icon { position: relative; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); transition: background .15s, transform .2s; }
.hx-faq-icon::before, .hx-faq-icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 2px; border-radius: 2px; background: #fff; transform: translate(-50%, -50%); }
.hx-faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .2s; }
.hx-faq-item[open] .hx-faq-icon { background: var(--accent); }
.hx-faq-item[open] .hx-faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.hx-faq-answer { padding: 0 18px 16px; color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.hx-faq-answer p { margin: 0; }
.hx-faq-answer a { color: var(--accent-2); font-weight: 600; }
.hx-faq-answer a:hover { text-decoration: underline; }
.hx-faq-answer strong { color: #fff; }

/* Bình luận trong giao diện mới */
.hx .u-comments { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); margin: 20px 0 0; }
.hx .u-comments h2 { margin-bottom: 6px; font-size: 22px; }

/* ---------- Trình đọc chapter ---------- */
.hx-reader-bar { position: sticky; top: var(--header-h); z-index: 50; border-bottom: 1px solid var(--line); background: rgba(8,8,10,.92); backdrop-filter: blur(14px); transition: transform .25s; }
.hx-reader-bar.is-hidden { transform: translateY(calc(-100% - var(--header-h))); }
.hx-reader-bar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.hx-reader-title { flex: 1; min-width: 0; }
.hx-reader-title a { display: block; overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.hx-reader-title a:hover { color: #fff; }
.hx-reader-title h1 { overflow: hidden; font-size: 16px !important; font-weight: 700 !important; letter-spacing: 0 !important; white-space: nowrap; text-overflow: ellipsis; }
.hx-reader-nav { display: flex; align-items: center; gap: 8px; }
.hx-reader-nav .hx-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.hx-select { height: 36px; max-width: 170px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: #fff; font: 600 14px var(--font); cursor: pointer; }
/* Bộ chọn chapter (thay cho <select> mặc định của trình duyệt) */
.hx-chap-picker { position: relative; }
.hx-chap-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 190px; padding: 0 12px 0 12px;
    border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: #fff;
    font: 700 14px var(--font); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.hx-chap-btn:hover { background: var(--surface-2); }
.hx-chap-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.18); }
.hx-chap-btn > .ic:first-child { color: var(--accent-2); }
.hx-chap-btn > .ic:last-child { color: var(--muted); transition: transform .2s; }
.hx-chap-btn[aria-expanded="true"] > .ic:last-child { transform: rotate(180deg); }
.hx-chap-btn-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.hx-chap-backdrop { display: none; }
.hx-chap-panel {
    position: fixed; top: 120px; right: 24px; z-index: 130; display: flex; flex-direction: column;
    width: 340px; max-height: min(70vh, 540px); overflow: hidden;
    border: 1px solid var(--line-2); border-radius: 18px; background: rgba(18,18,23,.98);
    box-shadow: 0 24px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(226,73,123,.08); backdrop-filter: blur(16px);
    animation: hx-pop-in .16s ease;
}
.hx-chap-panel[hidden] { display: none; }
@keyframes hx-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes hx-pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.hx-chap-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.hx-chap-head strong { font-size: 16px; }
.hx-chap-count { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 12px; font-weight: 800; }
.hx-chap-close { display: inline-flex; margin-left: auto; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.hx-chap-close:hover { background: var(--surface-2); color: #fff; }
.hx-chap-search {
    display: flex; align-items: center; gap: 10px; height: 42px; margin: 0 14px 10px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.hx-chap-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.15); }
.hx-chap-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: #fff; font: 500 14px var(--font); }
.hx-chap-list { flex: 1; min-height: 0; margin: 0; padding: 4px 8px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.hx-chap-list::-webkit-scrollbar { width: 8px; }
.hx-chap-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: var(--surface-3); background-clip: padding-box; }
.hx-chap-list li[hidden] { display: none; }
.hx-chap-list a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 12px;
    border-radius: 10px; color: var(--text-2) !important; font-size: 14px; font-weight: 600; transition: background .12s, color .12s;
}
.hx-chap-list a:hover, .hx-chap-list a:focus-visible { background: var(--surface-2); color: #fff !important; outline: none; }
.hx-chap-list a.is-current { background: var(--accent-soft); color: #fff !important; box-shadow: inset 3px 0 0 var(--accent); }
.hx-chap-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hx-chap-date { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.hx-chap-badge { flex-shrink: 0; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.hx-chap-empty { margin: 0 !important; padding: 18px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Thông báo nhỏ (toast) — không che nội dung, tự ẩn */
.hx-toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 230; display: flex; align-items: flex-start; gap: 12px; max-width: 380px;
    padding: 14px 14px 14px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 14px;
    background: rgba(20,20,25,.97); box-shadow: 0 16px 40px rgba(0,0,0,.55); color: var(--text-2); font-size: 13.5px; line-height: 1.5;
    opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s;
}
.hx-toast.is-visible { opacity: 1; transform: none; }
.hx-toast-body strong { color: #fff; }
.hx-toast a { color: var(--accent-2); font-weight: 700; }
.hx-toast button { flex-shrink: 0; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.hx-toast button:hover { color: #fff; }

/* Hộp thoại báo lỗi chapter */
.hx-modal { position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center; padding: 16px; }
.hx-modal[hidden] { display: none; }
.hx-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.hx-modal-card {
    position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px;
    border: 1px solid var(--line-2); border-radius: 20px; background: #141419; box-shadow: 0 30px 80px rgba(0,0,0,.7); animation: hx-pop-in .18s ease;
}
.hx-modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.hx-modal-head h2, .hx-modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.hx-modal-head p { margin: 3px 0 0 !important; color: var(--muted); font-size: 13px; }
.hx-modal-head .hx-chap-close { margin-left: auto; }
.hx-modal-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid rgba(239,68,68,.35); border-radius: 12px; background: rgba(239,68,68,.12); color: #f87171; }
.hx-report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.hx-report-reasons legend { margin-bottom: 10px; padding: 0; color: var(--text); font-size: 14px; font-weight: 700; }
.hx-report-reasons label { position: relative; cursor: pointer; }
.hx-report-reasons input { position: absolute; opacity: 0; pointer-events: none; }
.hx-report-reasons span {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; transition: border-color .15s, background .15s, color .15s;
}
.hx-report-reasons span::before { content: ""; flex-shrink: 0; width: 16px; height: 16px; border: 2px solid var(--surface-3); border-radius: 50%; transition: border-color .15s, box-shadow .15s; }
.hx-report-reasons label:hover span { border-color: var(--line-2); color: #fff; }
.hx-report-reasons input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.hx-report-reasons input:checked + span::before { border-color: var(--accent); box-shadow: inset 0 0 0 3px #141419, inset 0 0 0 8px var(--accent); }
.hx-report-reasons input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.hx-report-note { display: grid; gap: 8px; margin-top: 16px; }
.hx-report-note > span { color: var(--text); font-size: 14px; font-weight: 700; }
.hx-report-note small { color: var(--muted); font-weight: 500; }
.hx-report-note textarea {
    width: 100%; min-height: 80px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    color: #fff; font: 500 14px/1.5 var(--font); resize: vertical; transition: border-color .15s, box-shadow .15s;
}
.hx-report-note textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,73,123,.15); }
.hx-report-msg { min-height: 20px; margin: 12px 0 0 !important; font-size: 13.5px; font-weight: 600; }
.hx-report-msg.is-error { color: #f87171; }
.hx-report-msg.is-ok { color: var(--green); }
.hx-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.hx-modal-actions .hx-btn:disabled { opacity: .45; cursor: not-allowed; }
.hx-modal-done { padding: 26px 8px 8px; text-align: center; }
.hx-modal-done .ic { color: var(--green); }
.hx-modal-done h3 { margin-top: 10px !important; font-size: 18px; }
.hx-modal-done p { margin: 6px 0 18px !important; color: var(--text-2); }
.hx-img-report { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent-2); font: 600 13px var(--font); text-decoration: underline; cursor: pointer; }

.hx-reader-head { max-width: 900px; margin: 0 auto; padding: 18px var(--gutter) 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.hx-reader-head .hx-crumbs { justify-content: center; padding-top: 4px; }
.hx-reader-intro { max-width: 760px; margin: 10px auto 0 !important; color: var(--text-2); font-size: 14px; line-height: 1.65; }
.hx-reader-intro strong { color: #fff; }
.hx-reader-intro a { color: var(--accent-2); font-weight: 600; }
.hx-reader-page { flex-shrink: 0; padding: 0 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hx-reader-save.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.hx-reader-progress { height: 3px; background: rgba(255,255,255,.06); }
.hx-reader-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), #f7c6d6); transition: width .1s linear; }
.hx-reader-head p { margin: 6px 0 0; }
.hx-pages { max-width: 900px; margin: 0 auto; background: #000; }
.hx-pages img { display: block; width: 100%; height: auto; margin: 0 auto; background: var(--bg-2); }
/* Giữ chỗ theo tỷ lệ trang truyện phổ biến khi ảnh chưa tải -> hạn chế nhảy bố cục (CLS) */
.hx-pages img:not(.is-loaded) { aspect-ratio: 800 / 1150; }
.hx-pages img[hidden] { display: none; }
.hx-pages img:not(.is-loaded) { color: transparent; font-size: 0; }
.hx-img-retry {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; aspect-ratio: 800 / 600;
    border: 0; border-bottom: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font: 600 14px var(--font); cursor: pointer;
}
.hx-img-retry:hover { color: #fff; }
.hx-img-retry .ic { color: var(--accent); }
.hx-ads-inline { margin: 0; padding: 16px 0; background: var(--bg); }
.hx-reader-end { max-width: 900px; margin: 0 auto; padding: 30px var(--gutter); text-align: center; }
.hx-end-card { margin-bottom: 26px; padding: 26px 22px; border: 1px solid rgba(226,73,123,.3); border-radius: 20px; background: radial-gradient(120% 120% at 50% 0%, rgba(226,73,123,.14), transparent 60%), var(--bg-2); }
.hx-end-card h2 { font-size: 22px; }
.hx-end-next {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 460px; margin: 18px auto 0; padding: 16px 20px;
    border-radius: 16px; background: var(--accent); color: #fff !important; text-align: left; box-shadow: 0 10px 30px rgba(226,73,123,.35); transition: background .15s, transform .15s;
}
.hx-end-next:hover { background: var(--accent-dark); transform: translateY(-2px); }
.hx-end-next small { display: block; opacity: .85; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hx-end-next strong { display: block; font-size: 20px; font-weight: 800; }
.hx-end-note { max-width: 520px; margin: 12px auto 0 !important; color: var(--text-2); }
.hx-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.hx-end-actions .hx-btn.is-on { background: var(--accent-soft); border-color: var(--accent); }
.hx-reader-end .hx-reader-nav { justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.hx-ads { display: flex; justify-content: center; margin: 16px auto; max-width: 100%; overflow: hidden; }

/* ---------- Footer ---------- */
.hx-footer { margin-top: 60px; padding: 48px 0 30px; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 14px; }
.hx-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.hx-footer h4 { margin-bottom: 14px; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.hx-footer li { margin: 8px 0; }
.hx-footer li a:hover { color: #fff; }
.hx-footer-about img { height: 30px; width: auto; }
.hx-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; }
.hx-age { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-right: 8px; border: 2px solid var(--accent); border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; vertical-align: middle; }

.hx-totop { position: fixed; right: 18px; bottom: 22px; z-index: 90; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.hx-totop.is-visible { opacity: 1; visibility: visible; }

/* Thanh điều hướng dưới (mobile) */
.hx-tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
    .hx-rail-track { grid-auto-columns: calc((100% - 4 * 14px) / 5.3); gap: 14px; }
    .hx-nav > a.hide-lg { display: none; }
}
@media (max-width: 1023px) {
    :root { --header-h: 58px; }
    .hx-nav { display: none; }
    .hx-burger { display: inline-flex; }
    .hx-header-inner { gap: 12px; }
    .hx-rail-track { grid-auto-columns: calc((100% - 3 * 12px) / 4.3); gap: 12px; }
    .hx-rail-btn { display: none; }
    .hx-slide-poster { width: 34vw; }
    .hx-footer-grid { grid-template-columns: 1fr 1fr; }
    .hx-detail { gap: 26px; }
    .hx-detail-poster { width: 210px; }
}
@media (max-width: 767px) {
    body.hx { font-size: 14.5px; padding-bottom: 64px; }
    .hx-hero { min-height: 0; }
    .hx-slide { flex-direction: column-reverse; align-items: flex-start; gap: 18px; min-height: 0; padding-top: 18px; }
    .hx-slide-poster { width: 46%; max-width: 200px; }
    .hx-slide-desc { -webkit-line-clamp: 2; }
    .hx-slide-tags { display: none; }
    .hx-slide-actions .hx-btn { height: 44px; padding: 0 20px; font-size: 15px; }
    .hx-slide-desc { font-size: 15px; line-height: 24px; }
    .hx-rail-track { grid-auto-columns: calc((100% - 2 * 10px) / 2.6); gap: 10px; }
    .hx-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 20px 12px; }
    .hx-card-title { font-size: 13.5px !important; }
    .hx-detail { flex-direction: column; align-items: center; text-align: center; }
    .hx-detail-info { width: 100%; max-width: 100%; }
    .hx-detail-poster { width: 180px; }
    .hx-pills, .hx-stats, .hx-detail-actions, .hx-genres { justify-content: center; }
    .hx-detail-actions .hx-btn { height: 44px; padding: 0 18px; font-size: 15px; }
    .hx-synopsis { margin-left: auto; margin-right: auto; text-align: left; }
    .hx-synopsis-text { font-size: 15px; }
    .hx-stats { gap: 6px 14px; font-size: 13px; }
    .hx-rate { display: flex; gap: 12px; margin-left: auto; margin-right: auto; padding: 8px 12px 8px 8px; text-align: left; }
    .hx-rate-score { gap: 8px; padding-right: 12px; }
    .hx-rate-num [data-rate-avg] { font-size: 26px; }
    .hx-rate-input { flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; }
    .hx-rate-pick button { padding: 2px; }
    .hx-rate-pick button .ic { width: 22px; height: 22px; }
    .hx-rate-hint { min-width: 0; padding-left: 3px; font-size: 12px; }
    /* Dải thông tin: một hàng cuộn ngang thay vì lưới 2 cột */
    .hx-facts { display: flex; gap: 0; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; border: 0; border-radius: 0; background: none; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; text-align: left; }
    .hx-facts::-webkit-scrollbar { display: none; }
    .hx-fact { flex: 0 0 auto; column-gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-right-width: 0; background: rgba(14,14,18,.82); scroll-snap-align: start; }
    .hx-fact:first-child { border-radius: 14px 0 0 14px; }
    .hx-fact:last-child { border-right-width: 1px; border-radius: 0 14px 14px 0; }
    .hx-fact-icon { width: 30px; height: 30px; border-radius: 9px; }
    .hx-fact-icon .ic { width: 15px; height: 15px; }
    .hx-fact dt { font-size: 10px; letter-spacing: .06em; }
    .hx-fact dd { font-size: 13.5px; }
    .hx-taxo { text-align: left; }
    .hx-taxo-row { grid-template-columns: 1fr; gap: 6px; }
    .hx-taxo-label { height: auto; }
    .hx-rate-input { grid-template-columns: auto; }
    .hx-rate-label { padding-left: 3px; }
    .hx-panel, .hx .u-comments { padding: 18px 14px; border-radius: 14px; }
    .hx-input { min-width: 0; width: 100%; }
    .hx-panel-head > * { width: 100%; }
    .hx-eps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hx-ep { min-height: 52px; padding: 7px 10px; }
    .hx-ep-name { font-size: 13.5px; }
    .hx-reader-nav .label { display: none; }
    .hx-reader-page { display: none; }
    .hx-toast { right: 12px; left: 12px; bottom: 76px; max-width: none; }
    .hx-reader-report { display: none; }
    .hx-report-reasons { grid-template-columns: 1fr; }
    .hx-modal { align-items: flex-end; padding: 0; }
    .hx-modal-card { max-width: none; max-height: 90vh; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: hx-sheet-up .22s ease; }
    .hx-chap-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 129; display: block; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
    .hx-chap-panel { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 78vh; padding-bottom: env(safe-area-inset-bottom); border-radius: 22px 22px 0 0; animation: hx-sheet-up .22s ease; }
    .hx-chap-panel::before { content: ""; display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--surface-3); }
    .hx-chap-head { padding-top: 10px; }
    .hx-chap-list a { min-height: 48px; }
}
@media (max-width: 480px) {
    .hx-chap-btn { width: 38px; padding: 0; justify-content: center; }
    .hx-chap-btn-label, .hx-chap-btn > .ic:last-child { display: none; }
    .hx-reader-title h1 { font-size: 14.5px !important; }
    .hx-reader-bar-inner .hx-icon-btn, .hx-reader-nav .hx-btn-sm { width: 38px; height: 38px; padding: 0; }
    .hx-reader-bar-inner { gap: 8px; }
    .hx-end-card h2 { font-size: 19px; }
    .hx-select { max-width: 120px; }
    .hx-footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .hx-header .u-menu:not(.u-menu-mobile) { display: none; }
    .hx-totop { bottom: 78px; }
    .hx-tabbar {
        position: fixed; inset: auto 0 0; z-index: 95; display: grid; grid-template-columns: repeat(5, 1fr); height: 62px;
        padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(8,8,10,.96); backdrop-filter: blur(14px);
    }
    .hx-tabbar a, .hx-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
    .hx-tabbar .is-active { color: #fff; }
    .hx-tabbar .is-active .ic { color: var(--accent); }
}
@media (min-width: 768px) {
    .hx-header .u-menu-mobile { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ Hộp chia sẻ */
.hx-share-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; visibility: hidden; opacity: 0; transition: opacity .2s, visibility .2s; }
.hx-share-modal.is-open { visibility: visible; opacity: 1; }
.hx-share-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); }
.hx-share-dialog { position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; border: 1px solid rgba(255,255,255,.08); border-radius: 24px; background: #141416; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(12px) scale(.98); transition: transform .2s; }
.hx-share-modal.is-open .hx-share-dialog { transform: none; }
.hx-share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.hx-share-head h2 { font-size: 17px; letter-spacing: -.01em; }
.hx-share-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; background: rgba(255,255,255,.06); color: #f5f5f7; cursor: pointer; }
.hx-share-close:hover { background: rgba(255,255,255,.14); }
.hx-share-card { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(255,255,255,.03); }
.hx-share-card img { flex-shrink: 0; width: 52px; height: 78px; border-radius: 8px; background: #1f1f24; object-fit: cover; }
.hx-share-card div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hx-share-card strong { overflow: hidden; color: #f5f5f7; font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hx-share-card span { color: #8b8b96; font-size: 12px; font-weight: 500; }
.hx-share-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px 8px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.03); color: #f5f5f7; font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.hx-share-opt:hover { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); }
.hx-share-opt-ic { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); }
.hx-share-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hx-share-opt-text strong { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.hx-share-opt-text small { overflow: hidden; color: #b4b4be; font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.hx-share-opt.is-primary { border-color: transparent; background: #e50914; }
.hx-share-opt.is-primary:hover { background: #f6121d; }
.hx-share-opt.is-primary .hx-share-opt-ic { background: rgba(0,0,0,.22); }
.hx-share-opt.is-primary small { color: rgba(255,255,255,.85); }
.hx-share-opt.is-busy { opacity: .65; pointer-events: none; }
.hx-share-label { margin: 8px 0 -2px; color: #8b8b96; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-share-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hx-share-apps a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.03); color: #f5f5f7; font-size: 14px; font-weight: 700; transition: background .15s, border-color .15s; }
.hx-share-apps a:hover { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); }
.hx-share-apps .ic { width: 16px; height: 16px; }
.hx-share-apps .is-wa .ic { color: #25d366; }
.hx-share-apps .is-tg .ic { color: #2aabee; }
.hx-share-apps .is-fb .ic { color: #1877f2; }
.hx-share-apps .is-rd .ic { color: #ff4500; }
.hx-share-apps .is-pin .ic { color: #e60023; }
@media (max-width: 640px) {
    .hx-share-modal { align-items: flex-end; padding: 0; }
    .hx-share-dialog { max-width: none; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; transform: translateY(40px); }
    .hx .hx-panel-head h2 { font-size: 22px; }
}

/* ------------------------------------------------------------------ Đánh giá: điểm trong dòng thống kê + nút Rate */
.hx-stats .hx-stat-rate { gap: 5px; }
.hx-stats .hx-stat-rate .ic { color: var(--gold); fill: currentColor; }
.hx-stat-rate strong { color: #f5f5f7; font-weight: 700; }
.hx-stat-rate small { color: #8b8b96; font-size: 13px; font-weight: 600; }
.hx-rate-wrap { position: relative; }
.hx-detail-actions .hx-rate-btn.is-rated { border-color: rgba(245,197,24,.4); background: rgba(245,197,24,.14); }
.hx-detail-actions .hx-rate-btn.is-rated:hover { background: rgba(245,197,24,.22); }
.hx-detail-actions .hx-rate-btn.is-rated .ic { color: var(--gold); fill: currentColor; }
.hx-detail-actions .hx-rate-btn[aria-expanded="true"] { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.18); }
.hx-rate-pop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 60; width: max-content; padding: 14px 16px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: #141416; box-shadow: 0 20px 50px rgba(0,0,0,.55); text-align: center; animation: hx-pop-in .16s ease; }
.hx-rate-pop[hidden] { display: none; }
.hx-rate-pop-title { margin-bottom: 6px; color: #8b8b96; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hx-rate-pop .hx-rate-pick { display: flex; justify-content: center; gap: 2px; }
.hx-rate-pop .hx-rate-pick button { padding: 4px; border-radius: 10px; color: #3a3a42; }
.hx-rate-pop .hx-rate-pick button .ic { fill: currentColor !important; stroke: currentColor; }
.hx-rate-pop .hx-rate-pick button.is-on { color: var(--gold); }
.hx-rate-pop .hx-rate-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hx-rate-pop .hx-rate-hint { min-width: 0; margin-top: 6px; color: #b4b4be; font-size: 13px; font-weight: 600; white-space: nowrap; }
.hx-rate-pop .hx-rate-hint strong { color: var(--gold); }

/* Tiêu đề H1 trang chủ (ngay dưới slider) */
.hx-home-head { padding: 34px 0 4px; }
.hx-home-head h1 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.025em; }
.hx-home-head p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
@media (max-width: 640px) { .hx-home-head { padding-top: 22px; } .hx-home-head p { font-size: 14px; } }

/* ------------------------------------------------------------------ Trang văn bản (About, Contact, Privacy, DMCA) */
.hx-doc { max-width: 1120px; margin: 0 auto; padding: 8px 0 64px; }
.hx-doc-head { max-width: 760px; padding: 26px 0 40px; }
.hx-doc-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 18px; border: 1px solid rgba(226,73,123,.35); border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); }
.hx-doc-head h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -.025em; }
.hx-doc-head .hx-doc-lead { margin: 12px 0 0; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.hx-doc-grid { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 56px; align-items: start; }
.hx-doc-grid.is-single { grid-template-columns: minmax(0, 760px); }
.hx-doc-toc { position: sticky; top: 96px; }
.hx-doc-toc-label { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hx-doc-toc ol { margin: 0; padding: 0; list-style: none; }
.hx-doc-toc a { display: flex; gap: 10px; padding: 6px 8px 6px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.4; transition: color .15s, border-color .15s; }
.hx-doc-toc a span { flex-shrink: 0; color: inherit; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .7; }
.hx-doc-toc a:hover { color: #f5f5f7; }
.hx-doc-toc a.is-active { border-left-color: var(--accent); color: #f5f5f7; }
.hx-doc-toc a.is-active span { color: var(--accent-2); opacity: 1; }
.hx-doc-body { color: #b4b4be; font-size: 16px; line-height: 28px; }
.hx-doc-sec { padding: 32px 0; border-top: 1px solid rgba(255,255,255,.08); scroll-margin-top: 96px; }
.hx-doc-sec:first-child { padding-top: 0; border-top: 0; }
.hx-doc-body h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; color: #f5f5f7; font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.hx-doc-num { flex-shrink: 0; color: var(--accent-2); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hx-doc-body h3 { margin: 22px 0 8px; color: #f5f5f7; font-size: 17px; font-weight: 700; }
.hx-doc-body p { margin: 0 0 14px; }
.hx-doc-body p:last-child, .hx-doc-body ul:last-child { margin-bottom: 0; }
.hx-doc-body ul { margin: 0 0 14px; padding-left: 20px; }
.hx-doc-body li { margin: 6px 0; }
.hx-doc-body li::marker { color: var(--accent-2); }
@media (max-width: 1023px) {
    .hx-doc-grid { grid-template-columns: minmax(0, 1fr); }
    .hx-doc-toc { display: none; }
}
@media (max-width: 640px) {
    .hx-doc-head { padding: 18px 0 28px; }
    .hx-doc-lead { font-size: 15.5px; }
    .hx-doc-body { font-size: 15.5px; line-height: 26px; }
    .hx-doc-body h2 { font-size: 20px; }
    .hx-doc-sec { padding: 26px 0; }
}

/* ------------------------------------------------------------------ Hero bản mobile (giống dramaflix) */
.hx-mhero { display: none; padding-top: var(--header-h); background: radial-gradient(120% 70% at 50% 0%, rgba(226,73,123,.16), transparent 70%); }
.hx-mhero-track { position: relative; display: flex; gap: 12px; overflow-x: auto; padding: 20px 12vw 8px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hx-mhero-track::-webkit-scrollbar { display: none; }
.hx-mhero-slide { flex: 0 0 76vw; max-width: 360px; scroll-snap-align: center; }
.hx-mhero-card { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 44px rgba(0,0,0,.55); transform: scale(.94); transition: transform .3s ease; }
.hx-mhero-slide.is-active .hx-mhero-card { transform: none; }
.hx-mhero-card img { width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }
.hx-mhero-text { position: absolute; inset: auto 0 0 0; padding: 64px 16px 16px; background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 55%, transparent 100%); }
.hx-mhero-meta { display: block; margin-bottom: 4px; color: #b4b4be; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hx-mhero-title { display: -webkit-box; overflow: hidden; color: #fff; font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-mhero-actions { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; }
.hx-mhero-actions .hx-mhero-read { flex: 1; height: 44px; padding: 0 20px; font-size: 15px; font-weight: 800; }
.hx-mhero-info { display: grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); color: #f5f5f7; }
.hx-mhero-dots { display: flex; justify-content: center; gap: 6px; padding: 6px 0 4px; }
.hx-mhero-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: rgba(139,139,150,.4); cursor: pointer; transition: width .25s ease, background-color .25s ease; }
.hx-mhero-dots button.is-active { width: 20px; background: var(--accent); }
@media (max-width: 767px) {
    .hx-hero { display: none; }
    .hx-mhero { display: block; }
}


/* =========================================================================
   Khu VIDEO (dùng chung header / footer và thẻ với phần truyện)
   .hx-vpage: khung chung của mọi trang video — cỡ chữ / khoảng cách thống nhất
   ========================================================================= */
/* Thẻ video: cùng khung poster với thẻ truyện, thêm nhãn Uncensored và nút play khi rê chuột */
.hx-card-unc { position: absolute; top: 0; left: 0; z-index: 3; padding: 4px 9px 4px 8px; border-radius: 0 0 8px 0; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hx-vcard-play { position: absolute; top: 50%; left: 50%; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(226,73,123,.92); color: #fff; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(0,0,0,.45); pointer-events: none; }
.hx-vcard-play .ic { margin-left: 3px; fill: currentColor; }
.hx-vcard:hover .hx-vcard-play { opacity: 1; transform: scale(1); }
.hx-vcard .hx-card-ep { font-size: 11.5px; font-weight: 600; }

/* --- Nhịp chữ chung cho trang video --- */
.hx-vpage .hx-crumbs { padding-top: 20px; font-size: 13px; }
.hx-vpage .hx-page-head { padding: 26px 0 4px; }
.hx-vpage .hx-page-head h1 { font-size: clamp(26px, 2.8vw, 36px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.hx-vpage .hx-page-intro { max-width: 760px; margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.hx-vpage .hx-page-intro strong { color: var(--text); font-weight: 600; }
.hx-vpage .hx-filterbar { margin: 20px 0 6px; }
.hx-vpage .hx-section { padding: 26px 0 14px; }
.hx-vpage .hx-section-head { margin-bottom: 14px; }
.hx-vpage .hx-section-title { gap: 9px; font-size: clamp(20px, 1.9vw, 24px); letter-spacing: -.015em; }
.hx-vpage .hx-section-title .ic { width: 22px; height: 22px; }
.hx-vpage .hx-grid { gap: 24px 16px; }
.hx-vpage .hx-card-title { margin-top: 9px !important; font-size: 14px !important; line-height: 1.4 !important; }
.hx-vpage .hx-card-meta { margin-top: 3px; font-size: 12.5px; }
.hx-vpage .hx-panel { padding: 24px 26px; border-radius: 16px; }
.hx-vpage .hx-panel-head { margin-bottom: 14px; }
.hx-vpage .hx-panel-head h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; }
.hx-vpage .hx-prose { font-size: 15px; line-height: 1.75; }
.hx-vpage .hx-prose p { margin: 0 0 .9em; }
.hx-vpage .hx-prose p:last-child { margin-bottom: 0; }
.hx-vpage .hx-prose h2 { margin: 1.5em 0 .45em; font-size: 18px; line-height: 1.35; letter-spacing: -.01em; }
.hx-vpage .hx-prose h2:first-child { margin-top: 0; font-size: 22px; }
.hx-vpage .hx-about { margin-top: 30px; }
.hx-vpage .hx-terms { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 18px; }
.hx-vpage .hx-terms a { min-height: 52px; padding: 10px 14px; }
/* Tên series / hãng dài: tối đa 2 dòng thay vì cắt cụt 1 dòng */
.hx-vpage .hx-terms h3 { display: -webkit-box; font-size: 14px !important; line-height: 1.4; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-vpage .hx-az { margin-top: 12px; }
.hx-vpage .hx-pager { margin-top: 30px; }
.hx-vpage .u-comments h2 { font-size: 22px; letter-spacing: -.015em; }

/* --- Trang xem video: trình phát 70% + danh sách tập 30% --- */
.hx-watch { padding-bottom: 8px; }
.hx-watch > .hx-panel, .hx-watch > .hx-section, .hx-watch > .u-comments { margin-top: 26px; }
.hx-watch-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 18px; margin-top: 14px; }
.hx-watch-top > .hx-player:only-child { grid-column: 1 / -1; }
.hx-player { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; background: #000 center / cover no-repeat; box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(0,0,0,.45); }
.hx-player::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.hx-player iframe { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; }

/* Cột phải cao đúng bằng trình phát (contain: size), danh sách tập cuộn bên trong */
.hx-wside { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); contain: size; }
.hx-wside-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.hx-wside-head h2 { display: -webkit-box; min-width: 0; overflow: hidden; font-family: var(--font); font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-wside-head span { flex-shrink: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.hx-wside-list { flex: 1; min-height: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.hx-wep { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px; border-radius: 10px; transition: background .15s; }
.hx-wep:hover { background: var(--surface); }
.hx-wep.is-now { background: var(--accent-soft); }
.hx-wep-thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 8px; background: var(--surface-2); }
.hx-wep-thumb img { width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }
.hx-wep-no, .hx-wep-now { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 5px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.4; }
.hx-wep-now { background: var(--accent); }
.hx-wep-now .ic { fill: currentColor; }
.hx-wep-text { min-width: 0; }
.hx-wep-name { display: -webkit-box; overflow: hidden; color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hx-wep.is-now .hx-wep-name, .hx-wep:hover .hx-wep-name { color: var(--accent-2); }
.hx-wep-date { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* Phần dưới trình phát: cột chính 70% (thông tin, bình luận) + cột phải 30% (liên quan, cùng hãng, thể loại) */
.hx-watch-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.hx-watch-main > .u-comments { margin-top: 26px; }
.hx-watch-aside { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.hx-abox { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.hx-abox-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.hx-abox-head h2, .hx-abox-head h3 { min-width: 0; overflow: hidden; font-family: var(--font); font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.hx-abox-head a { display: inline-flex; flex-shrink: 0; align-items: center; gap: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.hx-abox-head a:hover { color: #fff; }
.hx-abox-list { padding: 6px; }
.hx-abox-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 16px; }
.hx-abox-tags a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s; }
.hx-abox-tags a:hover { border-color: var(--line-2); background: var(--surface-2); }
.hx-abox-tags span { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }

/* Thông tin video dưới trình phát */
.hx-watch-info { margin-top: 22px; }
.hx-watch-info .hx-pills { gap: 8px; }
.hx-watch-info .hx-pill { height: 26px; padding: 0 11px; font-size: 11.5px; }
.hx-watch-info .hx-pill-artist { font-size: 12.5px; }
.hx-watch-info h1 { margin-top: 12px; font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; line-height: 1.22; letter-spacing: -.02em; }
.hx-watch-info .hx-detail-alt { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.hx-watch-info .hx-stats { gap: 8px 18px; margin-top: 12px; font-size: 13.5px; }
.hx-watch-info .hx-detail-actions { gap: 10px; margin-top: 18px; }
.hx-watch-info .hx-detail-actions .hx-btn { height: 42px; padding: 0 18px; font-size: 14px; font-weight: 700; }
.hx-watch-info .hx-synopsis { margin-top: 12px; }
.hx-watch-info .hx-synopsis-text { font-size: 15px; line-height: 1.7; }
.hx-watch-info .hx-genres { gap: 8px; margin-top: 16px; }
.hx-pill-unc { background: var(--accent); }
.hx-pill-unc:hover { background: var(--accent-dark); }

/* Box "About": câu mở đầu + tóm tắt + bảng thông tin + thể loại (một khối duy nhất) */
.hx-vabout { margin-top: 22px; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.hx-vabout h2 { font-family: var(--font); font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.hx-watch-info .hx-vabout-lead { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hx-vabout-lead strong { color: var(--text); font-weight: 600; }
.hx-watch-info .hx-vabout .hx-synopsis { max-width: none; margin-top: 14px; }
.hx-watch-info .hx-vabout .hx-synopsis-text { color: var(--text-2); font-size: 15px; line-height: 1.7; }
.hx-vabout-genres { display: flex; align-items: baseline; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.hx-vabout-label { flex-shrink: 0; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hx-watch-info .hx-vabout-genres .hx-genres { margin-top: 0; }
@media (max-width: 767px) {
    .hx-vabout { padding: 16px; }
    .hx-vabout h2 { font-size: 17px; }
    .hx-vabout-genres { flex-direction: column; gap: 10px; }
    .hx-watch-info .hx-vabout .hx-synopsis-text { font-size: 14.5px; }
}

/* Bảng thông tin trong box About (Series, Episode, Studio, Version, Subtitles, Released) */
.hx-vfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px 20px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.hx-vfacts dt { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hx-vfacts dd { margin: 5px 0 0; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; }
.hx-vfacts dd a { color: var(--text); }
.hx-vfacts dd a:hover { color: var(--accent-2); }
@media (max-width: 1023px) { .hx-vfacts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hx-vfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; } }

/* Footer có thêm cột Videos */
.hx-footer-grid { grid-template-columns: 1.6fr repeat(4, 1fr); }

@media (max-width: 1279px) {
    .hx-watch-top { grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); }
    .hx-wep { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 1023px) {
    .hx-footer-grid { grid-template-columns: 1fr 1fr; }
    /* Máy tính bảng / điện thoại: danh sách tập xuống dưới trình phát */
    /* Thứ tự: trình phát → tiêu đề / nút → danh sách tập → phần còn lại (khung .hx-watch-top "mở" ra bằng display: contents) */
    .hx-watch { display: flex; flex-direction: column; }
    .hx-watch > * { order: 7; }
    .hx-watch > .hx-crumbs { order: 0; }
    .hx-watch-top, .hx-watch-body, .hx-watch-main { display: contents; }
    .hx-player { order: 1; margin-top: 14px; }
    .hx-watch-info { order: 2; }
    .hx-watch-main > .u-comments { order: 5; }
    .hx-watch-aside { order: 6; margin-top: 26px; }
    .hx-wside { order: 3; margin-top: 22px; contain: none; }
    .hx-wside-list { max-height: 360px; }
}
@media (max-width: 767px) {
    .hx-vpage .hx-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .hx-vpage .hx-terms a { padding: 9px 12px; }
    .hx-vpage .hx-page-head { padding-top: 18px; }
    .hx-vpage .hx-page-intro { font-size: 14px; }
    .hx-vpage .hx-panel { padding: 18px 16px; }
    .hx-vpage .hx-panel-head h2, .hx-vpage .u-comments h2 { font-size: 19px; }
    .hx-vpage .hx-prose { font-size: 14.5px; }
    .hx-vpage .hx-prose h2 { font-size: 17px; }
    .hx-vpage .hx-prose h2:first-child { font-size: 19px; }
    .hx-vpage .hx-section-title { font-size: 19px; }
    .hx-vpage .hx-card-title { font-size: 13.5px !important; }
    /* Trang xem video căn trái như trình phát video quen thuộc (trang truyện căn giữa) */
    .hx-watch-info .hx-pills, .hx-watch-info .hx-stats, .hx-watch-info .hx-detail-actions, .hx-watch-info .hx-genres { justify-content: flex-start; }
    .hx-watch-info h1 { font-size: 21px; }
    .hx-watch-info .hx-stats { gap: 6px 14px; font-size: 13px; }
    .hx-watch-info .hx-detail-actions { gap: 8px; }
    .hx-watch-info .hx-detail-actions .hx-btn { height: 40px; padding: 0 14px; }
    .hx-watch-info .hx-synopsis-text { font-size: 14.5px; }
}
@media (max-width: 560px) {
    .hx-player { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); border-radius: 0; }
    /* Breadcrumb 1 dòng, vuốt ngang khi dài */
    .hx-vpage .hx-crumbs { flex-wrap: nowrap; overflow-x: auto; padding-top: 14px; font-size: 12.5px; white-space: nowrap; scrollbar-width: none; }
    .hx-vpage .hx-crumbs::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) { .hx-footer-grid { grid-template-columns: 1fr; } }
/* Tablet: cột phải chuyển xuống dưới bình luận, xếp 2 khối cạnh nhau */
@media (min-width: 640px) and (max-width: 1023px) {
    .hx-watch-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .hx-watch-aside > .hx-abox:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Thẻ video ở cột phải: ảnh nhỏ hơn danh sách tập để cột phải không dài quá cột chính */
.hx-abox .hx-wep { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 6px; }
.hx-abox .hx-wep-name { font-size: 13px; }
.hx-abox .hx-wep-date { margin-top: 3px; font-size: 11.5px; }
.hx-abox-tags { gap: 6px; padding: 12px 14px 14px; }
.hx-abox-tags a { height: 30px; font-size: 12.5px; }
/* Nút Report trên trang xem video: tông nhạt hơn các nút chính, chỉ còn icon trên điện thoại */
.hx-watch-info .hx-detail-actions .hx-btn-report { color: var(--text-2) !important; }
.hx-watch-info .hx-detail-actions .hx-btn-report:hover { color: #fff !important; }
@media (max-width: 480px) {
    .hx-watch-info .hx-detail-actions .hx-btn-report { width: 40px; padding: 0; justify-content: center; }
    .hx-watch-info .hx-detail-actions .hx-btn-report span { display: none; }
}
/* Video chưa có nguồn phát: thông báo thay cho trình phát trống */
.hx-player-off { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; color: var(--text-2); font-size: 14px; text-align: center; }
.hx-player-off .ic { width: 52px; height: 52px; padding: 14px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.hx-player-off strong { color: #fff; font-size: 17px; }
.hx-player-off button { padding: 0; border: 0; background: none; color: var(--accent-2); font: inherit; text-decoration: underline; cursor: pointer; }
/* Trang 404 */
.hx-404 { padding: 56px 0 40px; text-align: center; }
.hx-404-code { color: var(--accent); font-family: var(--font-display); font-size: clamp(72px, 12vw, 128px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hx-404 h1 { margin-top: 10px; font-size: clamp(24px, 3vw, 34px); }
.hx-404 .hx-page-intro { margin: 12px auto 0; }
.hx-404-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.hx-404-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 28px auto 0; }
.hx-404-links a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; }
.hx-404-links a:hover { border-color: var(--line-2); color: #fff; }
