/* =========================================================
   TruyenX — giao diện dark theo phong cách truyen3x
   1 file duy nhất, không framework. Biến --r-* cho trang đọc.
   ========================================================= */
:root {
  --bg: #131415;
  --surface: #1a1b1d;
  --surface-2: #222326;
  --text: #dcdcdc;
  --muted: #8d9095;
  --border: rgba(255,255,255,.055);
  --primary: #d27a70;
  --primary-2: #e0958c;
  --primary-soft: rgba(210,122,112,.13);
  --accent: #cfa25a;
  --danger: #dc2626;
  --hot: #ef4444;
  --full: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.18);
  --header-h: 58px;
  --font: "Quicksand", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-family: var(--font); }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.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; }
.empty { padding: 30px 0; text-align: center; }
.ic { width: 15px; height: 15px; vertical-align: -2px; flex-shrink: 0; }
.ic-star { fill: #cfa25a; stroke: #cfa25a; opacity: .95; }
.ic-heart { stroke: #e0958c; opacity: .95; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 8px; }
.container-narrow { max-width: 900px; }
.container-md { max-width: 960px; }
.container-xs { max-width: 440px; }
.site-main { flex: 1; padding: 16px 0 32px; }
.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.col-side { position: sticky; top: calc(var(--header-h) + 12px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26,27,29,.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(210,122,112,.22), transparent);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); position: relative; }
.logo {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font); font-weight: 800; font-size: 22px;
  letter-spacing: -.2px; line-height: 1; text-transform: uppercase; color: var(--primary);
}
.logo:hover { text-decoration: none; }
.logo-text { display: inline-flex; align-items: center; }
.lg-main { color: #ffffff; font-weight: 600; }
.lg-hi { color: #df8378; font-weight: 600; }
.lg-tld { align-self: flex-start; color: #7d8086; font-weight: 800; font-size: .46em; letter-spacing: .5px; margin: -.15em 0 0 2px; }
.logo:hover .lg-main { color: #f3d9d5; }
.logo:hover .lg-hi { color: #e9978d; }
.site-header .lg-tld { display: none; }
.nav-toggle { display: none; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.has-drop { position: relative; }
.nav-link {
  display: block; padding: 8px 12px; border-radius: 8px; background: none; border: 0;
  cursor: pointer; color: var(--text); font-weight: 500; white-space: nowrap; font-size: 15px;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--primary); }
.nav-link.is-active { color: var(--primary-2); }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; display: none; z-index: 60;
}
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px;
  color: var(--text); background: none; border: 0; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.dropdown-genres { display: none; grid-template-columns: repeat(3, 150px); }
.has-drop:hover > .dropdown, .has-drop.open > .dropdown { display: block; }
.has-drop:hover > .dropdown-genres, .has-drop.open > .dropdown-genres { display: grid; }
.search-box { position: relative; flex: 1; max-width: 340px; margin-left: auto; display: flex; }
.search-box input {
  width: 100%; padding: 8px 38px 8px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface-2); outline: none; color: var(--text);
}
.search-box input:focus { border-color: var(--primary); background: var(--surface); }
.search-box button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: 6px 8px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.search-box button:hover { color: var(--primary-2); }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: hidden; z-index: 70;
}
.suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; color: var(--text); }
.suggest a:hover, .suggest a.active { background: var(--surface-2); text-decoration: none; }
.suggest a strong { display: block; font-size: 14px; }
.suggest a small { color: var(--muted); }
.suggest .suggest-all { justify-content: center; color: var(--primary); font-size: 13px; border-top: 1px solid var(--border); }
.search-toggle { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 18px; padding: 6px 8px; border-radius: 8px; line-height: 1; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.header-user { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; }
.header-user:hover { text-decoration: none; }

/* ---------- Buttons / labels / chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: .15s; font-size: 15px;
}
.btn:hover { background: var(--primary-2); border-color: var(--primary-2); color: #fff; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-2); }
.btn-ghost.is-active { background: var(--primary-soft); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: #c2410c; border-color: #c2410c; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--primary); font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.label {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  vertical-align: middle; text-transform: uppercase; letter-spacing: .3px;
}
.label + .label { margin-left: 5px; }
.label-full { background: rgba(34,197,94,.14); color: #8cc5a0; }
.label-hot { background: rgba(210,122,112,.16); color: #e0958c; }
.label-new { background: rgba(251,191,36,.14); color: #cfa25a; }
.label-audio { background: rgba(207,162,90,.15); color: #dcbc84; }
.label-admin { background: rgba(185,179,214,.12); color: #b9b3d6; }
.chip {
  font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); color: #d0d0d0;
}
.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.genre-chips .chip {
  font-size: 13px; padding: 5px 13px; border-radius: 999px; color: #d6d6d6;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
}
.genre-chips button.chip { cursor: pointer; }
.genre-chips .chip:hover { color: #fff; background: var(--primary-soft); border-color: rgba(210,122,112,.35); text-decoration: none; }
.genre-chips .chip.is-active { color: #fff; background: var(--primary); border-color: var(--primary); }

/* ---------- Boxes & sections ---------- */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.box-flush { padding: 0; overflow: hidden; }
.box-head { padding: 16px 18px 12px; margin: 0; border-bottom: 1px solid var(--border); }
.box-foot { padding: 12px; text-align: center; border-top: 1px solid var(--border); }
.box-title { font-size: 17px; margin-bottom: 12px; }
.box-title .ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; color: var(--primary-2); }
.box-title-ic { display: flex; align-items: center; gap: 9px; }
.box-title-ic svg { color: var(--primary-2); flex-shrink: 0; padding: 6px; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); box-sizing: border-box; }
.page-title { font-size: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head .box-title, .section-head .page-title { margin: 0; }
.section-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.section-head .section-title { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.st-bar { width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, #e0958c, #bd6a61); flex-shrink: 0; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary-2); }
.breadcrumb .sep { margin: 0 6px; opacity: .6; }
.ad { margin: 0 0 16px; text-align: center; }
.ad:empty { display: none; }

/* ---------- Spotlight ---------- */
.spotlight { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin: 4px 0 16px; }
.spot-main {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 26px 22px; border-radius: 16px; color: var(--text); overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
  background: radial-gradient(120% 140% at 0% 0%, rgba(210,122,112,.12), transparent 55%),
              radial-gradient(90% 120% at 100% 100%, rgba(207,162,90,.06), transparent 60%),
              linear-gradient(160deg, #1d1d1f, #17181a);
}
.spot-main:hover { text-decoration: none; color: var(--text); border-color: rgba(210,122,112,.6); }
.spot-kicker { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary-2); }
.spot-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spot-genres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spot-title { font-size: 30px; line-height: 1.2; font-weight: 800; }
.spot-desc { color: #a9abaf; font-size: 14.5px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-top: auto; }
.spot-meta span { display: inline-flex; align-items: center; gap: 4px; }
.spot-cta {
  align-self: flex-start; margin-top: 4px; padding: 9px 20px; border-radius: 999px;
  background: linear-gradient(90deg, #d27a70, #bd6a61); color: #fff; font-weight: 700;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s;
}
.spot-main:hover .spot-cta { transform: translateX(3px); }
.spot-side { display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; }
.spot-item {
  display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, background .15s;
}
.spot-item:hover { text-decoration: none; color: var(--text); border-color: rgba(210,122,112,.5); background: var(--surface-2); }
.spot-no { font-size: 26px; font-weight: 900; width: 30px; text-align: center; color: transparent; -webkit-text-stroke: 1.5px #e0958c; flex-shrink: 0; }
.spot-item-body { display: flex; flex-direction: column; min-width: 0; }
.spot-item-body strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-item:hover strong { color: var(--primary-2); }
.spot-item-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Audio home ---------- */
.audio-home { margin: 0 0 16px; }
.ac-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.audio-card {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 84px;
  padding: 14px 16px; border-radius: 14px; overflow: hidden; color: var(--text);
  border: 1px solid rgba(255,255,255,.06);
  background: radial-gradient(120% 140% at 0% 0%, rgba(207,162,90,.10), transparent 55%), linear-gradient(160deg, #1d1e20, #17181a);
  transition: border-color .2s, transform .2s, background .2s;
}
.audio-card:hover { text-decoration: none; color: var(--text); border-color: rgba(210,122,112,.45); transform: translateY(-2px); }
.ac-play {
  position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .2s, background .2s;
}
.ac-play svg { margin-left: 2px; }
.audio-card:hover .ac-play { transform: scale(1.08); background: var(--primary-2); }
.ac-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ac-body strong { font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.audio-card:hover .ac-body strong { color: #fff; }
.ac-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-wave { position: absolute; right: 12px; bottom: 10px; display: flex; align-items: flex-end; gap: 3px; height: 26px; opacity: .22; }
.ac-wave i { width: 3px; border-radius: 2px; background: #cfa25a; height: 30%; }
.ac-wave i:nth-child(2) { height: 70%; }
.ac-wave i:nth-child(3) { height: 45%; }
.ac-wave i:nth-child(4) { height: 95%; }
.ac-wave i:nth-child(5) { height: 55%; }
.ac-wave i:nth-child(6) { height: 80%; }
.ac-wave i:nth-child(7) { height: 35%; }
.audio-card:hover .ac-wave { opacity: .5; }
.audio-card:hover .ac-wave i { animation: acWave .9s ease-in-out infinite alternate; }
.audio-card:hover .ac-wave i:nth-child(2n) { animation-delay: .2s; }
.audio-card:hover .ac-wave i:nth-child(3n) { animation-delay: .4s; }
@keyframes acWave { from { transform: scaleY(.55); } to { transform: scaleY(1.15); } }

/* ---------- Update list (trang chủ) ---------- */
.home-cols > .col-main, .home-cols > .col-side { display: flex; flex-direction: column; }
.home-cols > .col-main > .box { flex: 1; display: flex; flex-direction: column; margin-bottom: 0; }
.home-cols .update-list { flex: 1; }
.home-cols .box-foot { margin-top: auto; }
.home-cols > .col-side > .box:last-child { flex: 1; margin-bottom: 0; }
.box-flush .update-list { padding: 0 6px; }
.update-list { display: flex; flex-direction: column; }
.update-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 140px 110px 100px; gap: 10px;
  align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.update-item:last-child { border-bottom: 0; }
.update-item:hover { background: var(--surface-2); }
.u-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-title a { color: var(--text); font-weight: 500; }
.u-title a:hover { color: var(--primary); text-decoration: none; }
.u-title .label { margin-left: 6px; }
.u-title .label:first-child { margin-left: 0; }
.u-genre { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-chap { white-space: nowrap; }
.u-time { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: right; }
.chap-link { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chap-link:hover { color: var(--primary-2); }

/* ---------- Rank list & cat list (sidebar) ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.rank-list li:last-child { border-bottom: 0; }
.rank-no {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.rank-1 { background: #cfa25a; color: #fff; border-color: #cfa25a; }
.rank-2 { background: #94a3b8; color: #fff; border-color: #94a3b8; }
.rank-3 { background: #b45309; color: #fff; border-color: #b45309; }
.rank-body { min-width: 0; }
.rank-list a { color: var(--text); font-weight: 500; }
.rank-list a:hover { color: var(--primary); text-decoration: none; }
.rank-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.rank-meta span { display: inline-flex; align-items: center; gap: 3px; }
.rank-meta em { font-style: normal; opacity: .7; margin-left: 3px; }
.rank-norate { opacity: .75; }
.rank-norate .ic-star { fill: none; stroke: currentColor; opacity: .5; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cat-list li + li { border-top: 1px solid rgba(255,255,255,.04); }
.cat-list a {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px; margin: 0 -10px;
  border-radius: 10px; color: #d9d9d9; font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.cat-list a i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .55; flex-shrink: 0; transition: .15s; }
.cat-list a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-list a b { color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; opacity: .5; transition: .15s; }
.cat-list a:hover { background: rgba(255,255,255,.035); color: #fff; text-decoration: none; }
.cat-list a:hover i { opacity: 1; box-shadow: 0 0 0 4px rgba(210,122,112,.15); }
.cat-list a:hover b { opacity: 1; color: var(--primary-2); transform: translateX(3px); }

/* ---------- Story rows (listing) ---------- */
.story-rows { display: flex; flex-direction: column; }
.story-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: start; }
.story-row:last-child { border-bottom: 0; }
.story-row-main, .story-row-body { min-width: 0; }
.story-row-title { font-size: 16px; margin: 0 0 4px; font-family: var(--font); font-weight: 600; }
.story-row-title a { color: var(--text); }
.story-row-title a:hover { color: var(--primary); text-decoration: none; }
.story-row-title .label { margin-left: 6px; }
.story-row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.story-row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.story-row-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.story-row-genres a {
  font-size: 12px; padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted);
}
.story-row-genres a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.story-row-desc { margin: 6px 0 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.story-row-side time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ranked-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.ranked-item:last-child { border-bottom: 0; }
.ranked-item .story-row { border: 0; }
.ranked-body { min-width: 0; }
.ranked-no { font-size: 20px; font-weight: 900; text-align: center; color: transparent; -webkit-text-stroke: 1.3px #e0958c; }
.ranked-item:nth-child(1) .ranked-no { -webkit-text-stroke-color: #cfa25a; }

/* ---------- Filter bar / pagination / tabs ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.filter-bar .input { flex: 1 1 240px; }
.input, .select-sm, .input-sm, textarea, select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: none; max-width: 100%; color: var(--text);
}
.select-sm, .input-sm { padding: 6px 10px; font-size: 14px; }
.input:focus, textarea:focus, select:focus, .input-sm:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { width: 100%; resize: vertical; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 16px; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pagination .dots { border: 0; background: none; }
.rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.rank-tabs a {
  padding: 6px 14px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--muted); font-size: 14px; font-weight: 500;
}
.rank-tabs a:hover { color: #fff; text-decoration: none; }
.rank-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Forms / auth / profile ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 14px; }
.form label.check, .radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; }
.form .input { width: 100%; }
.form input[type="text"], .form input[type="password"] {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: none; width: 100%;
}
.form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-error {
  background: rgba(220,38,38,.12); border: 1px solid rgba(220,38,38,.35); color: #f3a49d;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px;
}
.auth-box { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 84px; height: 84px; font-size: 34px; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: hsl(var(--h, 20), 55%, 45%); color: #fff; font-weight: 700; }
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.profile-head .page-title { margin: 0; }
.profile-head .btn { margin-left: auto; }
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 72px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0 16px; margin-top: auto; }
.site-footer .footer-inner, .site-footer .copyright { text-align: center; }
.site-footer .footer-inner > div { display: flex; flex-direction: column; align-items: center; }
.site-footer .footer-inner p { max-width: 820px; margin-left: auto; margin-right: auto; }
.site-footer .logo { font-size: 21px; justify-content: center; }
.site-footer .logo-text { display: inline-flex; }
.footer-inner p { margin: 8px 0 0; }
.copyright { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.online-counter {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px;
  margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07); color: #b8b8b8; font-size: 13px;
}
.online-counter b { color: #f0f0f0; font-weight: 700; }
.online-counter svg { color: var(--muted); }
.online-counter:hover { text-decoration: none; color: #e6e6e6; border-color: rgba(210,122,112,.4); }
.online-counter:hover svg { color: var(--primary-2); }
.oc-dot { width: 8px; height: 8px; border-radius: 50%; background: #5bd08a; box-shadow: 0 0 0 0 rgba(91,208,138,.6); animation: ocPulse 2s infinite; flex-shrink: 0; display: inline-block; }
.oc-sep { width: 1px; height: 12px; background: rgba(255,255,255,.12); }
@keyframes ocPulse { 0% { box-shadow: 0 0 0 0 rgba(91,208,138,.5); } 70% { box-shadow: 0 0 0 7px rgba(91,208,138,0); } 100% { box-shadow: 0 0 0 0 rgba(91,208,138,0); } }
.to-top {
  position: fixed; right: 16px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--primary); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 300; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---------- Reader ---------- */
body.reading { --r-bg: #17181a; --r-text: #cfcfcf; }
body.reading .site-main { padding-top: 0; }
.reader { background: var(--r-bg, #17181a); color: var(--r-text, #cfcfcf); padding: 26px 0 10px; }
.reader-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; }
.reader-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d27a70, #cfa25a); transition: width .1s; }
.reader-container { max-width: calc(var(--r-width, 1100px) + 40px); margin: 0 auto; padding: 0 18px; }
.chapter-head { text-align: center; margin-bottom: 30px; }
.ch-genres { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ch-genres a {
  font-size: 11.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  color: #e6a79f; padding: 2px 10px; border-radius: 999px; background: rgba(210,122,112,.12);
}
.ch-genres a:hover { text-decoration: none; background: rgba(210,122,112,.22); }
.ch-story { font-size: 30px; font-weight: 800; line-height: 1.25; margin: 0 0 6px; color: #ececec; letter-spacing: -.2px; }
.chapter-title { font-size: 17px; font-weight: 500; margin: 0 0 8px; color: inherit; opacity: .8; font-family: var(--font); }
.chapter-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; font-size: 13px; color: inherit; opacity: .55; margin: 8px 0 18px; }
.chapter-meta span + span::before { content: "·"; margin: 0 10px; }
.ch-bar {
  display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
}
.ch-arrow, .ch-tool {
  height: 34px; min-width: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent;
  color: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 5px; opacity: .8; transition: .15s; white-space: nowrap;
}
.ch-arrow { font-size: 22px; padding: 0; width: 34px; line-height: 1; }
.ch-arrow:hover, .ch-tool:hover { background: rgba(255,255,255,.08); opacity: 1; text-decoration: none; color: inherit; }
.ch-tool.is-active, .ch-tool.on { color: #e6a79f; opacity: 1; }
.ch-arrow.disabled { opacity: .2; pointer-events: none; }
.ch-sep { width: 1px; height: 20px; background: rgba(255,255,255,.12); margin: 0 2px; }
.ch-pick {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px; height: 34px; padding: 0 14px;
  border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s;
}
.ch-pick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-pick i { font-style: normal; font-size: 10px; opacity: .55; }
.ch-pick .ic { width: 15px; height: 15px; opacity: .65; flex-shrink: 0; }
.ch-tool .ic { width: 16px; height: 16px; flex-shrink: 0; }
.ch-tool.is-active .ic-heart { fill: #e6a79f; stroke: #e6a79f; }
.ch-pick:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.chapter-content {
  max-width: var(--r-width, 1100px); margin: 0 auto;
  font-family: var(--r-font, var(--font));
  font-size: var(--r-size, 18px); line-height: var(--r-lh, 1.8); text-align: var(--r-align, left);
  overflow-wrap: break-word; padding: 0 0 10px;
  -webkit-user-select: text; user-select: text; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
.chapter-content p { margin: 0 0 1.15em; }
.chapter-content:empty { display: none; }
.ch-end { display: flex; align-items: center; gap: 14px; max-width: var(--r-width, 1100px); margin: 26px auto; color: inherit; opacity: .35; }
.ch-end::before, .ch-end::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.ch-foot-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: var(--r-width, 1100px); margin: 0 auto 12px; }
.ch-big {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.03); color: inherit;
  font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; transition: .15s;
}
.ch-big small { font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; opacity: .5; }
.ch-big:hover { text-decoration: none; color: inherit; border-color: rgba(210,122,112,.5); background: rgba(210,122,112,.08); }
.ch-big-next { text-align: right; background: linear-gradient(135deg, rgba(210,122,112,.22), rgba(210,122,112,.08)); border-color: rgba(210,122,112,.35); }
.ch-big.disabled { opacity: .3; pointer-events: none; background: transparent; border-style: dashed; }
.ch-foot-select { text-align: center; margin-bottom: 22px; }
.rate-box { display: flex; align-items: center; gap: 2px; }
.chapter-rate { flex-direction: column; gap: 6px; margin: 4px auto 0; max-width: var(--r-width, 1100px); text-align: center; }
.chapter-rate .small { opacity: .75; }
.stars-row { display: inline-flex; }
.star-btn { background: none; border: 0; cursor: pointer; font-size: 24px; color: #3a3c40; padding: 0 2px; line-height: 1; transition: transform .1s; }
.star-btn.on, .star-btn.hover { color: #cfa25a; }
.star-btn:hover { transform: scale(1.15); }
.hint-keys { opacity: .35; margin: 12px 0 0; text-align: center; font-size: 13px; }
.reader-ad { max-width: var(--r-width, 1100px); margin: 18px auto; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); color: var(--text); border-radius: 12px; width: 100%; max-width: 440px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-of-type { border-bottom: 0; }
.setting-row label { font-weight: 500; font-size: 14px; }
.theme-swatches { display: flex; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.sw.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sw-dark { background: #17181a; }
.sw-black { background: #000; }
.sw-sepia { background: #1c1712; }
.sw-green { background: #0f1a13; }
.sw-gray { background: #1f2329; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 36px; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); cursor: pointer; color: var(--text); }
.stepper span { min-width: 48px; text-align: center; font-weight: 600; }
#report-modal textarea { margin: 10px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.chap-modal { background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.chap-box {
  max-width: 560px; padding: 0; display: flex; flex-direction: column;
  max-height: min(82vh, 700px); overflow: hidden; border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.5); animation: chapIn .18s ease-out;
  background: var(--surface); color: var(--text); width: 100%;
}
@keyframes chapIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.chap-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 12px 20px; }
.chap-head::before { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(255,255,255,.18); }
.chap-head-text { min-width: 0; }
.chap-head h3 { font-size: 17px; margin: 0 0 2px; }
.chap-head .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chap-search { padding: 0 20px 14px; border-bottom: 1px solid var(--border); }
.chap-search input { width: 100%; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); outline: none; font-size: 14px; color: var(--text); }
.chap-search input:focus { border-color: var(--primary); }
.chap-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.chap-list a { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--text); }
.chap-list a b {
  min-width: 36px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.chap-list a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.chap-list a em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--primary-2); flex-shrink: 0; }
.chap-list a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.chap-list a.is-current { background: var(--primary-soft); }
.chap-list a.is-current b { background: var(--primary); color: #fff; }
.chap-list a.is-read span { color: var(--muted); }
.chap-list a.is-read b::after { content: "✓"; margin-left: 3px; color: #8cc5a0; font-size: 10px; }
.chap-note { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Comments ---------- */
.comments { margin-top: 4px; }
.comment-form { margin-bottom: 16px; }
.comment-form textarea { margin-bottom: 8px; }
.right { text-align: right; }
.modal-box .right { margin-top: 14px; }
.form > p.center { margin: 4px 0 0; }
.hp { display: none !important; }
.cmt-act { background: none; border: 0; padding: 0; cursor: pointer; color: var(--primary); font-size: 13px; }
.cmt-act:hover { text-decoration: underline; }
.empty-cmt { padding: 10px 0; }
.reply-box { margin-top: 8px; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.comment .avatar { width: 38px; height: 38px; font-size: 15px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.comment-head time { color: var(--muted); font-size: 12.5px; }
.comment-head .cmt-where { color: var(--muted); font-size: 12.5px; }
.comment-text { margin: 4px 0; overflow-wrap: anywhere; font-size: 14.5px; }
.comment-text p { margin: 0; }
.comment-actions { display: flex; gap: 14px; }
.replies { margin-top: 4px; }
.replies .comment { padding: 10px 0 4px; border-top: 1px dashed var(--border); }
.replies .avatar { width: 30px; height: 30px; font-size: 12px; }
.reply-form { margin-top: 8px; }
.reply-form textarea { margin-bottom: 6px; }
.cmt-login-note { padding: 14px; border: 1px dashed var(--border); border-radius: 8px; text-align: center; color: var(--muted); margin-bottom: 8px; }

/* ---------- Audio player ---------- */
.audio-box {
  max-width: var(--r-width, 1100px); margin: 0 auto 26px; padding: 18px 20px; border-radius: 16px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); color: var(--r-text, #cfcfcf);
}
.ap-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.ap-disc {
  position: relative; width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #d27a70, #a95a52); box-shadow: 0 8px 24px rgba(210,122,112,.25);
}
.ap-eq { position: absolute; right: 7px; bottom: 7px; display: flex; align-items: flex-end; gap: 2px; height: 14px; opacity: 0; transition: opacity .2s; }
.ap-eq i { width: 3px; height: 100%; border-radius: 2px; background: rgba(255,255,255,.9); transform-origin: bottom; transform: scaleY(.3); }
.ap.is-playing .ap-eq { opacity: 1; }
.ap.is-playing .ap-eq i { animation: apEq .8s ease-in-out infinite alternate; }
.ap.is-playing .ap-eq i:nth-child(2) { animation-delay: .25s; }
.ap.is-playing .ap-eq i:nth-child(3) { animation-delay: .5s; }
.ap.is-playing .ap-eq i:nth-child(4) { animation-delay: .1s; }
.ap.is-playing .ap-disc svg { opacity: .55; }
@keyframes apEq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.ap-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-info strong { font-size: 18px; color: #f2f2f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-info span { font-size: 13.5px; color: #a9abaf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-state { font-style: normal; font-size: 12px; color: var(--primary-2); margin-top: 2px; }
.ap-seek { padding: 10px 0; cursor: pointer; touch-action: none; outline: none; }
.ap-track { position: relative; height: 6px; border-radius: 6px; background: rgba(255,255,255,.09); }
.ap-buf { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: rgba(255,255,255,.12); }
.ap-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #d27a70, #e0958c); }
.ap-knob {
  position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transform: scale(0); transition: transform .15s;
}
.ap-seek:hover .ap-knob, .ap.is-drag .ap-knob, .ap-seek:focus-visible .ap-knob { transform: scale(1); }
.ap-seek:hover .ap-track, .ap.is-drag .ap-track { height: 8px; margin-top: -1px; }
.ap-times { display: flex; justify-content: space-between; font-size: 12px; color: #8d9095; font-variant-numeric: tabular-nums; margin-top: -2px; }
.ap-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 18px; }
.ap-btn {
  position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; background: transparent;
  color: #d6d6d6; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, color .15s;
}
.ap-btn:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.ap-btn b { position: absolute; font-size: 8.5px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.ap-side.is-off { opacity: .25; pointer-events: none; }
.ap-play {
  position: relative; width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e0958c, #c9675d); box-shadow: 0 10px 28px rgba(210,122,112,.35);
  transition: transform .15s, box-shadow .15s;
}
.ap-play:hover { transform: scale(1.05); box-shadow: 0 12px 34px rgba(210,122,112,.45); }
.ap-play:active { transform: scale(.97); }
.ap-i-play { margin-left: 4px; }
.ap-i-pause, .ap.is-playing .ap-i-play { display: none; }
.ap.is-playing .ap-i-pause { display: block; }
.ap-spin { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: rgba(255,255,255,.8); opacity: 0; }
.ap.is-loading .ap-spin { opacity: 1; animation: apSpin .8s linear infinite; }
@keyframes apSpin { to { transform: rotate(360deg); } }
.ap-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.ap-speed { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.04); }
.ap-speed button { border: 0; background: none; color: #a9abaf; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.ap-speed button:hover { color: #fff; }
.ap-speed button.on { background: var(--primary-soft); color: var(--primary-2); }
.ap-vol { display: inline-flex; align-items: center; gap: 8px; color: #a9abaf; }
.ap-vol input { width: 96px; accent-color: #d27a70; }
.ap-auto { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: #b5b5b5; cursor: pointer; position: relative; }
.ap-switch { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 20px; background: rgba(255,255,255,.12); transition: background .2s; flex-shrink: 0; }
.ap-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.ap-switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ap-switch:has(input:checked) { background: var(--primary); }
.ap-switch:has(input:checked) i { transform: translateX(14px); }
audio[data-ap-audio] { display: none; }

/* ---------- Stats ---------- */
.stats-page .page-title { margin-bottom: 4px; }
.st-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.st-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.st-card-live { background: radial-gradient(120% 140% at 0% 0%, rgba(91,208,138,.09), transparent 60%), var(--surface); }
.st-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.st-card strong { font-size: 30px; font-weight: 700; color: #f2f2f2; line-height: 1.25; }
.st-card em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.st-chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-bottom: 22px; }
.st-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.st-col span { display: block; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #d27a70, rgba(210,122,112,.4)); min-height: 2px; transition: background .15s; }
.st-col:hover span { background: #e0958c; }
.st-col em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-style: normal; color: var(--muted); white-space: nowrap; }

/* ---------- Age gate ---------- */
body.gated { overflow: hidden; }
.age-gate {
  position: fixed; inset: 0; z-index: 1000; background: rgba(8,8,9,.9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.age-gate-box { background: var(--surface); color: var(--text); border-radius: 16px; max-width: 420px; width: 100%; padding: 28px 24px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.age-gate-box h2 { font-size: 20px; }
.age-gate-box p { color: var(--muted); font-size: 14px; }
.age-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px;
  border-radius: 50%; border: 3px solid var(--danger); color: var(--danger);
  font-weight: 900; font-size: 17px; margin-bottom: 12px;
}
.age-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.age-leave { color: var(--muted); font-size: 14px; padding: 8px; }
.age-leave:hover { color: var(--text); }

/* ---------- Mobile drawer ---------- */
html.drawer-lock, html.drawer-lock body { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 400; visibility: hidden; transition: visibility 0s linear .3s; }
.drawer.open { visibility: visible; transition-delay: 0s; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s ease; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(84vw, 330px); display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 20px 0 50px rgba(0,0,0,.45); transform: translateX(-102%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 14px 18px; border-bottom: 1px solid rgba(255,255,255,.05); }
.drawer-head .logo { font-size: 20px; }
.drawer-head .logo-text { display: inline-flex; }
.drawer-x {
  width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer;
}
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 16px; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--text); font-size: 15px; font-weight: 500; }
.drawer-nav a svg { color: var(--muted); flex-shrink: 0; }
.drawer-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.drawer-nav a.is-active { background: var(--primary-soft); color: var(--primary-2); }
.drawer-nav a.is-active svg { color: var(--primary-2); }
.drawer-label { margin: 18px 12px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.drawer-label-top { margin-top: 6px; }
.drawer-nav + .drawer-label { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.05); }
.drawer-genres { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 8px; }
.drawer-genres a { padding: 7px 13px; border-radius: 999px; font-size: 13.5px; color: #d6d6d6; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.drawer-genres a:hover, .drawer-genres a.is-active { color: #fff; background: var(--primary-soft); border-color: rgba(210,122,112,.35); text-decoration: none; }
.drawer-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.05); }
.drawer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-btns .btn { height: 42px; }
.drawer-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.drawer-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.drawer-acc a { padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.04); color: var(--text); font-size: 13.5px; text-align: center; }
.drawer-acc a:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Cover placeholder (dự phòng khi dùng bìa) ---------- */
.cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.cover-ph {
  display: flex; align-items: flex-end; padding: 10px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--h, 20), 60%, 45%), hsl(calc(var(--h, 20) + 40), 65%, 25%));
  color: #fff; font-weight: 700; font-size: 14px; line-height: 1.3; text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.cover-ph::before { content: "📖"; position: absolute; top: 10px; right: 10px; font-size: 22px; opacity: .5; }
.cover-ph span { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .reader-container { padding: 0 14px; }
  .spot-title { font-size: 26px; }
}
@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0; border-radius: 10px; color: var(--text);
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); cursor: pointer;
  }
  .main-nav, .main-nav.open { display: none; }
  .layout-2col { grid-template-columns: minmax(0, 1fr); }
  .col-main { min-width: 0; }
  .col-side { position: static; }
  .spotlight { grid-template-columns: 1fr; }
  .spot-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .home-cols .update-item:nth-child(n+17) { display: none; }
  .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-card-live { grid-column: span 2; }
  .site-header .search-box {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    max-width: none; margin: 0; padding: 10px 12px; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(0,0,0,.35);
  }
  .site-header.search-open .search-box { display: flex; animation: searchDown .18s ease-out; }
  @keyframes searchDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  .site-header .search-box input { height: 42px; font-size: 16px; }
  .site-header .search-box button { right: 16px; }
  .site-header .search-box .suggest { left: 12px; right: 12px; top: calc(100% - 4px); }
  .search-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 38px; height: 38px; padding: 0; border-radius: 10px; color: var(--text); cursor: pointer;
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03);
  }
  .search-toggle .i-close { display: none; }
  .search-open .search-toggle { background: var(--surface-2); color: var(--primary-2); }
  .search-open .search-toggle .i-search { display: none; }
  .search-open .search-toggle .i-close { display: block; }
  .hide-sm { display: none !important; }
  .header-actions .login-btn {
    width: 38px; height: 38px; padding: 0; border-radius: 10px; justify-content: center;
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--text);
  }
  .header-actions .login-btn span { display: none; }
  .header-actions { gap: 6px; margin-left: 0; }
  .search-box { margin-left: 0; }
}
@media (max-width: 760px) {
  .st-chart { height: 150px; }
  .comment { gap: 10px; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .header-inner { gap: 6px; }
  .header-inner > .logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .logo { font-size: 19px; gap: 0; }
  .spot-side { grid-template-columns: 1fr; gap: 8px; }
  .spot-main { padding: 20px 18px 18px; }
  .spot-title { font-size: 23px; }
  .spot-desc { -webkit-line-clamp: 3; font-size: 14px; }
  .spot-item { padding: 10px 12px; }
  .update-item { grid-template-columns: minmax(0, 1fr) 96px; }
  .u-genre, .u-time { display: none; }
  .story-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .story-row-side { flex-direction: row; align-items: center; text-align: left; }
  .ch-story { font-size: 23px; }
  .chapter-head { margin-bottom: 22px; }
  .ch-big { padding: 12px 14px; font-size: 14px; }
  .ac-grid { grid-template-columns: 1fr; }
  .ac-body strong { font-size: 14px; }
  .ranked-no { font-size: 17px; }
  .ranked-item { grid-template-columns: 26px minmax(0, 1fr); }
  .profile-head { flex-wrap: wrap; }
  .ap-controls { gap: 10px; }
  .ap-vol { display: none; }
  .box { padding: 16px 14px; }
  .box-flush { padding: 0; }
}
@media (max-width: 640px) {
  .page-title { font-size: 21px; }
  .auth-box { padding: 18px 16px; }
  .pagination a, .pagination span { min-width: 32px; height: 32px; font-size: 13px; }
  .filter-bar .select-sm { flex: 1 1 40%; }
}
@media (max-width: 400px) {
  .ch-pick { max-width: 168px; }
  .ch-bar { gap: 4px; padding: 5px; }
  .st-cards { grid-template-columns: 1fr; }
  .st-card-live { grid-column: auto; }
  .error-code { font-size: 54px; }
}

/* ===== ROUND 2: CSS port nguyên xi từ truyen3x (user/writer/stats/auth) ===== */
.container-md { max-width: 960px; }
.container-xs { max-width: 440px; }
.danger { color: var(--danger) !important; }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; display: none; z-index: 60; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.dropdown-genres { display: none; grid-template-columns: repeat(3, 150px); }
.dropdown-right { left: auto; right: 0; }
.has-drop:hover > .dropdown, .has-drop.open > .dropdown { display: block; }
.has-drop:hover > .dropdown-genres, .has-drop.open > .dropdown-genres { display: grid; }
.suggest .suggest-all { justify-content: center; color: var(--primary); font-size: 13px; border-top: 1px solid var(--border); }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 999px; }
.user-btn:hover { background: var(--surface-2); }
/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 84px; height: 84px; font-size: 34px; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: hsl(var(--h), 55%, 45%); color: #fff; font-weight: 700; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--primary); font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.input, .select-sm, .input-sm, textarea, select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); outline: none; max-width: 100%; }
.select-sm, .input-sm { padding: 6px 10px; font-size: 14px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 14px; }
.form label.check, .radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; display: flex; margin: 4px 0; }
.form .input { width: 100%; }
/* Alerts, labels */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.alert-success { background: #052e16; color: #bbf7d0; border-color: #166534; }
.alert-error { background: #450a0a; color: #fecaca; border-color: #991b1b; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head .box-title, .section-head .page-title { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.update-item:last-child { border-bottom: 0; }
.story-row:last-child { border-bottom: 0; }
.side-list li:last-child { border-bottom: 0; }
.rank-list li:last-child { border-bottom: 0; }
.chapter-newest li:last-child { border: 0; }
/* Tabs, filter */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--primary); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.genre-picker { flex-basis: 100%; }
.genre-picker summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.genre-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; margin-top: 10px; font-size: 14px; }
.genre-checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--surface-2); }
.table td.right, .table th.right { text-align: right; }
.comment .avatar { width: 38px; height: 38px; font-size: 15px; }
.replies .avatar { width: 30px; height: 30px; font-size: 12px; }
@media (max-width: 680px) {
  .reader { padding: 22px 0 24px; }
  .reader-container { padding: 0 18px; }
  .ch-story { font-size: 23px; }
  .chapter-head { margin-bottom: 22px; }
  .ch-bar { border-radius: 16px; }
  .chapter-select { max-width: 150px; }
  .ch-big { padding: 12px 14px; font-size: 14px; }
  .hint-keys { display: none; }
}
/* Profile */
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.profile-head .page-title { margin: 0; }
.stat-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.stat-inline strong { color: var(--text); }
.auth-box { margin-top: 20px; }
@media (max-width: 680px) {
  body { font-size: 14px; }
  .hide-sm { display: none !important; }
  .search-box { max-width: none; }
  .card-grid, .card-grid-hot { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .update-item { grid-template-columns: minmax(0, 1fr) auto; }
  .story-info { text-align: center; }
  .info-list { text-align: left; }
  .story-actions, .rate-box { justify-content: center; }
  .story-row { grid-template-columns: 1fr; gap: 6px; }
  .story-row-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .chapter-list { grid-template-columns: 1fr; }
  .grid-2, .footer-inner { grid-template-columns: 1fr; }
  .box { padding: 14px; }
  .page-title { font-size: 20px; }
  .header-inner { gap: 6px; }
}
.mini-item:last-child { border-bottom: 0; }
.st-bar { width: 4px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, #e0958c, #bd6a61); flex-shrink: 0; }
.drawer-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.drawer-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.drawer-acc a { padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.04); color: var(--text); font-size: 13.5px; text-align: center; }
.drawer-acc a:hover { background: var(--surface-2); text-decoration: none; }
.tile-top .label:first-child { margin-left: 0; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.st-head .page-title { margin-bottom: 2px; }
.st-range { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.st-range a { padding: 6px 12px; border-radius: 8px; color: #b8b8b8; font-size: 13.5px; font-weight: 600; }
.st-range a:hover { color: #fff; text-decoration: none; }
.st-range a.on { background: var(--primary-soft); color: var(--primary-2); }
.st-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.st-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.st-card-live { background: radial-gradient(120% 140% at 0% 0%, rgba(91,208,138,.09), transparent 60%), var(--surface); }
.st-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.st-card strong { font-size: 30px; font-weight: 700; color: #f2f2f2; line-height: 1.25; }
.st-card em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.st-chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-bottom: 22px; }
.st-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.st-col span { display: block; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #d27a70, rgba(210,122,112,.4)); min-height: 2px; transition: background .15s; }
.st-col:hover span { background: #e0958c; }
.st-col em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-style: normal; color: var(--muted); white-space: nowrap; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-grid .box { margin: 0; }
.st-map-box { margin-bottom: 16px; }
.st-map-wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.st-map-cell { position: relative; height: 320px; overflow: hidden; border-radius: 12px; background: #161719; }
.st-map { position: absolute; inset: 0; }
.st-sub { margin-top: 18px; }
.st-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.st-bars li { position: relative; }
.st-bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.st-bar-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dadada; }
.st-bar-top b { white-space: nowrap; color: #f0f0f0; font-weight: 600; }
.st-bar-top em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; }
.st-bars i { display: block; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #d27a70, #cfa25a); opacity: .85; }
.st-empty { padding: 8px 0; }
@media (max-width: 1100px) { .st-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-card-live { grid-column: span 2; }
  .st-grid { grid-template-columns: 1fr; }
  .st-map-wrap { grid-template-columns: 1fr; }
  .st-map-cell { height: 220px; }
  .st-card strong { font-size: 24px; }
  .online-counter { justify-content: center; }
}
.dropdown .ic, .tab .ic { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; }
.wr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.wr-head .page-title { margin: 0 0 4px; }
.wr-head p { margin: 0; max-width: 560px; }
.wr-head .btn svg, .wr-actions .btn svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.wr-empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.wr-empty .btn { margin-top: 8px; }
.wr-list { display: flex; flex-direction: column; gap: 10px; }
.wr-item { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; color: inherit; min-width: 0; }
.wr-item:hover { border-color: var(--primary); }
.wr-item-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wr-item-title { font-size: 16px; overflow-wrap: anywhere; }
.wr-item-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.wr-item-meta svg { width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; }
.wr-cover { width: 64px; height: 90px; flex: none; border-radius: 8px; object-fit: cover; }
.wr-cover-lg { width: 120px; height: 170px; flex: none; border-radius: 10px; object-fit: cover; }
.wr-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.wr-st-draft { background: rgba(255,255,255,.08); color: #b8bcc2; }
.wr-st-pending { background: rgba(251,191,36,.14); color: #e2b65a; }
.wr-st-approved { background: rgba(34,197,94,.14); color: #8cc5a0; }
.wr-st-rejected { background: rgba(239,68,68,.15); color: #f19a9a; }
.wr-note { font-size: 13px; color: #f19a9a; background: rgba(239,68,68,.08); border-left: 3px solid #b91c1c; padding: 6px 10px; border-radius: 6px; }
.wr-help { font-size: 14px; color: var(--muted); background: var(--surface-2, rgba(255,255,255,.04)); padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.wr-crumb { font-size: 13px; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere; }
.wr-story { display: flex; gap: 18px; margin-bottom: 20px; min-width: 0; }
.wr-story-body { min-width: 0; flex: 1; }
.wr-story-body .page-title { margin: 0 0 8px; overflow-wrap: anywhere; }
.wr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.wr-inline { display: inline-flex; margin: 0; }
.wr-danger { color: var(--danger) !important; }
.wr-chapters { display: flex; flex-direction: column; margin-bottom: 20px; }
.wr-ch { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.wr-ch-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wr-ch-main a { color: inherit; }
.wr-ch-act { display: flex; gap: 4px; flex: none; }
.wr-ch-act form { margin: 0; }
.wr-ch-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.wr-content { min-height: 420px; font-size: 15px; line-height: 1.7; }
.wr-count.wr-low { color: #e2b65a; }
.wr-cover-now { display: flex; align-items: center; gap: 12px; }
.wr-form .genre-checks label { font-weight: 400; }
@media (max-width: 640px) {
  .wr-story { flex-direction: column; }
  .wr-cover-lg { width: 96px; height: 136px; }
  .wr-ch { flex-wrap: wrap; }
  .wr-ch-main { flex-basis: 100%; }
  .wr-ch-row { grid-template-columns: 1fr; }
  .wr-content { min-height: 320px; }
}
/* ===== ROUND 2: icon .ic + emoticon + drawer hidden (bổ sung theo demo) ===== */
.ic { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -2px; margin-right: 4px; opacity: .75; }
.ic-star { fill: #cfa25a; stroke: #cfa25a; opacity: .95; }
.ic-heart { stroke: #e0958c; opacity: .95; }
.story-row-meta span, .tile-meta span, .spot-meta span { display: inline-flex; align-items: center; gap: 1px; }
.box-title .ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; color: var(--primary-2); opacity: 1; }
.u-pin .ic { width: 14px; height: 14px; opacity: 1; }
.emoji-img { width: 20px; height: 20px; vertical-align: -4px; display: inline-block; }
.drawer[hidden] { display: none !important; }
.section-head .select-sm { margin-left: auto; }
/* Trang chủ: tiêu đề + ô lọc thể loại luôn CÙNG 1 hàng (trái/phải thẳng hàng, không so le) */
#moi-cap-nhat .section-head { flex-wrap: nowrap; }
#moi-cap-nhat .section-title { white-space: nowrap; }
#moi-cap-nhat .section-head .select-sm { min-width: 0; max-width: 54%; flex: 0 1 auto; }
.label { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; vertical-align: middle; text-transform: uppercase; letter-spacing: .3px; }
.label-full { background: rgba(34,197,94,.14); color: #8cc5a0; }
.label-hot { background: rgba(210,122,112,.16); color: #e0958c; }
.label-new { background: rgba(251,191,36,.14); color: #cfa25a; }
.label-audio { background: rgba(207,162,90,.15); color: #dcbc84; }
.label + .label { margin-left: 5px; }

/* ===== ROUND 4: toast thông báo, huy hiệu chức vụ, emoji picker, phòng chat ===== */
.tx-toasts { position: fixed; top: calc(var(--header-h, 57px) + 10px); left: 50%; transform: translateX(-50%); width: min(450px, calc(100vw - 24px)); z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.tx-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #1d1e22; border: 1px solid var(--border); border-left: 4px solid var(--muted); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); font-size: 14.5px; font-weight: 500; animation: txToastIn .28s ease both; }
.tx-toast-ic { flex: none; margin-top: 1px; display: inline-flex; }
.tx-toast.is-success { border-left-color: #4ade80; }
.tx-toast.is-success .tx-toast-ic { color: #4ade80; }
.tx-toast.is-error { border-left-color: #f87171; }
.tx-toast.is-error .tx-toast-ic { color: #f87171; }
.tx-toast.is-warning { border-left-color: #fbbf24; }
.tx-toast.is-warning .tx-toast-ic { color: #fbbf24; }
.tx-toast.is-info { border-left-color: var(--primary); }
.tx-toast.is-info .tx-toast-ic { color: var(--primary); }
.tx-toast-msg { flex: 1; min-width: 0; }
.tx-toast-x { flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 6px; display: inline-flex; }
.tx-toast-x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.tx-toast.hide { opacity: 0; transform: translateY(-6px); transition: opacity .3s ease, transform .3s ease; }
@keyframes txToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.alert { border-left-width: 4px; font-weight: 500; }
.alert-success { border-left-color: #4ade80; }
.alert-error { border-left-color: #f87171; }
.alert-info { background: #17202b; color: #bfdbfe; border-color: #1d4ed8; border-left-color: #60a5fa; }

.role-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin-left: 7px; vertical-align: 2px; white-space: nowrap; }
.role-admin { color: #f0a196; border-color: rgba(210, 122, 112, .55); background: rgba(210, 122, 112, .16); }
.role-smod { color: #e3c07f; border-color: rgba(207, 162, 90, .5); background: rgba(207, 162, 90, .14); }
.role-mod { color: #93c5fd; border-color: rgba(96, 165, 250, .45); background: rgba(96, 165, 250, .13); }

.emoji-picker { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; margin: 8px 0 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.emoji-picker-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 8px; cursor: pointer; padding: 0; }
.emoji-picker-btn:hover { background: rgba(255, 255, 255, .08); }
.emoji-picker-btn img { width: 22px; height: 22px; }

.perm-note { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; margin: 14px 0; border: 1px solid rgba(207, 162, 90, .4); background: rgba(207, 162, 90, .09); border-radius: 10px; font-size: 14.5px; line-height: 1.55; }
.perm-note svg { flex: none; color: #e3c07f; margin-top: 2px; }

.avatar-chat { width: 34px; height: 34px; font-size: 15px; flex: none; }
.chat-messages { display: flex; flex-direction: column; gap: 12px; max-height: 480px; overflow-y: auto; padding: 10px 4px; margin: 10px 0 4px; }
.chat-empty { color: var(--muted); text-align: center; padding: 22px 0; }
.chat-msg { display: flex; gap: 9px; max-width: 94%; }
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; border-top-left-radius: 4px; padding: 8px 12px 9px; min-width: 0; }
.chat-msg.is-mine .chat-bubble { background: rgba(210, 122, 112, .13); border-top-left-radius: 14px; border-top-right-radius: 4px; }
.chat-meta { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-bottom: 2px; }
.chat-name { font-size: 13px; }
.chat-meta time { font-size: 11px; color: var(--muted); } /* ROUND 19: bỏ margin-left:auto — time về cụm trái cạnh tên/huy hiệu như comment truyện, không kéo xa nữa */
.chat-meta time::before { content: '· '; }
.chat-meta .role-badge { margin-left: 0; }
.chat-text { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-form { margin-top: 8px; }
.chat-as { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.chat-guest-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.chat-guest-row .input[name="name"] { flex: 1 1 180px; }
.chat-captcha { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); flex: 1 1 220px; }
.chat-captcha .input { width: 84px; flex: none; }
.chat-send-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-send-row .input { flex: 1; min-width: 0; }
.chat-form-error { color: #f87171; font-size: 13.5px; margin: 8px 0 0; }
@media (max-width: 680px) {
  .chat-messages { max-height: 52vh; }
  .chat-msg { max-width: 97%; }
}

/* ===== ROUND 4B: nút đóng modal tròn rõ ràng + đệm safe-area cho modal chương ===== */
.icon-btn.modal-x {
  flex: none; width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%;
}
.icon-btn.modal-x:hover { background: var(--border); }
.chap-head { align-items: center; padding: 16px 16px 12px 20px; }
.chap-head::before { display: none; }
.chap-modal {
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

/* ===== ROUND 5: modal chương nổi hẳn khỏi mép (dvh) + tab thống kê active rõ + chat gọn kiểu messaging ===== */
.chap-modal {
  height: 100dvh; bottom: auto;
  padding-top: max(30px, env(safe-area-inset-top));
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
.chap-box { max-height: min(700px, 100%); }
.st-range a.on { background: var(--primary); color: #fff; }
.st-range a.on:hover { color: #fff; }

.chat-box { padding: 16px 16px 14px; }
.chat-head { display: flex; gap: 11px; align-items: center; }
.chat-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-2); display: inline-flex; align-items: center; justify-content: center; }
.chat-head-text h1 { font-size: 18px; margin: 0; line-height: 1.25; }
.chat-head-text p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.chat-messages { gap: 9px; max-height: 460px; padding: 12px 2px 4px; margin: 8px 0 2px; }
.chat-msg { gap: 7px; max-width: 92%; }
.chat-msg .avatar-chat { width: 30px; height: 30px; font-size: 12.5px; }
.chat-bubble { padding: 6px 11px 7px; border-radius: 15px; border-top-left-radius: 5px; }
.chat-msg.is-mine .chat-bubble { border-top-right-radius: 5px; }
.chat-name { font-size: 12.5px; }
.chat-meta { margin-bottom: 1px; }
.chat-meta time { font-size: 10.5px; }
.chat-text { font-size: 14px; line-height: 1.45; }
/* ROUND 15: reply (quote) trong phòng chat */
.chat-quote { background: rgba(255,255,255,.05); border-left: 3px solid var(--primary); border-radius: 8px; padding: 5px 9px 6px; margin-bottom: 5px; font-size: 12.5px; line-height: 1.4; cursor: pointer; }
.chat-quote b { display: block; color: var(--primary-2); font-size: 12px; }
.chat-quote span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-quote-gone { color: var(--muted); font-style: italic; cursor: default; }
.chat-reply-btn { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; background: var(--primary-soft); color: var(--primary-2); border: 1px solid rgba(210, 122, 112, .35); border-radius: 999px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; padding: 2px 9px; flex: none; } /* ROUND 19: pill hồng + icon cho dễ nhận diện, hết lẫn với time */
.chat-reply-btn:hover { background: rgba(210, 122, 112, .28); color: #fff; }
.chat-msg.flash .chat-bubble { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.chat-replybar { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 7px 8px 7px 11px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.chat-replybar[hidden] { display: none; }
.chat-replybar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-replybar-text b { color: var(--primary-2); }
.chat-replybar-x { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.chat-text .emoji-img { width: 19px; height: 19px; }
.chat-form { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.chat-guest-row { margin-top: 0; gap: 8px; }
.chat-guest-row .input, .chat-captcha .input { height: 40px; }
.chat-as { margin: 0; }
.chat-composer { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.chat-composer .input { flex: 1; min-width: 0; height: 42px; border-radius: 999px; padding: 0 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); outline: none; }
.chat-composer .input:focus { border-color: var(--primary); }
.chat-emoji-btn { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.chat-emoji-btn:hover, .chat-emoji-btn.is-open { color: var(--primary-2); border-color: var(--primary); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.chat-send svg { transform: translate(-2px, 2px); } /* ROUND 16: icon máy bay giấy lệch quang học +3px phải/-2px lên (đo centroid pixel trên rig) — dịch ngược lại cho cân tâm nút */
.chat-send:hover { background: var(--primary-2); }
.chat-send:disabled { opacity: .55; cursor: default; }
.chat-emoji-pop { position: absolute; left: 0; bottom: 52px; z-index: 6; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 8px; box-shadow: 0 16px 44px rgba(0,0,0,.5); }
.chat-emoji-pop .emoji-picker { margin: 0; border: 0; background: transparent; padding: 0; max-width: 264px; }
@media (max-width: 680px) {
  .chat-box { padding: 13px 12px 12px; }
  .chat-messages { max-height: 50vh; }
}

/* ===== ROUND 6: thẻ đánh giá sao (điểm to + sao tô theo điểm TB + lượt rõ ràng) ===== */
.rate-box { display: block; }
.rate-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; max-width: 560px; margin: 0 auto;
}
.rate-sum { display: flex; align-items: center; gap: 12px; flex: none; }
.rate-score { font-size: 34px; font-weight: 800; line-height: 1; color: #fff; white-space: nowrap; }
.rate-score small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rate-sum-side { display: flex; flex-direction: column; gap: 3px; }
.rate-stars-view { position: relative; display: inline-block; font-size: 16px; letter-spacing: 2px; line-height: 1.2; }
.rate-stars-bg { color: #3a3c40; }
.rate-stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #cfa25a; }
.rate-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rate-act { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.rate-ask { font-size: 13.5px; color: var(--muted); }
.chapter-rate .stars-row { display: inline-flex; }
.chapter-rate .star-btn { font-size: 27px; padding: 0 3px; }
.rate-note { font-size: 13px; color: var(--primary-2); min-height: 18px; }
.rate-note:empty { display: none; }
@media (max-width: 680px) {
  .rate-card { flex-direction: column; gap: 10px; text-align: center; padding: 14px; }
  .rate-act { margin-left: 0; align-items: center; text-align: center; }
}

/* ===== ROUND 7: bình luận kiểu messaging (bong bóng + composer như phòng chat) ===== */
.cmt-composer { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.cmt-composer .avatar { width: 36px; height: 36px; font-size: 14px; flex: none; margin-top: 2px; }
.cmt-inputwrap { position: relative; flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px 8px; }
.cmt-inputwrap textarea { width: 100%; background: transparent; border: 0; padding: 2px 2px 6px; margin: 0; resize: vertical; min-height: 42px; color: var(--text); font: inherit; }
.cmt-inputwrap textarea:focus { outline: none; }
.cmt-bar { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.cmt-bar .btn { margin-left: auto; flex: none; }
.cmt-as { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-emoji-anchor { position: static; display: inline-flex; flex: none; }
.cmt-emoji-pop { left: 0; bottom: 52px; width: 264px; max-width: 100%; } /* ROUND 13: neo pop vào .cmt-inputwrap (full bề ngang form) thay vì span neo nhỏ — form trả lời lồng sâu bị đẩy sang phải làm pop 264px tràn mép màn hình 360px; max-width:100% theo bề ngang form nên không bao giờ lòi ra ngoài */ /* ROUND 8: neo .cmt-emoji-anchor rất hẹp → pop position:absolute bị shrink-to-fit co về 52px, icon xếp 1 cột dọc; phải cho width cố định như pop phòng chat */
.chat-emoji-btn.is-open { color: var(--primary-2); background: var(--primary-soft); }
.comment { border-top: 0; padding: 9px 0 3px; gap: 10px; }
.comment .avatar { width: 36px; height: 36px; font-size: 14px; flex: none; }
.comment-body { display: flex; flex-direction: column; align-items: flex-start; }
.cmt-bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 7px 11px 8px; max-width: 100%; }
.comment-head { font-size: 13px; }
.comment-head b { color: #fff; font-size: 13.5px; }
.comment-head { flex-wrap: nowrap; gap: 3px; } /* ROUND 15: time bị wrap xuống hàng 2 trên mobile — ép head 1 hàng: tên dài thì cắt …, time/huy hiệu/chip không co */
.comment-head b { flex: 0 0 auto; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* ROUND 17.2: tên KHÔNG co (flex-shrink 0, trần 46% cho tên dài) — phần thiếu dồn hết sang chip */
.comment-head .role-badge, .comment-head .label-admin, .comment-head .cmt-where { flex: none; }
.comment-head time { font-size: 11.5px; } /* ROUND 15b: meta gọn lại để cả hàng vừa bề ngang mobile */
.comment-head .cmt-where { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; } /* ROUND 17: chip là van co cuối cùng khi head chật, tên không bao giờ bị bóp về 0 */
/* ROUND 17.1: time KHÔNG có dấu · phía trước (chip đã có) — dành 8px cho tên, ca chật nhất tên phải hiện đủ */
.comment-head .label-admin { text-transform: none; letter-spacing: 0; }
.comment-head b { font-size: 13px; }
.comment-head .label, .comment-head .role-badge { font-size: 8.5px; padding: 1px 5px; letter-spacing: .1px; margin-left: 0; } /* ROUND 18: bỏ margin-left 7px của rule gốc — tên <-> huy hiệu chỉ còn gap 3px cho sát */
.comment-head time { margin-left: auto; padding-left: 12px; white-space: nowrap; flex: none; }
.cmt-where { font-size: 12.5px; color: var(--muted); white-space: nowrap; } /* ROUND 17: bỏ pill — demo để chương là chữ muted thường sau dấu · cho gọn head */
.comment-text { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; }
.comment-actions { margin: 3px 0 0 13px; gap: 16px; }
.cmt-act { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cmt-act:hover { color: var(--primary-2); text-decoration: none; }
.comment-body > .replies, .comment-body > .reply-box { align-self: stretch; width: 100%; }
.replies { margin: 8px 0 0 6px; border-left: 2px solid var(--border); padding-left: 12px; }
.replies .comment { border-top: 0; padding: 6px 0 2px; }
.replies .comment .avatar { width: 30px; height: 30px; font-size: 12px; }
.reply-box { margin-top: 8px; }
.cmt-login-note { background: var(--surface); }

/* ===== ROUND 11: hoàn khung box Truyện sex mới như cũ (hủy R9) + head sát mép như thẻ top ===== */
/* Bẫy: block @media 680px đặt .box{padding:14px} SAU rule .box-flush{padding:0} nên trên mobile
   box-flush bị ăn padding 14px, head bị đẩy vào giữa (14 + 18 = 32px). Ép flush về 0. */
@media (max-width: 680px) {
  .box-flush { padding: 0; }
}
/* Khoảng cách mép của head = đúng thẻ spotlight (.spot-item: 16px desktop / 12px mobile) */
#moi-cap-nhat .box-head { padding-left: 16px; padding-right: 16px; }
@media (max-width: 680px) {
  #moi-cap-nhat .box-head { padding-left: 12px; padding-right: 12px; }
}

/* ROUND 19: thiết bị cảm ứng không có hover-out — tắt mở-dropdown-bằng-hover
   để menu user đóng/mở thuần bằng class .open do JS toggle (trước đây bấm
   avatar lần 2 menu không đóng vì :hover dính). */
@media (hover: none) {
  .has-drop:hover > .dropdown { display: none; }
  .has-drop:hover > .dropdown-genres { display: none; }
  .has-drop.open > .dropdown { display: block; }
  .has-drop.open > .dropdown-genres { display: grid; }
}
