/* =========================================================
   AnimeVibesVN - Giao dien web doc manga (ban 2)
   Bo cuc theo kieu Cuu Truyen: nen sang, the trang, banner lon.
   Mau thuong hieu: xanh dien + do crimson (lay tu logo kenh).
   ========================================================= */

/* ---------- NEN SANG (mac dinh) ---------- */
:root {
  --nen: #d6d9e0;
  --nen-dai: #e3e5ea;
  --the: #ffffff;
  --the-2: #f2f3f6;
  --the-3: #e8eaef;
  --vien: #d4d7df;
  --chu: #1c2130;
  --chu-mo: #586074;
  --chu-nhat: #8a90a1;
  --xanh: #2563eb;
  --xanh-dam: #1d4fd8;
  --xanh-nhat: rgba(37, 99, 235, .1);
  --do: #e11d48;
  --la: #16a34a;
  --vang: #f59e0b;
  --chan: #1f2433;
  --dau-nen: rgba(236, 238, 242, .9);
  --nut-tron: rgba(15, 23, 42, .07);
  --nut-tron-hover: rgba(15, 23, 42, .13);
  --nen-doc: #e4e6eb;
  --bong-1: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --bong-2: 0 12px 32px rgba(16, 24, 40, .14);
  --bo: 12px;
  --bo-nho: 8px;
  --rong: 1280px;
  --font: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* ---------- NEN TOI ---------- */
[data-theme="toi"] {
  --nen: #0c0f16;
  --nen-dai: #10141d;
  --the: #161a25;
  --the-2: #1c2130;
  --the-3: #242a3b;
  --vien: #2a3143;
  --chu: #e8ebf2;
  --chu-mo: #a2a9ba;
  --chu-nhat: #6f778b;
  --xanh: #3b82f6;
  --xanh-dam: #2f6fe0;
  --xanh-nhat: rgba(59, 130, 246, .14);
  --do: #f43f5e;
  --la: #22c55e;
  --chan: #07090e;
  --dau-nen: rgba(12, 15, 22, .88);
  --nut-tron: rgba(255, 255, 255, .07);
  --nut-tron-hover: rgba(255, 255, 255, .14);
  --nen-doc: #07090d;
  --bong-1: 0 1px 3px rgba(0, 0, 0, .4);
  --bong-2: 0 14px 36px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.khoa-cuon { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
[hidden] { display: none !important; }

.khung { width: 100%; max-width: var(--rong); margin: 0 auto; padding: 0 16px; }
.khung-hep { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ---------- Nut ---------- */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 20px;
  border: 0; border-radius: var(--bo-nho);
  background: var(--the-3); color: var(--chu);
  font-weight: 700; font-size: 14px; letter-spacing: .2px; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.nut:hover { background: var(--vien); }
.nut:active { transform: translateY(1px); }
.nut.chinh { background: var(--xanh); color: #fff; }
.nut.chinh:hover { background: var(--xanh-dam); box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.nut.toi { background: #1c1f27; color: #fff; }
.nut.toi:hover { background: #000; }
.nut.vien { background: transparent; box-shadow: inset 0 0 0 1.5px var(--vien); }
.nut.vien:hover { background: var(--the-2); }
.nut.da-bat { background: var(--xanh-nhat); color: var(--xanh); box-shadow: inset 0 0 0 1.5px var(--xanh); }
.nut.nho { min-height: 34px; padding: 0 14px; font-size: 12.5px; }
.nut:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.nut svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }

.nut-tron {
  position: relative;
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--nut-tron); color: var(--chu);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.nut-tron:hover { background: var(--nut-tron-hover); }
.nut-tron svg { width: 19px; height: 19px; fill: currentColor; }
.nut-tron img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- Header ---------- */
.dau-trang {
  position: sticky; top: 0; z-index: 50;
  background: var(--dau-nen);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  transition: background .25s, box-shadow .25s, color .25s;
}
.dau-trong {
  max-width: var(--rong); margin: 0 auto; padding: 0 16px;
  height: 60px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
}
.menu-chinh { display: flex; align-items: center; gap: 18px; }
.menu-chinh a {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--chu-mo); padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.menu-chinh a:hover, .menu-chinh a.dang-o { color: var(--chu); border-color: var(--xanh); }
.menu-chinh .chi-dt { display: none; }
.nut-menu { display: none; }

.thuong-hieu { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: .3px; text-transform: uppercase; }
.thuong-hieu img { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.thuong-hieu b { color: var(--do); }
.thuong-hieu i { font-style: normal; color: var(--xanh); }
/* Tren nen toi (banner trang chu, chan trang) dung xanh sang hon cho de doc */
.dau-trang.trong .thuong-hieu i, .chan-trang .thuong-hieu i { color: #4d8dff; }

.cum-nut { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.giu-cho { position: relative; }
.cham-do {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--do); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--the);
}

/* Header trong suot nam tren banner trang chu */
body.trang-chu .dau-trang { position: fixed; left: 0; right: 0; }
.dau-trang.trong { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.dau-trang.trong .menu-chinh a { color: rgba(255, 255, 255, .78); }
.dau-trang.trong .menu-chinh a:hover, .dau-trang.trong .menu-chinh a.dang-o { color: #fff; }
.dau-trang.trong .thuong-hieu { color: #fff; }
.dau-trang.trong .nut-tron { background: rgba(255, 255, 255, .16); color: #fff; }
.dau-trang.trong .nut-tron:hover { background: rgba(255, 255, 255, .26); }

/* ---------- Tha xuong (thong bao, tai khoan) ---------- */
.tha-xuong {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--the); color: var(--chu);
  border-radius: var(--bo); box-shadow: var(--bong-2);
  overflow: hidden;
  animation: hien-len .16s ease;
}
@keyframes hien-len { from { opacity: 0; transform: translateY(-6px); } }
.tha-xuong-dau {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--the-3);
  font-weight: 800; font-size: 14px; text-transform: uppercase;
}
.tha-xuong-ds { max-height: 380px; overflow-y: auto; }
.muc-tha {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 16px; border: 0; background: none; color: inherit; text-align: left;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.muc-tha:hover { background: var(--the-2); }
.muc-tha svg { width: 18px; height: 18px; fill: var(--chu-mo); flex: 0 0 auto; }
.muc-tha.nguy { color: var(--do); }
.muc-tha.nguy svg { fill: var(--do); }
.muc-tha img { width: 38px; height: 57px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.muc-tha .phu { display: block; font-size: 12.5px; font-weight: 500; color: var(--chu-mo); }
.muc-tha.chua-xem { background: var(--xanh-nhat); }
.tha-xuong-trong { padding: 26px 18px; text-align: center; color: var(--chu-mo); font-size: 14px; }
.the-tai-khoan { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--the-3); }
.the-tai-khoan .ten { font-weight: 800; font-size: 15px; }
.huy-hieu {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--do); color: #fff; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .3px; vertical-align: middle;
}

/* ---------- Anh dai dien ---------- */
.anh-dd {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 50%; object-fit: cover;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 16px; text-transform: uppercase;
  background: var(--xanh);
}
.anh-dd.nho { width: 32px; height: 32px; font-size: 13px; }
.anh-dd.lon { width: 48px; height: 48px; font-size: 19px; }

/* ---------- Hero (banner truot) ---------- */
.hero { position: relative; padding: 88px 0 10px; }
.hero-nen {
  position: absolute; left: 0; right: 0; top: 0; height: 64%;
  overflow: hidden; background: #2a2624;
}
.hero-nen-anh {
  position: absolute; inset: -60px;
  background-size: cover; background-position: center;
  filter: blur(38px) saturate(1.25) brightness(.5);
  transition: background-image .5s ease;
}
.hero-nen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 40%);
}
.hero-ray {
  position: relative;
  display: flex; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 max(16px, calc(50% - 640px));
  scroll-padding: 0 max(16px, calc(50% - 640px));
  scrollbar-width: none;
}
.hero-ray::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%;
  height: clamp(230px, 44vw, 560px);
  border-radius: var(--bo); overflow: hidden;
  scroll-snap-align: center;
  background: #1a1a22; color: #fff;
  box-shadow: var(--bong-2);
  isolation: isolate;
}
.slide-nen {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center 30%;
}
.slide-nen.mo { inset: -40px; filter: blur(22px) saturate(1.3) brightness(.62); }
.slide::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, .62) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, 0) 100%),
              linear-gradient(0deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 55%);
}
.slide-bia {
  position: absolute; right: 7%; top: 50%;
  height: 84%; aspect-ratio: 2 / 3;
  transform: translateY(-50%) rotate(2.5deg);
  border-radius: 10px; object-fit: cover;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 255, 255, .9);
  transition: transform .4s ease;
}
.slide:hover .slide-bia { transform: translateY(-50%) rotate(0deg) scale(1.02); }
.slide-chu {
  position: absolute; left: clamp(18px, 3vw, 40px); bottom: clamp(18px, 3vw, 36px);
  max-width: min(560px, 54%);
}
.slide-nhan {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
  background: var(--do); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
}
.slide h2 {
  margin: 0 0 6px; font-size: clamp(20px, 3vw, 34px); line-height: 1.15; font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}
.slide-cau {
  margin: 0 0 14px; font-size: clamp(13px, 1.4vw, 16px); opacity: .9; font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.slide-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; font-size: 13px; opacity: .85; }
.slide-nut { display: flex; flex-wrap: wrap; gap: 10px; }
.slide .nut.toi { background: rgba(10, 10, 14, .82); }
.hero-cham { display: flex; justify-content: center; gap: 7px; padding: 16px 0 4px; }
.hero-cham button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 9px;
  background: var(--chu-nhat); opacity: .5; cursor: pointer;
  transition: width .25s, opacity .25s, background .25s;
}
.hero-cham button.dang-xem { width: 26px; opacity: 1; background: var(--chu); }

/* ---------- Khu vuc & tieu de ---------- */
/* Chi dat le tren/duoi: .khu thuong di kem .khung (le trai/phai 16px) */
.khu { padding-top: 34px; padding-bottom: 6px; }
.khu.dai { background: var(--nen-dai); padding-top: 40px; padding-bottom: 44px; margin-top: 30px; }
.tieu-de-khu { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 20px; }
.tieu-de-khu h2 { margin: 0; font-size: 21px; font-weight: 800; text-transform: uppercase; letter-spacing: .2px; }
.tieu-de-khu .phu { color: var(--chu-mo); font-size: 13.5px; font-weight: 600; }
.tieu-de-khu a.phu:hover { color: var(--xanh); }

/* ---------- Luoi the truyen ---------- */
.luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 18px; }
.the-truyen { display: block; min-width: 0; }
.the-truyen .bia {
  position: relative; aspect-ratio: 2 / 3;
  border-radius: 6px; overflow: hidden;
  background: var(--the-3);
  box-shadow: var(--bong-1);
  transition: transform .2s ease, box-shadow .2s ease;
}
.the-truyen:hover .bia { transform: translateY(-5px); box-shadow: var(--bong-2); }
.the-truyen .bia img { width: 100%; height: 100%; object-fit: cover; }
.the-truyen h3 {
  margin: 10px 0 2px; font-size: 15px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.the-truyen:hover h3 { color: var(--xanh); }
.the-truyen .phu { font-size: 12px; font-weight: 600; color: var(--chu-mo); text-transform: uppercase; letter-spacing: .2px; }
.nhan-goc {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 5px;
  background: var(--do); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .4px;
}
.tim-goc {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55);
}
.tim-goc svg { width: 15px; height: 15px; fill: #ff4d6d; }
.so-goc {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 8px; border-radius: 5px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 700;
}

/* ---------- Doc tiep (hang ngang) ---------- */
.hang-ngang { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.the-doc-tiep {
  flex: 0 0 300px; scroll-snap-align: start;
  display: flex; gap: 12px; padding: 12px;
  background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1);
  transition: box-shadow .2s, transform .2s;
}
.the-doc-tiep:hover { box-shadow: var(--bong-2); transform: translateY(-2px); }
.the-doc-tiep img { width: 62px; height: 93px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.the-doc-tiep .ten { font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.the-doc-tiep .phu { font-size: 12.5px; color: var(--chu-mo); margin: 3px 0 8px; }
.the-doc-tiep .di { color: var(--xanh); font-weight: 800; font-size: 12.5px; text-transform: uppercase; }

/* ---------- Hop ung ho (kieu mau) ---------- */
.hop-ung-ho {
  max-width: 420px; margin: 0 auto;
  background: #0f1424; color: #e8ecf6;
  border-radius: 14px; padding: 16px;
  box-shadow: 0 16px 40px rgba(10, 14, 30, .35);
}
.hop-ung-ho-dau { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 4px 0 14px; }
.hop-ung-ho-dau img { width: 38px; height: 38px; border-radius: 50%; }
.hop-ung-ho-dau h3 {
  margin: 0; font-size: 18px; font-weight: 800; text-transform: uppercase;
  background: linear-gradient(90deg, #5aa7ff, #9ad6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dong-ung-ho {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px; margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  background: #121a2e; color: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dong-ung-ho:hover { border-color: rgba(255, 255, 255, .28); background: #16203a; }
.dong-ung-ho .bieu-tuong { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: #2a1f14; }
.dong-ung-ho .bieu-tuong svg { width: 20px; height: 20px; fill: currentColor; }
.dong-ung-ho b { display: block; font-size: 14.5px; }
.dong-ung-ho span { display: block; font-size: 12.5px; opacity: .8; line-height: 1.45; }
.dong-ung-ho .mui { margin-left: auto; font-size: 20px; font-weight: 800; }
.dong-ung-ho.cam b, .dong-ung-ho.cam .mui { color: #ff9f43; }
.dong-ung-ho.cam .bieu-tuong { color: #ff9f43; }
.dong-ung-ho.do b, .dong-ung-ho.do .mui { color: #ff5c6c; }
.dong-ung-ho.do .bieu-tuong { background: #2c1219; color: #ff5c6c; }
.dong-ung-ho.tim b, .dong-ung-ho.tim .mui { color: #a5a3ff; }
.dong-ung-ho.tim .bieu-tuong { background: #1c1a3a; color: #a5a3ff; }
.chip-link { display: inline-flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.chip-link a {
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); font-size: 12px; font-weight: 700;
}
.chip-link a:hover { background: rgba(255, 255, 255, .18); }

/* ---------- Chuong moi cap nhat ---------- */
.ds-chuong-moi { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.chuong-moi {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1);
  transition: box-shadow .2s, transform .2s;
}
.chuong-moi:hover { box-shadow: var(--bong-2); transform: translateY(-1px); }
.chuong-moi img { width: 44px; height: 66px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.chuong-moi .ten-bo { font-size: 12.5px; color: var(--chu-mo); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.chuong-moi .ten-ch { font-weight: 800; font-size: 15px; }
.chuong-moi .luc { margin-left: auto; text-align: right; font-size: 12px; color: var(--chu-mo); white-space: nowrap; }
.nhan-moi {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: var(--do); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .4px; vertical-align: middle;
}

/* ---------- The trang (khung trang truyen) ---------- */
.the-trang { background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1); overflow: hidden; }
.trang-truyen { padding-top: 24px; padding-bottom: 20px; }

.dau-truyen-banner {
  position: relative; height: clamp(220px, 34vw, 480px);
  overflow: hidden; background: #1a1a22; color: #fff;
  isolation: isolate;
}
.dau-truyen-banner .nen {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center 28%;
}
.dau-truyen-banner .nen.mo { inset: -50px; filter: blur(26px) saturate(1.25) brightness(.6); }
.dau-truyen-banner .bia-mo {
  position: absolute; z-index: -1; right: 6%; top: 50%;
  height: 92%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px;
  transform: translateY(-50%) rotate(3deg); opacity: .9;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.dau-truyen-banner::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .1) 55%, rgba(0, 0, 0, 0) 100%);
}
.banner-chu { position: absolute; left: calc(64px + 220px + 32px); right: 24px; bottom: 22px; }
.banner-chu .tac-gia { font-size: 13.5px; opacity: .88; margin-bottom: 4px; }
.banner-chu h1 { margin: 0; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.15; font-weight: 800; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }

.dau-truyen-than { position: relative; padding: 18px 28px 26px calc(64px + 220px + 32px); min-height: 190px; }
.bia-noi {
  position: absolute; left: 64px; top: -170px;
  width: 220px; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  background: var(--the-3);
}
.hang-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--chu-mo); font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.hang-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hang-meta svg { width: 16px; height: 16px; fill: currentColor; }
.ds-the-loai { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ds-the-loai span {
  padding: 5px 13px; border-radius: 999px; background: var(--the-2);
  box-shadow: inset 0 0 0 1px var(--vien);
  font-size: 13px; font-weight: 700;
}
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; }

.mo-ta-truyen { padding: 0 28px 24px; color: var(--chu-mo); white-space: pre-line; }
.mo-ta-truyen .noi { max-height: 4.8em; overflow: hidden; position: relative; }
.mo-ta-truyen.mo-rong .noi { max-height: none; }
.mo-ta-truyen:not(.mo-rong) .noi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2em; background: linear-gradient(transparent, var(--the)); }
.nut-chu { border: 0; background: none; color: var(--xanh); font-weight: 700; cursor: pointer; padding: 6px 0; font-size: 14px; }

/* ---------- Danh sach chuong (kieu mau) ---------- */
.khoi-chuong { padding: 4px 28px 26px; }
.thanh-cong-cu { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.thanh-cong-cu h2 { margin: 0 auto 0 0; font-size: 17px; font-weight: 800; text-transform: uppercase; }
.o-nhap {
  height: 38px; padding: 0 14px; min-width: 0;
  border-radius: var(--bo-nho); border: 1px solid var(--vien);
  background: var(--the-2); color: var(--chu);
  font-family: inherit; font-size: 14px; outline: none;
}
.o-nhap:focus { border-color: var(--xanh); background: var(--the); }
.ds-chuong { display: grid; gap: 4px; position: relative; }
.khoi-chuong.thu-gon .ds-chuong { max-height: 620px; overflow: hidden; }
.khoi-chuong.thu-gon .ds-chuong::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(transparent, var(--the)); pointer-events: none;
}
.nut-xem-them-wrap { display: flex; justify-content: center; margin-top: -18px; position: relative; z-index: 2; }
.khoi-chuong:not(.thu-gon) .nut-xem-them-wrap { margin-top: 14px; }
.dong-chuong {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px 11px 14px;
  background: var(--the-2); border-left: 4px solid transparent;
  transition: background .12s;
}
.dong-chuong:hover { background: var(--the-3); }
.dong-chuong .so { font-weight: 800; font-size: 16px; min-width: 112px; }
.dong-chuong .chi-tiet { color: var(--chu-mo); font-size: 13px; }
.dong-chuong .chi-tiet b { color: var(--chu); font-weight: 700; }
.dong-chuong .nhan { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dong-chuong.da-doc { border-left-color: var(--la); }
.dong-chuong.da-doc .so { color: var(--chu-mo); }
.dong-chuong.dang-doc { border-left-color: var(--xanh); background: var(--xanh-nhat); }
.dong-chuong.dang-doc .so { color: var(--xanh); }
.nhan-dang-doc { padding: 2px 8px; border-radius: 4px; background: var(--xanh); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.trong-tim { padding: 22px; text-align: center; color: var(--chu-mo); }

/* ---------- Khoi phu cua trang truyen ---------- */
.khoi-phu { padding: 6px 28px 28px; border-top: 1px solid var(--the-3); }
.khoi-phu h2 { font-size: 17px; font-weight: 800; text-transform: uppercase; margin: 22px 0 14px; }
.luoi.nho { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }

/* ---------- Trinh doc ---------- */
body.doc { background: var(--nen-doc); }
.thanh-doc {
  position: sticky; top: 0; z-index: 60;
  background: var(--dau-nen);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.thanh-doc .trong {
  display: flex; align-items: center; gap: 8px;
  max-width: 1400px; margin: 0 auto; padding: 0 12px; height: 58px;
}
.thanh-doc .ten-bo { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.thanh-doc select {
  height: 38px; padding: 0 10px; max-width: 220px;
  border-radius: var(--bo-nho); border: 1px solid var(--vien);
  background: var(--the); color: var(--chu); font-family: inherit; font-size: 14px; font-weight: 600;
  outline: none; cursor: pointer;
}
.thanh-doc .day-phai { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nut-vua {
  height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: var(--bo-nho);
  background: var(--nut-tron); color: var(--chu);
  font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.nut-vua:hover:not(:disabled) { background: var(--nut-tron-hover); }
.nut-vua:disabled { opacity: .35; cursor: not-allowed; }
.nut-vua svg { width: 17px; height: 17px; fill: currentColor; }
.thanh-tien-do { position: absolute; left: 0; bottom: -2px; height: 3px; width: 0; background: var(--xanh); transition: width .1s linear; }

.khung-doc { margin: 0 auto; padding: 0 0 20px; }
.khung-doc img { width: 100%; height: auto; margin: 0 auto; display: block; min-height: 120px; background: var(--the-2); }
.khung-doc img.da-tai { min-height: 0; background: none; }
.khung-doc.rong-vua { max-width: 800px; }
.khung-doc.rong-lon { max-width: 1100px; }
.khung-doc.rong-full { max-width: 100%; }
.khung-doc.lat-trang { display: grid; place-items: center; min-height: calc(100vh - 130px); }
.khung-doc.lat-trang img { display: none; }
.khung-doc.lat-trang img.hien { display: block; max-height: calc(100vh - 130px); width: auto; object-fit: contain; }

.cuoi-chuong { padding: 26px 16px 10px; text-align: center; }
.cuoi-chuong .xong { font-weight: 800; font-size: 15px; color: var(--chu-mo); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px; }
.cuoi-chuong .hang-nut { justify-content: center; }

.nut-len-dau {
  position: fixed; right: 18px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--xanh); color: #fff; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--bong-2);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.nut-len-dau.hien { opacity: 1; transform: none; pointer-events: auto; }
.nut-len-dau svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- O ung ho cuoi chuong (QR) ---------- */
.donate {
  max-width: 640px; margin: 18px auto 0; padding: 22px 20px;
  background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1);
  text-align: center;
}
.donate h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; text-transform: uppercase; }
.donate > p { margin: 0 auto 16px; color: var(--chu-mo); font-size: 14px; max-width: 520px; }
.donate .ghi-chu { margin: 14px 0 0; font-size: 12.5px; color: var(--chu-nhat); }
.noi-dung-donate { display: flex; gap: 18px; align-items: center; justify-content: center; }
.donate .qr { flex: 0 0 200px; }
.donate .qr img { width: 100%; height: auto; border-radius: 12px; background: #fff; box-shadow: var(--bong-1); }
.ds-tk { display: grid; gap: 10px; flex: 1 1 auto; max-width: 280px; }
.the-tk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: var(--bo-nho); background: var(--the-2); }
.the-tk .ngan-hang { font-size: 11.5px; font-weight: 800; color: var(--xanh); text-transform: uppercase; letter-spacing: .5px; }
.the-tk .so-tk { font-size: 19px; font-weight: 800; letter-spacing: .6px; font-variant-numeric: tabular-nums; }
.the-tk .chu-tk { font-size: 13px; color: var(--chu-mo); margin-bottom: 6px; }

/* ---------- Binh luan ---------- */
.binh-luan { padding: 30px 0 60px; }
.binh-luan .tieu-de-khu h2 .dem { color: var(--chu-mo); font-weight: 700; }
.o-viet { display: flex; gap: 12px; padding: 16px; background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1); margin-bottom: 18px; }
.o-viet-than { flex: 1; min-width: 0; }
.o-viet textarea {
  width: 100%; min-height: 84px; max-height: 320px; resize: vertical;
  padding: 11px 13px; border-radius: var(--bo-nho);
  border: 1px solid var(--vien); background: var(--the-2); color: var(--chu);
  font-family: inherit; font-size: 14.5px; line-height: 1.5; outline: none;
}
.o-viet textarea:focus { border-color: var(--xanh); background: var(--the); }
.o-viet-chan { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.dem-ky-tu { font-size: 12px; color: var(--chu-nhat); }
.moi-dang-nhap {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px; margin-bottom: 18px;
  background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1);
  color: var(--chu-mo); font-weight: 600;
}
.ds-binh-luan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bl { display: flex; gap: 12px; padding: 14px 16px; background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1); }
.bl.moi-gui { animation: sang-len 1.6s ease; }
@keyframes sang-len { from { box-shadow: 0 0 0 3px var(--xanh); } }
.bl-than { flex: 1; min-width: 0; }
.bl-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px; }
.bl-dau b { font-size: 14.5px; }
.bl-dau time { font-size: 12.5px; color: var(--chu-nhat); }
.bl-dau .noi-chuong { font-size: 12.5px; color: var(--xanh); font-weight: 700; }
.bl-noi-dung { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.bl-hanh-dong { display: flex; gap: 14px; margin-top: 6px; }
.bl-hanh-dong button { border: 0; background: none; padding: 0; color: var(--chu-nhat); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.bl-hanh-dong button:hover { color: var(--chu); }
.bl-hanh-dong button.nguy:hover { color: var(--do); }
.bl-trong { padding: 26px; text-align: center; color: var(--chu-mo); background: var(--the); border-radius: var(--bo); }

/* ---------- Hop thoai (modal) ---------- */
.hop-nen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 16, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: mo-dan .16s ease;
}
.hop-nen.dang-dong { opacity: 0; transition: opacity .16s; }
@keyframes mo-dan { from { opacity: 0; } }
.hop {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--the); color: var(--chu);
  border-radius: 16px; box-shadow: var(--bong-2);
  padding: 26px 24px 22px;
  animation: noi-len .2s ease;
}
@keyframes noi-len { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.hop.hop-nho { max-width: 400px; }
.hop-dong {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--the-2); color: var(--chu); font-size: 22px; line-height: 1; cursor: pointer;
}
.hop-dong:hover { background: var(--the-3); }
.hop h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.hop-dang-nhap { text-align: center; }
.hop-logo { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; box-shadow: var(--bong-1); }
.ly-do { color: var(--chu-mo); margin: 0 0 10px; }
.loi-ich { list-style: none; padding: 0; margin: 14px 0 20px; text-align: left; display: grid; gap: 8px; }
.loi-ich li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.loi-ich li::before { content: "✓"; color: var(--la); font-weight: 900; }
.nut-google { display: flex; justify-content: center; min-height: 44px; }
.ghi-chu-nho { font-size: 12.5px; color: var(--chu-nhat); margin: 16px 0 0; }
.ghi-chu-nho a { color: var(--xanh); }
.canh-bao-webview {
  text-align: left; padding: 14px; margin: 0 0 16px;
  border-radius: var(--bo-nho); background: rgba(245, 158, 11, .12);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .4);
  font-size: 13.5px;
}
.canh-bao-webview b { display: block; margin-bottom: 4px; }
.dang-nhap-thu { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--vien); text-align: left; }
.dang-nhap-thu label { font-size: 13px; color: var(--chu-mo); display: flex; align-items: center; gap: 6px; }

/* Tim kiem */
.hop.hop-tim { max-width: 620px; align-self: start; margin-top: 8vh; padding: 16px; }
.hop-tim input { width: 100%; height: 50px; font-size: 17px; padding: 0 16px; padding-right: 46px; }
.kq-tim { margin-top: 10px; display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.kq-tim a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--bo-nho); }
.kq-tim a:hover, .kq-tim a.chon { background: var(--the-2); }
.kq-tim img { width: 44px; height: 66px; border-radius: 4px; object-fit: cover; }
.kq-tim b { display: block; }
.kq-tim span { font-size: 13px; color: var(--chu-mo); }

/* Thong bao nho */
.thong-bao-nho {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0;
  max-width: calc(100vw - 32px); padding: 12px 18px;
  border-radius: 12px; background: #1c2130; color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: var(--bong-2);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.thong-bao-nho.hien { opacity: 1; transform: translate(-50%, 0); }
.thong-bao-nho.loi { background: var(--do); }

/* ---------- Tu truyen & quan tri ---------- */
.trang-thuong { padding-top: 28px; padding-bottom: 40px; }
.the-thuong { background: var(--the); border-radius: var(--bo); box-shadow: var(--bong-1); padding: 22px 24px; margin-bottom: 18px; }
.tab { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--the-3); }
.tab button {
  border: 0; background: none; padding: 10px 14px; margin-bottom: -1px;
  font-size: 14px; font-weight: 800; text-transform: uppercase; color: var(--chu-mo);
  border-bottom: 3px solid transparent; cursor: pointer;
}
.tab button.dang-chon { color: var(--chu); border-color: var(--xanh); }
.bang-dong-bo {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px; border-radius: var(--bo);
  background: var(--xanh-nhat); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .3);
  font-size: 14px; font-weight: 600;
}
.dong-lich-su {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border-radius: var(--bo-nho); transition: background .12s;
}
.dong-lich-su:hover { background: var(--the-2); }
.dong-lich-su img { width: 52px; height: 78px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.dong-lich-su .ten { font-weight: 800; }
.dong-lich-su .phu { font-size: 13px; color: var(--chu-mo); }
.dong-lich-su .nut { margin-left: auto; }
.bl-qt { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--the-3); }
.bl-qt .meta { font-size: 12.5px; color: var(--chu-mo); }
.bl-qt .email { font-family: Consolas, monospace; font-size: 12px; color: var(--chu-nhat); }

/* ---------- Trang thai ---------- */
.trang-thai { text-align: center; padding: 70px 20px; color: var(--chu-mo); }
.trang-thai .to { font-size: 44px; margin-bottom: 12px; }
.trang-thai h3 { color: var(--chu); margin: 0 0 8px; font-size: 18px; }
.trang-thai p { margin: 0 0 18px; }
.trang-thai code { background: var(--the-2); padding: 2px 7px; border-radius: 6px; font-size: 13px; color: var(--xanh); }
.xuong-tai { height: 300px; border-radius: var(--bo); background: linear-gradient(90deg, var(--the-2), var(--the-3), var(--the-2)); background-size: 200% 100%; animation: song 1.2s infinite; }
@keyframes song { to { background-position: -200% 0; } }

/* ---------- Van ban (dieu khoan, bao mat) ---------- */
.van-ban h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.van-ban h2 { font-size: 17px; font-weight: 800; margin: 26px 0 8px; }
.van-ban p, .van-ban li { color: var(--chu-mo); }
.van-ban a { color: var(--xanh); font-weight: 600; }

/* ---------- Footer (kieu mau: toi, can giua) ---------- */
.chan-trang { background: var(--chan); color: #c9cedb; padding: 46px 0 40px; margin-top: 50px; text-align: center; }
.chan-trong { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chan-trang .thuong-hieu { color: #fff; }
.chan-mo-ta { margin: 0; font-size: 14px; max-width: 560px; color: #9aa1b3; }
.chan-mxh { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0; }
.chan-mxh a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: #e5e8f0; font-size: 13px; font-weight: 700;
  transition: background .15s;
}
.chan-mxh a:hover { background: rgba(255, 255, 255, .15); }
.chan-mxh svg { width: 16px; height: 16px; fill: currentColor; }
.chan-lien-he { margin: 4px 0 0; font-size: 14px; color: #7ee0b5; }
.chan-lien-he a { color: #fff; font-weight: 600; }
.chan-link { margin: 0; font-size: 13.5px; }
.chan-link a { color: #c9cedb; }
.chan-link a:hover { color: #fff; text-decoration: underline; }
.ban-quyen { margin: 6px 0 0; font-size: 12.5px; color: #6f7689; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .dau-trong { grid-template-columns: auto 1fr auto; height: 56px; }
  .nut-menu { display: grid; }
  .thuong-hieu { justify-self: center; font-size: 16px; }
  .thuong-hieu img { width: 30px; height: 30px; }
  .menu-chinh {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 14px; background: var(--the); box-shadow: var(--bong-2);
  }
  .menu-chinh.mo { display: flex; }
  .menu-chinh a { color: var(--chu) !important; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--the-3); }
  .menu-chinh .chi-dt { display: flex; }
  .an-tren-dt { display: none; }
  .nut-tron { width: 38px; height: 38px; }
  .cum-nut { gap: 6px; }
  .cum-nut #nut-tim { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .hero { padding-top: 70px; }
  .slide { height: 58vw; min-height: 210px; }
  .slide-bia { right: 4%; height: 72%; }
  .slide-chu { max-width: 54%; }
  .slide-cau, .slide-meta { display: none; }
  .slide .nut { min-height: 34px; padding: 0 12px; font-size: 11.5px; }
  .slide .nut.toi { display: none; }

  .luoi { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 20px 12px; }
  .the-truyen h3 { font-size: 14px; }
  .tieu-de-khu h2 { font-size: 18px; }
  .ds-chuong-moi { grid-template-columns: 1fr; }

  .dau-truyen-banner { height: 210px; }
  .dau-truyen-banner .bia-mo { display: none; }
  .banner-chu { display: none; }
  .dau-truyen-than { padding: 0 16px 22px; text-align: center; min-height: 0; }
  .bia-noi { position: relative; left: auto; top: auto; width: 150px; margin: -110px auto 14px; }
  .ten-truyen-dt { display: block !important; margin: 0 0 4px; font-size: 22px; font-weight: 800; line-height: 1.2; }
  .tac-gia-dt { display: block !important; color: var(--chu-mo); font-size: 13px; margin-bottom: 12px; }
  .hang-meta, .ds-the-loai, .hang-nut { justify-content: center; }
  .hang-nut .nut { flex: 1 1 auto; }
  .mo-ta-truyen { padding: 0 16px 20px; }
  .khoi-chuong { padding: 4px 12px 22px; }
  .thanh-cong-cu .o-nhap { flex: 1 1 140px; }
  .dong-chuong { padding: 10px 12px 10px 10px; gap: 10px; }
  .dong-chuong .so { min-width: 96px; font-size: 15px; }
  .dong-chuong .chi-tiet { font-size: 12px; }
  .khoi-phu { padding: 4px 12px 22px; }

  .thanh-doc .ten-bo, .thanh-doc .nhan-che, .thanh-doc #ch-truoc, .thanh-doc #ch-sau, .thanh-doc #doi-rong { display: none; }
  .thanh-doc select { flex: 1 1 auto; max-width: none; min-width: 0; }
  .khung-doc.rong-vua, .khung-doc.rong-lon { max-width: 100%; }
  .noi-dung-donate { flex-direction: column; }
  .donate .qr { flex-basis: auto; width: 220px; max-width: 80%; }
  .ds-tk { width: 100%; max-width: 320px; }
  .the-thuong { padding: 18px 14px; }
}
.ten-truyen-dt, .tac-gia-dt { display: none; }
