/* =====================================================================
   STRIPNOVELS – Stylesheet chính
   Tone: Đỏ crimson & Đen than (lấy cảm hứng header đỏ / nền tối),
   tối ưu cho việc đọc chữ. Theme: dark (mặc định) · light · sepia.
   ===================================================================== */

/* ---------- 0. Màu nền & màu chữ của trang – CỐ Ý ĐỂ NGOÀI LAYER ----------
   Rule này không nằm trong @layer để luôn thắng mọi reset do host/khung nhúng chèn vào
   (ví dụ khung xem trước đặt body{background:#fff;color:#000}). Nền và chữ luôn lấy từ
   token theo theme: nền sáng → chữ tối, nền tối → chữ sáng. */
html body {
  background: rgb(var(--c-bg));
  color: rgb(var(--c-ink));
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* Phần còn lại nằm trong layer `components` (thấp hơn layer `utilities` của Tailwind v4)
   → các class tiện ích như .hidden, .mb-8, .lg:grid-cols-2 luôn thắng khi đặt trên cùng phần tử. */
@layer components {

/* ---------- 1. Design tokens ---------- */
:root {
  --c-bg: 11 11 14;          /* #0B0B0E */
  --c-surface: 20 20 24;     /* #141418 */
  --c-surface2: 29 29 35;    /* #1D1D23 */
  --c-line: 255 255 255;     /* viền: dùng với alpha */
  --c-ink: 242 242 243;
  --c-muted: 156 156 166;
  --c-brand: 209 26 42;      /* #D11A2A */
  --header-grad: linear-gradient(90deg, #B5121B 0%, #8E0E1B 100%);
  --subnav-bg: #141418;
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(209,26,42,.28) 0%, rgba(209,26,42,0) 70%);
  --shadow-card: 0 10px 30px -10px rgba(0,0,0,.55);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 60px;
  --subnav-h: 44px;
  --bottomnav-h: 60px;
  --reader-size: 18px;
  --reader-lh: 1.8;
  --reader-font: "Times New Roman", Times, "Liberation Serif", serif;
  --reader-width: 760px;
  color-scheme: dark !important;
}
:root[data-theme="light"] {
  --c-bg: 246 246 248;
  --c-surface: 255 255 255;
  --c-surface2: 240 240 244;
  --c-line: 0 0 0;
  --c-ink: 24 24 27;
  --c-muted: 98 98 110;
  --subnav-bg: #ffffff;
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(209,26,42,.14) 0%, rgba(209,26,42,0) 70%);
  --shadow-card: 0 10px 30px -14px rgba(0,0,0,.25);
  color-scheme: light !important;
}
:root[data-theme="sepia"] {
  --c-bg: 244 236 216;
  --c-surface: 250 245 232;
  --c-surface2: 236 226 204;
  --c-line: 80 60 30;
  --c-ink: 58 44 30;
  --c-muted: 122 100 72;
  --subnav-bg: #f6efdd;
  --glow: radial-gradient(60% 60% at 50% 0%, rgba(181,18,27,.14) 0%, rgba(181,18,27,0) 70%);
  --shadow-card: 0 10px 30px -14px rgba(60,40,10,.3);
  color-scheme: light !important;
}

/* ---------- 2. Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  transition: background-color .25s ease, color .25s ease;
}
body.has-bottom-nav { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { body.has-bottom-nav { padding-bottom: 0; } }
::selection { background: rgba(209,26,42,.35); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid #E8404F; outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #D11A2A; color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; }
.container-x { width: 100%; max-width: 1280px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 1024px) { .container-x { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.line-clamp-1, .line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-1 { -webkit-line-clamp: 1; } .line-clamp-2 { -webkit-line-clamp: 2; } .line-clamp-3 { -webkit-line-clamp: 3; }
.text-brand { color: #E8404F; }
.border-base { border-color: rgb(var(--c-line) / .08); }
.text-muted { color: rgb(var(--c-muted)); }
.bg-glow { background-image: var(--glow); }
hr { border-color: rgb(var(--c-line) / .08); }

/* ---------- 3. Header (thanh đỏ) + Sub-nav ---------- */
/* #site-header là ô chứa do JS đổ vào; display:contents để thanh đỏ ghim theo toàn bộ trang (sticky bị giới hạn bởi phần tử cha) */
#site-header { display: contents; }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--header-grad); color: #fff; box-shadow: 0 2px 18px rgba(0,0,0,.35); }
.site-header .hdr { height: var(--header-h); display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #0B0B0E; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { line-height: .95; font-family: Anton, "Be Vietnam Pro", Impact, sans-serif; letter-spacing: .5px; text-transform: uppercase; }
.brand-text .l1 { font-size: 20px; display: block; }
.brand-text .l2 { font-size: 10.5px; letter-spacing: 2.2px; display: block; opacity: .92; }
.brand img.brand-logo { height: 36px; width: auto; }
.brand .brand-svg { height: 40px; width: auto; display: block; --logo-accent: #FFD166; }
.site-footer .brand .brand-svg { height: 44px; --logo-accent: #F5B301; }
:root[data-theme="light"] .site-footer .brand .brand-svg, :root[data-theme="sepia"] .site-footer .brand .brand-svg { --logo-accent: #B5121B; }
.drawer .dr-head .brand-svg { height: 36px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: transparent; border: 0; cursor: pointer; color: inherit; transition: background .15s; flex-shrink: 0; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn svg { width: 22px; height: 22px; }
.badge-dot { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #F5B301; color: #1a1a1a; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #9E101C; }
.nav-main { display: none; align-items: center; gap: 2px; margin-left: 6px; }
@media (min-width: 1024px) { .nav-main { display: flex; } }
.nav-main a { padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14.5px; opacity: .92; white-space: nowrap; text-decoration: none; }
.nav-main a:hover, .nav-main a.active { background: rgba(255,255,255,.14); opacity: 1; }
.search-wrap { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search-input { width: 100%; height: 40px; border-radius: 999px; border: 0; padding: 0 44px 0 42px; background: rgba(0,0,0,.28); color: #fff; outline: none; font-size: 14.5px; transition: background .15s, box-shadow .15s; }
.search-input::placeholder { color: rgba(255,255,255,.72); }
.search-input:focus { background: rgba(0,0,0,.45); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; opacity: .85; pointer-events: none; }
.search-submit { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 999px; background: #0B0B0E; border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; }
.search-submit svg { width: 16px; height: 16px; }
.search-pop { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line) / .1); border-radius: 14px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); overflow: hidden; display: none; max-height: 70vh; overflow-y: auto; }
.search-pop.open { display: block; }
.search-pop .sp-title { padding: 10px 14px 4px; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: rgb(var(--c-muted)); font-weight: 700; }
.search-pop a.sp-item { display: flex; gap: 10px; align-items: center; padding: 8px 14px; text-decoration: none; }
.search-pop a.sp-item:hover, .search-pop a.sp-item.active { background: rgb(var(--c-line) / .06); }
.search-pop .sp-cover { width: 34px; height: 46px; border-radius: 6px; flex-shrink: 0; }
.search-pop .sp-tag { display: inline-block; margin: 6px 6px 10px 14px; padding: 5px 10px; border-radius: 999px; background: rgb(var(--c-line) / .07); font-size: 13px; text-decoration: none; }
.search-pop .sp-tag:hover { background: rgba(209,26,42,.2); color: #E8404F; }
.search-mobile { display: none; }
@media (max-width: 767px) {
  .search-wrap { display: none; }
  .search-wrap.mobile-open { display: block; position: fixed; left: 10px; right: 10px; top: 10px; max-width: none; z-index: 60; }
  .search-mobile { display: inline-grid; }
}
.subnav { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 49; background: var(--subnav-bg); border-bottom: 1px solid rgb(var(--c-line) / .08); box-shadow: 0 6px 18px -12px rgba(0,0,0,.5); }
.subnav .row { height: var(--subnav-h); display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.subnav a { white-space: nowrap; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: rgb(var(--c-ink) / .86); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; position: relative; }
.subnav a:hover { background: rgb(var(--c-line) / .07); color: rgb(var(--c-ink)); }
.subnav a.active { color: #E8404F; }
.subnav a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: #E8404F; border-radius: 2px; }
.subnav a.adult { color: #E8404F; }

/* Menu tài khoản ở header */
.user-menu { position: relative; }
.user-menu .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 230px; background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line) / .1); border-radius: 14px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); overflow: hidden; z-index: 40; }
.user-pop .up-head { padding: 12px 14px; border-bottom: 1px solid rgb(var(--c-line) / .08); display: flex; flex-direction: column; }
.user-pop .up-head span { font-size: 12px; color: #E8404F; font-weight: 700; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; color: inherit; }
.user-pop a:hover, .user-pop button:hover { background: rgb(var(--c-line) / .06); }
.user-pop svg { width: 18px; height: 18px; opacity: .8; }

/* Bộ chọn ngôn ngữ */
.lang-menu { position: relative; flex-shrink: 0; }
.lang-menu .lang-code { font-size: 12px; font-weight: 800; letter-spacing: .5px; padding: 3px 7px; border-radius: 7px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.25); }
.lang-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line) / .1); border-radius: 12px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); padding: 6px; display: none; z-index: 60; }
.lang-pop.open { display: block; }
.lang-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; color: inherit; }
.lang-pop button:hover { background: rgb(var(--c-line) / .07); }
.lang-pop button.active { color: #E8404F; background: rgba(209,26,42,.12); }

/* Drawer (mobile) */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: rgb(var(--c-surface)); z-index: 71; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); overflow-y: auto; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
.drawer-open .drawer { transform: none; } .drawer-open .drawer-bg { opacity: 1; pointer-events: auto; }
.drawer .dr-head { background: var(--header-grad); color: #fff; padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.drawer a.dr-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgb(var(--c-line) / .06); }
.drawer a.dr-link svg { width: 20px; height: 20px; opacity: .8; }
.drawer a.dr-link.active { color: #E8404F; }
.drawer .dr-cat { padding: 12px 16px; }
.drawer .dr-cat a { display: block; padding: 8px 0; font-size: 14px; text-decoration: none; }

/* Bottom nav (mobile) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 49; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgb(var(--c-surface) / .96); backdrop-filter: blur(14px); border-top: 1px solid rgb(var(--c-line) / .1); display: grid; grid-template-columns: repeat(5, 1fr); }
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: rgb(var(--c-muted)); text-decoration: none; position: relative; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: #E8404F; }
.bottom-nav .badge-dot { top: 6px; right: calc(50% - 20px); box-shadow: 0 0 0 2px rgb(var(--c-surface)); }

/* ---------- 4. Nút, chip, thẻ ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; font-weight: 700; font-size: 14.5px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(180deg, #E0233A, #B5121B); color: #fff; box-shadow: 0 8px 22px -8px rgba(209,26,42,.7); }
.btn-primary:hover { background: linear-gradient(180deg, #E8404F, #C9182B); }
.btn-ghost { background: rgb(var(--c-line) / .07); border-color: rgb(var(--c-line) / .1); }
.btn-ghost:hover { background: rgb(var(--c-line) / .12); }
.btn-outline { background: transparent; border-color: rgba(232,64,79,.6); color: #E8404F; }
.btn-outline:hover { background: rgba(209,26,42,.12); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgb(var(--c-line) / .07); border: 1px solid rgb(var(--c-line) / .08); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.chip:hover { background: rgb(var(--c-line) / .12); }
.chip.active, .chip[aria-pressed="true"] { background: rgba(209,26,42,.18); border-color: rgba(232,64,79,.6); color: #E8404F; }
.chip-sm { padding: 3px 9px; font-size: 12px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: rgb(var(--c-line) / .07); text-decoration: none; }
.tag:hover { background: rgba(209,26,42,.18); color: #E8404F; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.badge-full { background: #10B981; color: #04120c; }
.badge-ongoing { background: #F5B301; color: #1a1300; }
.badge-hot { background: linear-gradient(90deg, #E8404F, #B5121B); color: #fff; }
.badge-adult { background: #DC2626; color: #fff; }
.badge-new { background: #3B82F6; color: #fff; }
.card { background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); border-radius: var(--radius); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { font-size: 19px; font-weight: 800; letter-spacing: -.2px; display: inline-flex; align-items: center; gap: 8px; }
.section-title h2::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, #E8404F, #8E0E1B); }
.section-title a.more { font-size: 13px; font-weight: 700; color: #E8404F; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.section-title a.more svg { width: 16px; height: 16px; }
@media (min-width: 768px) { .section-title h2 { font-size: 22px; } }

/* ---------- 5. Bìa truyện & thẻ truyện (hình cuốn sách) ---------- */
/* Cuốn sách bìa cứng kiểu in nhũ vàng, hơi nghiêng 3D: mặt bìa (gradient/ảnh) + gáy có nếp gấp (::before)
   + khối giấy nhô ra sau ở mép phải & đáy (::after). Ảnh tác giả tải lên chỉ thay mặt bìa. */
:root { --foil: #E9CC7A; --foil-2: #B8902F; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px; background: #1D1D23; container-type: inline-size; isolation: isolate;
  margin-right: 5%; margin-bottom: 2%;
  box-shadow: 12px 16px 30px -10px rgba(0,0,0,.8), 2px 3px 8px -3px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08);
  transform: perspective(1000px) rotateY(-6deg); transform-origin: left center; transition: transform .35s ease, box-shadow .35s ease; }
.cover .cv-front > img, .cover .cv-front > .cv-art { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.cover .cv-front > img { width: 100%; height: 100%; object-fit: cover; }
.cover .cv-art { background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.45) 100%), var(--cv-grad, linear-gradient(160deg, #7C3AED, #1E1B4B)); }
/* vân vải bìa + ánh sáng + bóng */
.cover .cv-art::before { content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.028) 0 1px, transparent 1px 3px),
    linear-gradient(115deg, rgba(255,255,255,.26) 0%, rgba(255,255,255,.07) 30%, transparent 48%),
    radial-gradient(80% 60% at 100% 100%, rgba(0,0,0,.5), transparent 65%); }
/* khung nhũ vàng kép */
.cover .cv-art::after { content: ""; position: absolute; top: 4.5%; bottom: 4.5%; left: 13%; right: 6%; pointer-events: none; border-radius: 2px;
  border: 1px solid rgba(233,204,122,.85); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(233,204,122,.45), 0 0 0 1px rgba(0,0,0,.25); }
/* nhãn thể loại nhỏ phía trên tiêu đề */
.cover .cv-genre { position: absolute; left: 16%; right: 9%; top: 15.5%; text-align: center; color: var(--foil); font-size: clamp(6px, 4.6cqw, 9px); letter-spacing: 2.2px; text-transform: uppercase; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; opacity: .95; }
.cover .cv-genre::before, .cover .cv-genre::after { content: "◆"; font-size: .7em; margin: 0 .6em; opacity: .9; vertical-align: 1px; }
/* tiêu đề: giữa bìa, hai đường kẻ nhũ trên – dưới */
.cover .cv-title { position: absolute; left: 16%; right: 9%; top: 24%; height: 44%; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-family: Anton, "Be Vietnam Pro", Impact, sans-serif; font-size: calc(clamp(9px, 14cqw, 30px) * var(--tf, 1)); line-height: 1.12; text-transform: uppercase; letter-spacing: .5px; text-shadow: 0 1px 0 rgba(255,255,255,.22), 0 -1px 0 rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.55); word-break: break-word; overflow: hidden; z-index: 2; }
.cover .cv-title::before, .cover .cv-title::after { content: ""; position: absolute; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, var(--foil) 25%, var(--foil) 75%, transparent); opacity: .9; }
.cover .cv-title::before { top: 0; } .cover .cv-title::after { bottom: 0; }
/* tác giả */
.cover .cv-author { position: absolute; left: 16%; right: 9%; top: 71%; text-align: center; color: rgba(255,255,255,.9); font-size: clamp(7px, 5.6cqw, 11px); letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
/* Gáy sách: nếp gấp sáng – tối, gờ ngang nhũ */
.cover::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 9%; z-index: 3; pointer-events: none; border-radius: 3px 0 0 3px;
  background:
    linear-gradient(180deg, transparent 8%, rgba(233,204,122,.55) 8%, rgba(233,204,122,.55) 8.6%, transparent 8.6%, transparent 91%, rgba(233,204,122,.55) 91%, rgba(233,204,122,.55) 91.6%, transparent 91.6%),
    linear-gradient(90deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,.32) 30%, rgba(255,255,255,.24) 58%, rgba(255,255,255,.06) 70%, rgba(0,0,0,.42) 86%, rgba(0,0,0,.12) 100%);
  box-shadow: 2px 0 3px -1px rgba(0,0,0,.5); }
/* Khối giấy nhô ra sau bìa */
.cover::after { content: ""; position: absolute; top: 2%; left: 6%; right: -5%; bottom: -2%; z-index: -1; pointer-events: none; border-radius: 2px 5px 5px 2px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.26), transparent 60%) right 0 top 0 / 6% 100% no-repeat,
    linear-gradient(0deg, rgba(0,0,0,.28), transparent 70%) left 0 bottom 0 / 100% 3.5% no-repeat,
    repeating-linear-gradient(180deg, #F8F2E4 0 1.5px, #DAD0BA 1.5px 2.5px, #F0E7D5 2.5px 3px) right 0 top 0 / 6% 100% no-repeat,
    repeating-linear-gradient(90deg, #F4ECDB 0 1.5px, #D7CDB5 1.5px 2.5px, #EBE2CF 2.5px 3px) left 0 bottom 0 / 100% 3.5% no-repeat,
    #F0E8D6;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 6px 8px 14px -6px rgba(0,0,0,.6); }
/* ---- Mở bìa & lật trang (rê chuột / focus vào thẻ truyện) ---- */
.cover { transform-style: preserve-3d; }
.cover .cv-flip { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: left center; transition: transform .7s cubic-bezier(.4,.1,.2,1); border-radius: inherit; z-index: 2; }
.cover .cv-front, .cover .cv-inside { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover .cv-front { overflow: hidden; transform: translateZ(.5px); }
.cover .cv-inside { transform: rotateY(180deg); background: linear-gradient(90deg, #ECE3D1, #F6F0E2 40%, #EFE7D6); box-shadow: inset -6px 0 12px -6px rgba(0,0,0,.35); }
.cover .cv-inside::after { content: ""; position: absolute; inset: 8%; border: 1px solid rgba(184,144,47,.45); border-radius: 2px; }
/* trang đầu tiên (tĩnh, sau bìa) */
.cover .cv-page { position: absolute; top: 2%; left: 6%; right: 0; bottom: 0; z-index: 1; padding: 9% 7% 7% 12%; border-radius: 2px 6px 6px 2px; color: #3B3426; background: linear-gradient(90deg, #E4DAC5, #F7F1E3 12%, #FBF6EA); box-shadow: inset 10px 0 14px -10px rgba(0,0,0,.45); font-family: "Be Vietnam Pro", system-ui, sans-serif; overflow: hidden; }
.cover .cv-page .cp-title { font-weight: 800; font-size: clamp(7px, 6cqw, 11px); line-height: 1.2; text-transform: uppercase; letter-spacing: .4px; color: #2A241A; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cover .cv-page .cp-count { margin-top: 6%; display: flex; align-items: baseline; gap: 4px; color: #8A2B35; }
.cover .cv-page .cp-count b { font-family: Anton, Impact, sans-serif; font-size: clamp(16px, 19cqw, 44px); line-height: 1; letter-spacing: .5px; }
.cover .cv-page .cp-count span { font-size: clamp(7px, 6cqw, 12px); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.cover .cv-page .cp-meta { margin-top: 5%; display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: clamp(6px, 5.4cqw, 10px); font-weight: 600; color: #5E5443; }
.cover .cv-page .cp-meta svg { width: 1.1em; height: 1.1em; vertical-align: -2px; margin-right: 2px; }
.cover .cv-page .cp-list { margin-top: 6%; padding: 0; list-style: none; font-size: clamp(6px, 5cqw, 9.5px); line-height: 1.35; color: #4A4234; border-top: 1px solid rgba(0,0,0,.12); }
.cover .cv-page .cp-list li { padding: 3px 0; border-bottom: 1px dashed rgba(0,0,0,.12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover .cv-page .cp-list b { color: #8A2B35; }
.cover .cv-page .cp-hint { position: absolute; left: 12%; right: 7%; bottom: 6%; font-size: clamp(6px, 5.2cqw, 10px); font-weight: 800; color: #B5121B; letter-spacing: .5px; }
/* hai tờ giấy lật theo sau bìa */
.cover .cv-sheet { position: absolute; top: 2%; left: 6%; right: 0; bottom: 0; z-index: 1; border-radius: 2px 6px 6px 2px; background: linear-gradient(90deg, #E9E0CC, #FBF6EA 30%); box-shadow: 1px 0 2px rgba(0,0,0,.15); transform-origin: left center; transition: transform .8s cubic-bezier(.4,.1,.2,1); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover .cv-sheet.s1 { transition-delay: .12s; } .cover .cv-sheet.s2 { transition-delay: .24s; }
.story-card:hover .cv-flip, .story-card:focus-visible .cv-flip, .story-row:hover .cv-flip, .cover.cv-hero:hover .cv-flip { transform: rotateY(-150deg); }
.story-card:hover .cv-sheet.s1, .story-card:focus-visible .cv-sheet.s1, .story-row:hover .cv-sheet.s1, .cover.cv-hero:hover .cv-sheet.s1 { transform: rotateY(-165deg); }
.story-card:hover .cv-sheet.s2, .story-card:focus-visible .cv-sheet.s2, .story-row:hover .cv-sheet.s2, .cover.cv-hero:hover .cv-sheet.s2 { transform: rotateY(-175deg); }
.list-row .cover .cv-page, .list-row .cover .cv-sheet { display: none; }
/* nhịp "thở" nhẹ khi không rê chuột */
@keyframes cv-breathe { 0%, 100% { transform: perspective(1000px) rotateY(-6deg) translateY(0); } 50% { transform: perspective(1000px) rotateY(-8deg) translateY(-2px); } }
.story-card .cover { animation: cv-breathe 6s ease-in-out infinite; }
.story-card:hover .cover { animation: none; }
@media (prefers-reduced-motion: reduce) { .story-card .cover { animation: none; } .cover .cv-flip, .cover .cv-sheet { transition: none; } }
.cover.no-flip .cv-flip { transition: none; }
.story-card:hover .cover { transform: perspective(1000px) rotateY(-16deg); box-shadow: 20px 24px 40px -12px rgba(0,0,0,.85), 0 0 0 1px rgba(233,204,122,.6), 0 0 30px -6px rgba(209,26,42,.5); }
/* Nhãn & dải số chương */
.cover .cv-badges { position: absolute; top: 7px; left: calc(9% + 5px); right: 6px; display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; z-index: 4; }
.cover .cv-badges .badge { padding: 2px 6px; font-size: clamp(7px, 5.2cqw, 10px); letter-spacing: 0; white-space: nowrap; line-height: 1.3; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.cover .cv-chap { position: absolute; bottom: 0; left: 9%; right: 0; padding: 18px 8px 7px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.85)); color: #fff; font-size: clamp(8px, 6cqw, 12px); font-weight: 700; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 4px; white-space: nowrap; border-radius: 0 0 8px 3px; }
@container (max-width: 170px) { .cover .cv-chap { flex-direction: column; align-items: flex-start; gap: 1px; padding-top: 22px; font-size: clamp(8px, 7cqw, 11px); } }
@container (max-width: 90px) { .cover .cv-author, .cover .cv-badges, .cover .cv-chap, .cover .cv-genre, .cover .cv-art::after { display: none; } .cover .cv-title { top: 10%; height: 80%; letter-spacing: 0; } .cover .cv-title::before, .cover .cv-title::after { display: none; } }
.cover .cv-chap .cv-views { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; opacity: .9; }
.cover .cv-chap .cv-views svg { width: 1.1em; height: 1.1em; }
.story-card .sc-rate { margin-top: 4px; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #F5B301; }
.story-card .sc-rate .stars svg { width: 12px; height: 12px; }
.story-card .sc-rate .rc { color: rgb(var(--c-muted)); font-weight: 500; }
.story-card { display: block; text-decoration: none; transition: transform .18s ease; }
.story-card:hover { transform: translateY(-4px); z-index: 6; }
.story-card { position: relative; }

.story-card .sc-title { margin-top: 9px; font-weight: 700; font-size: 14px; line-height: 1.3; }
.story-card .sc-meta { margin-top: 3px; font-size: 12px; color: rgb(var(--c-muted)); display: flex; align-items: center; gap: 6px; }
.story-card .sc-meta svg { width: 13px; height: 13px; }
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.row-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.row-scroll > * { flex: 0 0 38%; scroll-snap-align: start; }
@media (min-width: 480px) { .row-scroll > * { flex-basis: 30%; } }
@media (min-width: 768px) { .row-scroll { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; overflow: visible; } .row-scroll > * { flex: none; } }
@media (min-width: 1024px) { .row-scroll { grid-template-columns: repeat(6, minmax(0,1fr)); } }
.stars { display: inline-flex; gap: 1px; color: #F5B301; }
.stars svg { width: 14px; height: 14px; }
.stars .off { color: rgb(var(--c-line) / .25); }
.rate-input svg { width: 30px; height: 30px; cursor: pointer; transition: transform .1s; }
.rate-input svg:hover { transform: scale(1.15); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgb(var(--c-line) / .07); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
/* Chế độ xem Danh sách (trang Thể loại / Tủ truyện) */
.view-toggle button { padding: 6px 10px; display: inline-flex; align-items: center; }
.view-toggle button svg { width: 16px; height: 16px; }
.story-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid rgb(var(--c-line) / .08); text-decoration: none; color: inherit; transition: background .15s; }
.story-row:last-child { border-bottom: 0; }
.story-row:hover .sr-title { color: var(--brand, #E8404F); }
.story-row .cover { width: 84px; flex-shrink: 0; }
@media (min-width: 640px) { .story-row .cover { width: 104px; } }
.story-row .sr-body { min-width: 0; flex: 1; }
.story-row .sr-title { font-weight: 800; font-size: 15px; }
@media (min-width: 640px) { .story-row .sr-title { font-size: 17px; } }
.story-row .sr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: rgb(var(--c-muted)); }
.story-row .sr-syn { margin-top: 6px; font-size: 13px; color: rgb(var(--c-muted)); }
.story-row .sr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; font-weight: 600; }
.story-row .sr-foot .sc-rate { margin: 0; }
.story-row .sr-last { flex-basis: 100%; font-weight: 500; color: rgb(var(--c-muted)); }
@media (max-width: 480px) { .story-row .sr-syn { display: none; } }
.list-row .cover { width: 52px; flex-shrink: 0; border-radius: 2px 6px 6px 2px; margin-right: 6px; }
.list-row .lr-title { font-weight: 700; font-size: 14.5px; }
.list-row .lr-sub { font-size: 12.5px; color: rgb(var(--c-muted)); margin-top: 2px; }
.rank-num { width: 28px; text-align: center; font-family: Anton, Impact, sans-serif; font-size: 22px; color: rgb(var(--c-muted)); flex-shrink: 0; }
.rank-num.top1 { color: #E8404F; } .rank-num.top2 { color: #F5B301; } .rank-num.top3 { color: #38BDF8; }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; } }
.cat-grid .cat-tile { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px 10px; }
.cat-grid .cat-tile .ct-ico { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.cat-grid .cat-tile .ct-name { font-size: 13px; line-height: 1.2; }
.cat-grid .cat-tile .ct-count { font-size: 11px; }
.cat-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); text-decoration: none; transition: transform .15s, border-color .15s; }
.cat-tile:hover { transform: translateY(-2px); border-color: rgba(232,64,79,.5); }
.cat-tile .ct-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--ct-bg, rgba(209,26,42,.15)); flex-shrink: 0; }
.cat-tile .ct-name { font-weight: 700; font-size: 14px; }
.cat-tile .ct-count { font-size: 12px; color: rgb(var(--c-muted)); }

/* ---------- 6. Hero ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); min-height: 300px; }
.hero .hero-bg { position: absolute; inset: 0; background: var(--hero-grad, linear-gradient(135deg, #7C3AED, #1E1B4B)); opacity: .55; filter: blur(40px) saturate(1.3); transform: scale(1.3); }
.hero .hero-bg2 { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.15) 100%); }
:root[data-theme="light"] .hero .hero-bg2, :root[data-theme="sepia"] .hero .hero-bg2 { background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.5) 60%, rgba(0,0,0,.3) 100%); }
.hero .hero-in { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 18px; color: #fff; }
@media (min-width: 768px) { .hero .hero-in { grid-template-columns: 200px 1fr; gap: 28px; padding: 28px; } }
.hero .hero-kicker { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 800; color: #FFB4BB; }
.hero h1, .hero .hero-title { font-size: clamp(20px, 3.4vw, 36px); font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -.3px; }
.hero .hero-syn { margin-top: 10px; color: rgba(255,255,255,.85); font-size: 14px; max-width: 640px; }
.hero .hero-dots { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 6px; }
.hero .hero-dots button { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.4); border: 0; padding: 0; cursor: pointer; transition: width .2s, background .2s; }
.hero .hero-dots button.active { width: 22px; background: #fff; }
.hero .hero-slide { display: none; } .hero .hero-slide.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 7. Quảng cáo (Adsterra placeholders) ---------- */
.ad-slot { display: flex; align-items: center; justify-content: center; text-align: center; border: 1px dashed rgb(var(--c-line) / .2); border-radius: 10px; color: rgb(var(--c-muted)); font-size: 12px; letter-spacing: .5px; background: rgb(var(--c-line) / .03); overflow: hidden; margin-inline: auto; }
.ad-slot.is-live { border: 0; background: transparent; }
.ad-header { width: 100%; max-width: 320px; height: 50px; }
@media (min-width: 768px) { .ad-header { max-width: 728px; height: 90px; } }
.ad-infeed { width: 100%; max-width: 336px; height: 280px; }
@media (min-width: 768px) { .ad-infeed { max-width: 728px; height: 90px; } }
.ad-sidebar { width: 300px; max-width: 100%; height: 250px; }
.ad-footer { width: 100%; max-width: 320px; height: 100px; }
@media (min-width: 768px) { .ad-footer { max-width: 728px; height: 90px; } }
.sticky-side { position: sticky; top: calc(var(--header-h) + 12px); }

/* ---------- 8. Modal, bottom sheet, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto; background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line) / .1); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.modal .m-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0; }
.modal .m-head h3 { font-size: 17px; font-weight: 800; }
.modal .m-body { padding: 12px 18px 18px; font-size: 14.5px; line-height: 1.6; }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 18px 18px; flex-wrap: wrap; }
.modal.modal-lg { max-width: 760px; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; z-index: 81; background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); border: 1px solid rgb(var(--c-line) / .1); box-shadow: 0 -20px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; transition: transform .28s cubic-bezier(.2,.8,.2,1); left: 0; right: 0; bottom: 0; max-height: 86dvh; border-radius: 20px 20px 0 0; transform: translateY(110%); }
.sheet-open .sheet { transform: none; } .sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
@media (min-width: 900px) { .sheet { left: auto; top: 0; bottom: 0; right: 0; width: 420px; max-height: none; border-radius: 0; transform: translateX(110%); } }
.sheet .sh-handle { width: 42px; height: 5px; border-radius: 99px; background: rgb(var(--c-line) / .25); margin: 10px auto 0; }
@media (min-width: 900px) { .sheet .sh-handle { display: none; } }
.sheet .sh-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgb(var(--c-line) / .08); }
.sheet .sh-head h3 { font-weight: 800; font-size: 16px; }
.sheet .sh-body { overflow-y: auto; padding: 14px 16px; flex: 1; }
.toast-wrap { position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
@media (min-width: 768px) { .toast-wrap { bottom: 24px; } }
.toast { background: #1D1D23; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); border-left: 4px solid #E8404F; animation: toastIn .25s ease; display: flex; gap: 8px; align-items: center; pointer-events: auto; max-width: 100%; }
.toast.success { border-left-color: #10B981; } .toast.warn { border-left-color: #F5B301; } .toast.error { border-left-color: #EF4444; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- 9. Form ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: rgb(var(--c-ink) / .9); }
.input, .select, .textarea { width: 100%; background: rgb(var(--c-line) / .05); border: 1px solid rgb(var(--c-line) / .12); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: #E8404F; box-shadow: 0 0 0 3px rgba(209,26,42,.18); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239c9ca6' stroke-width='2.5'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.select option { background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.help { font-size: 12px; color: rgb(var(--c-muted)); margin-top: 5px; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 99px; background: rgb(var(--c-line) / .2); border: 0; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 99px; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: #D11A2A; } .switch[aria-checked="true"]::after { transform: translateX(20px); }
.seg { display: inline-flex; background: rgb(var(--c-line) / .07); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: rgb(var(--c-muted)); }
.seg button.active { background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
input[type=range] { width: 100%; accent-color: #D11A2A; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: rgb(var(--c-muted)); padding: 10px 12px; border-bottom: 1px solid rgb(var(--c-line) / .1); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid rgb(var(--c-line) / .06); vertical-align: middle; }
.table tr:hover td { background: rgb(var(--c-line) / .03); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.avatar { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0; background: var(--av, #7C3AED); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgb(var(--c-line) / .1); overflow-x: auto; }
.tabs button { background: transparent; border: 0; padding: 10px 14px; font-weight: 700; font-size: 14px; color: rgb(var(--c-muted)); cursor: pointer; position: relative; white-space: nowrap; }
.tabs button.active { color: #E8404F; }
.tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: #E8404F; border-radius: 2px; }
.skeleton { background: linear-gradient(90deg, rgb(var(--c-line) / .06), rgb(var(--c-line) / .12), rgb(var(--c-line) / .06)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { text-align: center; padding: 40px 16px; color: rgb(var(--c-muted)); }
.empty .em-ico { font-size: 40px; margin-bottom: 8px; }

/* Vùng tải ảnh bìa (kéo thả) */
.dropzone { display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px dashed rgb(var(--c-line) / .2); border-radius: 12px; background: rgb(var(--c-line) / .03); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { border-color: #E8404F; background: rgba(209,26,42,.08); }
.dropzone.has-file { border-style: solid; border-color: rgba(16,185,129,.6); }
.dropzone .dz-ico { font-size: 28px; line-height: 1; }
.dropzone .dz-text { font-size: 14px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- 10. Bình luận ---------- */
.comment { display: flex; gap: 10px; padding: 12px 0; }
.comment + .comment { border-top: 1px solid rgb(var(--c-line) / .06); }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment .c-name { font-weight: 700; font-size: 14px; }
.comment .c-time { font-size: 12px; color: rgb(var(--c-muted)); }
.comment .c-text { font-size: 14.5px; line-height: 1.55; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.comment .c-actions { display: flex; gap: 12px; margin-top: 6px; font-size: 12.5px; color: rgb(var(--c-muted)); }
.comment .c-actions button { background: none; border: 0; cursor: pointer; font-weight: 700; color: inherit; display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; }
.comment .c-actions button:hover, .comment .c-actions button.on { color: #E8404F; }
.comment .c-actions svg { width: 14px; height: 14px; }
.comment .c-replies { margin-left: 0; padding-left: 12px; border-left: 2px solid rgb(var(--c-line) / .1); margin-top: 6px; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; }
.comment-form .textarea { min-height: 72px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.reactions button { border: 1px solid rgb(var(--c-line) / .12); background: rgb(var(--c-line) / .05); border-radius: 999px; padding: 4px 10px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: transform .1s, background .15s; }
.reactions button:hover { transform: scale(1.06); }
.reactions button.on { background: rgba(209,26,42,.18); border-color: rgba(232,64,79,.6); }
.reactions button b { font-size: 12.5px; }

/* ---------- 11. TRÌNH ĐỌC ---------- */
body.reader-page { --header-h: 54px; }
.reader-top { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 50; height: var(--header-h); background: rgb(var(--c-surface) / .92); backdrop-filter: blur(14px); border-bottom: 1px solid rgb(var(--c-line) / .08); display: flex; align-items: center; gap: 8px; padding: 0 10px; transition: transform .25s ease; }
.reader-top.hidden { transform: translateY(-100%); }
.reader-top .rt-title { flex: 1; min-width: 0; }
.reader-top .rt-story { font-size: 11.5px; color: rgb(var(--c-muted)); font-weight: 600; letter-spacing: .3px; }
.reader-top .rt-chap { font-size: 14px; font-weight: 700; }
.reader-top .icon-btn:hover { background: rgb(var(--c-line) / .1); }
.reader-progress { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; background: linear-gradient(90deg, #E8404F, #F5B301); z-index: 51; width: 0; transition: width .1s linear; }
.reader-wrap { max-width: var(--reader-width); margin: 0 auto; padding-block: calc(var(--header-h) + 22px) 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); transition: max-width .2s; }
@media (min-width: 768px) { .reader-wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.reader-head { text-align: center; margin-bottom: 26px; }
.reader-head .rh-story { color: #E8404F; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.reader-head h1 { font-family: var(--reader-font); font-size: calc(var(--reader-size) * 1.45); font-weight: 700; margin-top: 6px; line-height: 1.25; }
.reader-head .rh-meta { margin-top: 8px; font-size: 12.5px; color: rgb(var(--c-muted)); display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.reader-content { font-family: var(--reader-font); font-size: var(--reader-size); line-height: var(--reader-lh); color: rgb(var(--c-ink) / .92); }
.rp-wrap { position: relative; }
.rp-wrap p.rp { margin: 0 0 1.1em; text-align: left; word-break: break-word; hyphens: auto; }   /* căn lề trái – không giãn chữ */
.rp-wrap p.rp.scene-break { text-align: center; letter-spacing: 8px; color: rgb(var(--c-muted)); }
.rp-wrap p.rp.tts-active { background: rgba(245,179,1,.14); box-shadow: 0 0 0 6px rgba(245,179,1,.14); border-radius: 4px; }
.rp-btn { position: absolute; right: -40px; top: 0; width: 32px; height: 32px; border-radius: 99px; border: 1px solid rgb(var(--c-line) / .12); background: rgb(var(--c-surface)); color: rgb(var(--c-muted)); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, transform .15s; font-size: 11px; font-weight: 800; font-family: "Be Vietnam Pro", sans-serif; }
.rp-btn svg { width: 15px; height: 15px; }
.rp-btn .cnt { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #D11A2A; color: #fff; font-size: 10px; display: grid; place-items: center; }
.rp-wrap:hover .rp-btn, .rp-btn.has, .rp-wrap.active .rp-btn { opacity: 1; }
.rp-btn:hover { color: #E8404F; transform: scale(1.08); }
.rp-wrap.active p.rp { background: rgb(var(--c-line) / .05); border-radius: 4px; }
@media (max-width: 899px) { .rp-btn { right: -6px; top: -8px; width: 28px; height: 28px; } .rp-wrap { padding-right: 0; } }
.reader-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin: 36px 0 24px; }
.reader-nav .btn { height: 46px; }
.reader-nav .btn:first-child { justify-content: flex-start; } .reader-nav .btn:last-child { justify-content: flex-end; }
.reader-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55; background: rgb(var(--c-surface) / .96); backdrop-filter: blur(14px); border: 1px solid rgb(var(--c-line) / .12); border-radius: 999px; padding: 6px; display: flex; gap: 2px; box-shadow: 0 16px 40px -10px rgba(0,0,0,.6); transition: transform .25s, opacity .25s; max-width: calc(100vw - 20px); }
.reader-bar.hidden { transform: translate(-50%, 140%); opacity: 0; }
.reader-bar .icon-btn { width: 44px; height: 44px; border-radius: 999px; }
.reader-bar .icon-btn:hover { background: rgb(var(--c-line) / .1); }
.reader-bar .icon-btn.on { background: rgba(209,26,42,.2); color: #E8404F; }
.reader-bar .icon-btn.on.pulse::after { content: ""; position: absolute; inset: 4px; border-radius: 99px; border: 2px solid #E8404F; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.reader-bar .divider { width: 1px; background: rgb(var(--c-line) / .12); margin: 8px 3px; }
.speed-tag { position: absolute; bottom: 2px; right: 4px; font-size: 9px; font-weight: 800; }
.settings-panel { padding: 4px 0; }
.settings-panel .sp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgb(var(--c-line) / .07); }
.settings-panel .sp-row:last-child { border-bottom: 0; }
.settings-panel .sp-lbl { font-size: 13.5px; font-weight: 700; }
.settings-panel .sp-sub { font-size: 12px; color: rgb(var(--c-muted)); font-weight: 500; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: rgb(var(--c-line) / .07); border-radius: 10px; padding: 3px; }
.stepper button { width: 34px; height: 32px; border: 0; background: transparent; border-radius: 8px; font-weight: 800; cursor: pointer; font-size: 16px; }
.stepper button:hover { background: rgb(var(--c-surface)); }
.stepper .val { min-width: 48px; text-align: center; font-weight: 700; font-size: 13.5px; }
.theme-swatches { display: flex; gap: 8px; }
.theme-swatches button { width: 44px; height: 32px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.theme-swatches button.active { border-color: #E8404F; }
.chap-list { max-height: 60vh; overflow-y: auto; }
.chap-list a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 9px; text-decoration: none; font-size: 14px; }
.chap-list a:hover { background: rgb(var(--c-line) / .06); }
.chap-list a.current { background: rgba(209,26,42,.15); color: #E8404F; font-weight: 700; }
.chap-list a.read { color: rgb(var(--c-muted)); }
.chap-list a .cl-date { font-size: 12px; color: rgb(var(--c-muted)); white-space: nowrap; }
.resume-pill { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--header-h) + 10px + env(safe-area-inset-top, 0px)); z-index: 52; background: #1D1D23; color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; gap: 10px; align-items: center; border: 1px solid rgba(255,255,255,.1); }
.resume-pill button { background: #D11A2A; border: 0; color: #fff; border-radius: 99px; padding: 5px 10px; font-weight: 700; cursor: pointer; font-size: 12.5px; }

/* ---------- 12. Trang chi tiết truyện ---------- */
.story-hero { position: relative; border-radius: 18px; overflow: hidden; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); }
.story-hero .sh-bg { position: absolute; inset: 0; background: var(--hero-grad); opacity: .35; filter: blur(50px) saturate(1.2); transform: scale(1.4); }
.story-hero .sh-in { position: relative; display: grid; grid-template-columns: 112px 1fr; grid-template-areas: "cover body" "stats stats" "actions actions"; gap: 14px; padding: 16px; }
@media (min-width: 768px) { .story-hero .sh-in { grid-template-columns: 220px 1fr; grid-template-areas: "cover body" "cover stats" "cover actions"; gap: 16px 28px; padding: 28px; align-content: start; } }
.story-hero .sh-cover { grid-area: cover; } .story-hero .sh-body { grid-area: body; min-width: 0; } .story-hero .sh-stats { grid-area: stats; } .story-hero .sh-actions { grid-area: actions; }
.story-hero h1 { font-size: clamp(20px, 3.2vw, 34px); font-weight: 800; line-height: 1.15; letter-spacing: -.3px; }
.story-hero .sh-author { margin-top: 4px; font-size: 14px; }
.story-hero .sh-rating { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; white-space: nowrap; min-width: 0; } .story-hero .sh-rating .stars { display: inline-flex; flex-shrink: 0; } .story-hero .sh-rating .stars svg { width: 14px; height: 14px; } .story-hero .sh-rating b { flex-shrink: 0; } .story-hero .sh-rating span { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.story-hero .sh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.story-hero .sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.story-hero .sh-stats > div { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px; border-radius: 12px; background: rgb(var(--c-line) / .06); border: 1px solid rgb(var(--c-line) / .08); }
.story-hero .sh-stats b { font-size: 15px; line-height: 1.2; white-space: nowrap; } .story-hero .sh-stats span { color: rgb(var(--c-muted)); font-size: 11px; margin-top: 2px; }
@media (min-width: 768px) { .story-hero .sh-stats { max-width: 560px; } .story-hero .sh-stats b { font-size: 17px; } .story-hero .sh-stats span { font-size: 12px; } }
.story-hero .sh-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px 46px; gap: 8px; min-width: 0; }
.story-hero .sh-actions .sh-primary { grid-column: 1 / -1; }
.story-hero .sh-actions:not(.has-prog) #btn-bm { grid-column: 1 / 3; }
.story-hero .sh-actions .btn { justify-content: center; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; padding-right: 10px; }
.story-hero .sh-actions .sh-ico { padding: 0; width: 46px; }
.story-hero .sh-in, .story-hero .sh-body, .story-hero .sh-stats { min-width: 0; }
@media (max-width: 400px) { .story-hero .sh-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 42px 42px; gap: 6px; } .story-hero .sh-actions .btn { font-size: 14px; padding-left: 8px; padding-right: 8px; } .story-hero .sh-actions .sh-ico { width: 42px; } .story-hero .sh-rating { font-size: 12px; gap: 4px; } .story-hero .sh-rating .stars svg { width: 12px; height: 12px; } .story-hero .sh-rating span { font-size: 10.5px; } }
@media (min-width: 768px) { .story-hero .sh-actions { display: flex; flex-wrap: wrap; } .story-hero .sh-actions .sh-primary { grid-column: auto; } .story-hero .sh-actions .btn { padding-left: 18px; padding-right: 18px; } .story-hero .sh-actions .sh-ico { width: auto; padding: 0 14px; } }
.synopsis { font-size: 15px; line-height: 1.75; color: rgb(var(--c-ink) / .9); }
.synopsis.clamped { max-height: 7.2em; overflow: hidden; position: relative; }
.synopsis.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(180deg, transparent, rgb(var(--c-surface))); }
.chapter-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 640px) { .chapter-grid { grid-template-columns: repeat(2, 1fr); gap: 2px 20px; } }
.chapter-grid a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 8px; border-bottom: 1px solid rgb(var(--c-line) / .06); text-decoration: none; font-size: 14px; border-radius: 6px; }
.chapter-grid a:hover { background: rgb(var(--c-line) / .05); color: #E8404F; }
.chapter-grid a.read { color: rgb(var(--c-muted)); }
.chapter-grid a .cg-date { font-size: 12px; color: rgb(var(--c-muted)); white-space: nowrap; }
.chapter-grid a .cg-new { color: #F5B301; font-size: 10px; font-weight: 800; margin-left: 4px; }

/* Hàng "Thể loại" / "Hashtag" trong phần đầu trang truyện */
.meta-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.meta-row .meta-lbl { flex: 0 0 72px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: rgb(var(--c-muted)); padding-top: 5px; }
.meta-row .meta-vals { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud .tag { display: inline-flex; align-items: center; gap: 4px; }
.tag-cloud .tag .tc-n { font-size: 10.5px; font-weight: 800; color: rgb(var(--c-muted)); }
.tag.active { background: rgba(209,26,42,.18); color: #E8404F; }

/* ---------- 12b. Trang tĩnh (trang.html) ---------- */
.static-nav { display: flex; gap: 2px; overflow-x: auto; }
@media (min-width: 1024px) { .static-nav { flex-direction: column; } }
.static-nav a { padding: 10px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; color: rgb(var(--c-muted)); }
.static-nav a:hover { background: rgb(var(--c-line) / .06); color: rgb(var(--c-ink)); }
.static-nav a.active { background: rgba(209,26,42,.15); color: #E8404F; }
.prose-gdt { font-size: 15.5px; line-height: 1.75; max-width: 72ch; }
.prose-gdt .lead { font-size: 17px; color: rgb(var(--c-ink)); }
.prose-gdt .meta { font-size: 13px; color: rgb(var(--c-muted)); margin-bottom: 12px; }
.prose-gdt h2 { font-size: 19px; font-weight: 800; margin: 26px 0 8px; letter-spacing: -.2px; }
.prose-gdt h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.prose-gdt p { margin-bottom: 12px; }
.prose-gdt ul, .prose-gdt ol { padding-left: 22px; margin-bottom: 12px; }
.prose-gdt ul { list-style: disc; } .prose-gdt ol { list-style: decimal; }
.prose-gdt li { margin-bottom: 6px; }
.prose-gdt a { color: #E8404F; text-decoration: underline; text-underline-offset: 2px; }
.prose-gdt code { background: rgb(var(--c-line) / .08); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.prose-gdt .contact-grid { display: grid; gap: 12px; margin: 14px 0; }
@media (min-width: 640px) { .prose-gdt .contact-grid { grid-template-columns: 1fr 1fr; } }
.prose-gdt .contact-grid p { margin-bottom: 4px; }
.prose-gdt .contact-form { max-width: 520px; }

/* ---------- 13. Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1024px) { .admin-layout { grid-template-columns: 230px 1fr; gap: 24px; } }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; }
@media (min-width: 1024px) { .admin-nav { flex-direction: column; position: sticky; top: calc(var(--header-h) + 16px); } }
.admin-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; color: rgb(var(--c-muted)); white-space: nowrap; text-align: left; }
.admin-nav button svg { width: 18px; height: 18px; }
.admin-nav button.active { background: rgba(209,26,42,.15); color: #E8404F; }
.admin-nav .admin-me { padding: 10px 12px; border-radius: 10px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); min-width: 200px; margin-bottom: 4px; }
@media (max-width: 1023px) { .admin-nav .admin-me { display: none; } }
.admin-nav button .cnt { margin-left: auto; background: #D11A2A; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.stat-card { padding: 16px; border-radius: 14px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .08); }
.stat-card .st-val { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; }
.stat-card .st-lbl { font-size: 12px; color: rgb(var(--c-muted)); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.status-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.status-pill.pending { background: rgba(245,179,1,.18); color: #F5B301; } .status-pill.approved { background: rgba(16,185,129,.18); color: #10B981; } .status-pill.rejected { background: rgba(239,68,68,.18); color: #EF4444; }
.status-pill.open { background: rgba(239,68,68,.18); color: #EF4444; } .status-pill.resolved { background: rgba(16,185,129,.18); color: #10B981; } .status-pill.dismissed { background: rgb(var(--c-line) / .1); color: rgb(var(--c-muted)); }
.status-pill.active { background: rgba(16,185,129,.18); color: #10B981; } .status-pill.banned { background: rgba(239,68,68,.18); color: #EF4444; }

/* ---------- 14. Footer ---------- */
.site-footer { margin-top: 48px; background: rgb(var(--c-surface)); border-top: 1px solid rgb(var(--c-line) / .08); }
.site-footer h4 { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; color: rgb(var(--c-muted)); margin-bottom: 12px; }
.site-footer a.fl { display: block; padding: 6px 0; font-size: 14px; text-decoration: none; border-bottom: 1px solid rgb(var(--c-line) / .06); }
.site-footer a.fl:hover { color: #E8404F; }
.site-footer .foot-note { font-size: 13px; line-height: 1.65; color: rgb(var(--c-muted)); }

/* ---------- 15. Trang in / hạn chế chuyển động ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } html { scroll-behavior: auto; } }
@media print { .site-header, .subnav, .bottom-nav, .reader-bar, .reader-top, .ad-slot, .site-footer { display: none !important; } .reader-wrap { padding-top: 0; } }

} /* @layer components */

/* ---------- Chỉ báo dịch tự động ---------- */
#tr-status { position: fixed; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 60; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--brand, #E8404F); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
#tr-status.show { opacity: 1; transform: none; }
@media (min-width: 768px) { #tr-status { bottom: 16px; } }

/* ---------- AI sáng tác ---------- */
body.ai-busy [data-task] { opacity: .55; cursor: progress; }
#w-content.reader-font { font-family: var(--reader-font); font-size: 16px; line-height: 1.75; min-height: 360px; }
.ai-cta { border-color: rgba(232,64,79,.45); background: linear-gradient(135deg, rgba(232,64,79,.10), transparent 60%); }

/* Ẩn mũi tên tăng/giảm của ô nhập số */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tag-cloud .tag.active { box-shadow: 0 0 0 1px rgba(232,64,79,.6) inset; }
.tag-cloud .tag-clear { border-style: dashed; color: rgb(var(--c-muted)); }

/* ---------- Chống sao chép ---------- */
.reader-content.ac-on { display: flex; flex-direction: column; }
.reader-content .rp-bait { display: none !important; }
html.anticopy #reader-content, html.anticopy .reader-head { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media print { html.anticopy #reader-content, html.anticopy .reader-head { display: none !important; } html.anticopy body::after { content: "Nội dung chương không hỗ trợ in. Vui lòng đọc trực tuyến."; display: block; padding: 24px; font-size: 18px; } }

/* ---------- Chống chụp / quay màn hình ---------- */
html.ac-blur #reader-content, html.ac-blur .reader-head { filter: blur(14px); transition: filter .15s; pointer-events: none; }
html.ac-blur #reader-main::before { content: "Nội dung tạm ẩn – bấm vào trang để tiếp tục đọc"; position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 70; padding: 12px 18px; border-radius: 12px; background: rgba(0,0,0,.75); color: #fff; font-weight: 700; font-size: 14px; pointer-events: none; }
.reader-content .ac-wm { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; opacity: .08; }
.reader-content .ac-wm-in { position: absolute; inset: -30% -40%; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; align-items: center; justify-items: center; transform: rotate(-22deg); transform-origin: center; }
.reader-content .ac-wm span { font: 700 13px/1 "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: 1px; color: rgb(var(--c-ink)); white-space: nowrap; }
.reader-content { position: relative; }
.reader-content .rp-wrap { position: relative; z-index: 2; }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 2px 0 16px; padding: 10px 14px; border-radius: 12px; background: rgb(var(--c-line) / .06); border: 1px solid rgb(var(--c-line) / .08); font-size: 14px; font-weight: 600; color: rgb(var(--c-muted)); }
.crumbs a { color: rgb(var(--c-muted)); text-decoration: none; padding: 2px 4px; border-radius: 6px; transition: color .15s, background .15s; }
.crumbs a:hover { color: var(--brand, #E8404F); background: rgb(var(--c-line) / .08); }
.crumbs i { font-style: normal; opacity: .5; padding: 0 2px; }
.crumbs span, .crumbs #bc-cur > span { color: rgb(var(--c-ink)); font-weight: 800; }
.crumbs #bc-cur { display: contents; }
@media (min-width: 768px) { .crumbs { font-size: 15px; padding: 12px 18px; } }

/* Ô nhập nhiều dòng: tự giãn theo nội dung – không thanh cuộn, không tay kéo */
.textarea, textarea.input { resize: none; overflow: hidden; }
/* Ô soạn thảo chỉ sửa, không sao chép */
.ac-edit { -webkit-user-drag: none; }
.ac-edit::selection { background: rgba(181,18,27,.25); }
#page-desc:empty { display: none; }
/* Mới cập nhật – danh sách gọn */
.upd-list { padding: 2px 12px; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
@media (min-width: 768px) { .upd-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 2px 16px; } }
.upd-row { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 7px 0; min-height: 56px; border-bottom: 1px solid rgb(var(--c-line) / .07); text-decoration: none; color: inherit; }
.upd-row:hover .ur-title { color: #E8404F; }
.upd-row .cover { width: 34px; flex-shrink: 0; border-radius: 2px 4px 4px 2px; margin-right: 4px; }
.upd-row .cover .cv-page, .upd-row .cover .cv-sheet { display: none; }
.upd-row .cover .cv-title, .upd-row .cover .cv-front span { font-size: 5px !important; }
.upd-row .ur-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.upd-row .ur-title { font-weight: 700; font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upd-row .ur-sub { font-size: 12px; color: rgb(var(--c-muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upd-row .ur-cat { font-weight: 700; }
.upd-row .ur-time { font-size: 11px; color: rgb(var(--c-muted)); flex-shrink: 0; white-space: nowrap; }
@media (min-width: 768px) { .upd-list .upd-row:nth-last-child(-n+2) { border-bottom: 0; } }
@media (max-width: 767px) { .upd-list .upd-row:last-child { border-bottom: 0; } }
/* Đánh giá sao trên bìa (góc dưới phải) */
.cover .cv-chap .cv-rate { display: inline-flex; align-items: center; gap: 2px; color: #F5B301; font-weight: 800; font-size: clamp(7px, 5.2cqw, 11px); }
.cover .cv-chap .cv-rate .stars { display: inline-flex; gap: 0; }
.cover .cv-chap .cv-rate .stars svg { width: 1em; height: 1em; }
.cover .cv-chap .cv-rate b { margin-left: 2px; }
@container (max-width: 170px) { .cover .cv-chap .cv-rate { font-size: clamp(7px, 6cqw, 10px); } }
@container (max-width: 120px) { .cover .cv-chap .cv-rate .stars { display: none; } .cover .cv-chap .cv-rate::before { content: '★'; } }
/* Trang trong của bìa: đoạn giới thiệu */
.cover .cv-page .cp-label { font-weight: 800; font-size: clamp(6px, 5.4cqw, 10px); text-transform: uppercase; letter-spacing: 1.2px; color: #8A2B35; border-bottom: 1px solid rgba(0,0,0,.14); padding-bottom: 3%; }
.cover .cv-page .cp-syn { margin-top: 5%; font-size: clamp(6.5px, 5.6cqw, 10.5px); line-height: 1.45; color: #3B3426; text-align: left; display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; max-height: 66%; }
.cover .cv-page .cp-syn i { color: #8A8070; }
.textarea.dragging { outline: 2px dashed #E8404F; outline-offset: -2px; }
/* ---------- Thanh khám phá trang chủ: Thể loại & Hashtag ---------- */
.hx-bar { display: flex; align-items: stretch; gap: 10px; }
.hx-btn { all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .1); box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: border-color .18s, box-shadow .18s, transform .18s, background .18s; }
.hx-btn:hover { border-color: rgba(232,64,79,.45); transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(209,26,42,.5); }
.hx-btn.open { border-color: rgba(232,64,79,.7); background: linear-gradient(180deg, rgba(209,26,42,.10), rgb(var(--c-surface)) 70%); box-shadow: inset 0 0 0 1px rgba(232,64,79,.25); }
.hx-btn:focus-visible { outline: 2px solid #E8404F; outline-offset: 2px; }
.hx-ico { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; font-size: 18px; background: linear-gradient(135deg, rgba(209,26,42,.22), rgba(209,26,42,.06)); }
.hx-ico-tag { font-family: Anton, Impact, sans-serif; font-size: 20px; color: #E8404F; letter-spacing: 1px; }
.hx-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.hx-txt b { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-txt small { font-size: 11.5px; color: rgb(var(--c-muted)); }
.hx-arrow { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid rgb(var(--c-muted)); border-bottom: 2px solid rgb(var(--c-muted)); transform: rotate(45deg); transition: transform .22s, border-color .18s; margin-right: 4px; margin-top: -3px; flex-shrink: 0; }
.hx-btn.open .hx-arrow { transform: rotate(-135deg); margin-top: 3px; border-color: #E8404F; }
.hx-all { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 14px; font-weight: 800; font-size: 14px; color: #E8404F; text-decoration: none; border: 1px solid rgba(232,64,79,.3); white-space: nowrap; transition: background .18s; }
.hx-all:hover { background: rgba(209,26,42,.12); }
.hx-panel { margin-top: 10px; }
.hx-panel.hx-in { animation: hx-in .22s ease-out; }
@keyframes hx-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hx-tags { padding: 12px; border-radius: 14px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line) / .1); }
@media (max-width: 480px) { .hx-bar { gap: 8px; } .hx-btn { padding: 8px 10px; gap: 8px; } .hx-ico { width: 32px; height: 32px; font-size: 16px; } .hx-txt b { font-size: 13.5px; white-space: normal; line-height: 1.15; } .hx-txt small { font-size: 11px; } .hx-btn { align-items: center; }  }
/* ---------- Icon thể loại (SVG duotone) ---------- */
.ci { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.22em; color: var(--ci, #D11A2A); flex-shrink: 0; }
.ci .ci-f { fill: var(--ci, #D11A2A); fill-opacity: .16; stroke: none; }
.ci.ci-lg { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.subnav a .ci, .chip .ci { margin-right: 2px; }
.cat-tile .ct-ico .ci { width: 26px; height: 26px; }
.cat-grid .cat-tile .ct-ico .ci { width: 28px; height: 28px; }
.cat-tile .ct-ico { background: linear-gradient(135deg, color-mix(in srgb, var(--ci, #D11A2A) 22%, transparent), color-mix(in srgb, var(--ci, #D11A2A) 6%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ci, #D11A2A) 28%, transparent); }
.cat-tile:hover .ci .ci-f { fill-opacity: .3; }
/* Ảnh minh hoạ trong chương */
.rp-fig { margin: 18px auto; max-width: 100%; text-align: center; }
.rp-fig img { max-width: 100%; max-height: 70vh; height: auto; border-radius: 12px; box-shadow: 0 10px 30px -14px rgba(0,0,0,.6); -webkit-user-drag: none; user-select: none; }
.rp-fig figcaption { font-size: .85em; color: rgb(var(--c-muted)); margin-top: 8px; font-style: italic; }
.rp-wrap.rp-img { display: block; }
.rp-wrap.rp-img .rp-btn { display: none; }

/* ===== Bản địa hoá: cân độ dài chữ dịch với giao diện =====
   Tiếng Đức / Pháp nhiều từ ghép dài → cho ngắt từ có gạch nối; tên truyện / tiêu đề dài không làm vỡ khung; chữ Thái cần dòng cao hơn. */
html:lang(de) body, html:lang(fr) body { -webkit-hyphens: auto; hyphens: auto; }
h1, h2, h3, .sc-title, .lr-title, .ur-title, .cv-title, .sh-body h1, .reader-head h1 { overflow-wrap: anywhere; }
html:lang(th) .reader-content, html:lang(th) .synopsis { line-height: 1.95; }
.btn, .chip { max-width: 100%; }
.chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Logo StripNovels một dòng rộng hơn logo cũ → màn hẹp thu nhỏ logo để đầu trang không tràn ngang */
/* Logo StripNovels (chữ in hoa một dòng): thu nhỏ theo bề rộng màn hình để đầu trang không tràn ngang */
.hdr .brand .brand-svg { height: 34px; }
@media (max-width: 430px) { .hdr .brand .brand-svg { height: 21px; } .hdr .brand { gap: 6px; } }
@media (max-width: 370px) { .hdr .brand .brand-svg { height: 17px; } }
:root[data-theme="light"] .site-footer .brand .brand-svg, :root[data-theme="sepia"] .site-footer .brand .brand-svg { --logo-mark: #B5121B; --logo-ink: #FFFFFF; color: #B5121B; }

/* Gợi ý tìm kiếm: tô đậm phần khớp, dòng tên khác */
.sp-hl { background: rgba(232,64,79,.18); color: inherit; border-radius: 3px; padding: 0 1px; }
.sp-via { color: #E8404F; opacity: .9; }
@media (max-width: 340px) { .hdr .icon-btn { width: 34px; height: 34px; } .hdr .brand .brand-svg { height: 15px; } }

/* ===== Hiển thị mượt trên mọi bảng chữ viết: phông dự phòng theo ngôn ngữ (font hệ thống, không tải thêm) ===== */
html:lang(zh) body { font-family: "Be Vietnam Pro", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
html:lang(ja) body { font-family: "Be Vietnam Pro", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
html:lang(ko) body { font-family: "Be Vietnam Pro", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
html:lang(th) body { font-family: "Be Vietnam Pro", "Thonburi", "Leelawadee UI", "Tahoma", "Noto Sans Thai", sans-serif; }
html:lang(zh) .reader-content, html:lang(ja) .reader-content { line-break: strict; word-break: normal; text-align: justify; }
html:lang(ko) .reader-content { word-break: keep-all; }
html:lang(th) body { line-break: auto; }
/* Song ngữ & bình luận đa ngôn ngữ */
.reader-content p.rp-orig { font-size: .8em; line-height: 1.55; opacity: .62; font-style: italic; margin: -.4em 0 1.1em; padding-left: .7em; border-left: 2px solid rgba(232,64,79,.45); }
.c-orig-btn { font-size: 12px; color: rgb(var(--c-muted)); background: none; border: 0; padding: 2px 0; cursor: pointer; }
.c-orig-btn:hover, .c-orig-btn.on { color: #E8404F; }
html.lang-switching body { opacity: .55; transition: opacity .15s; pointer-events: none; }
