@import "fonts.css";

/* ============ TOKENS ============ */
:root {
  --bg: #F1F2F4; --card: #FFFFFF; --card-2: #F5F6F8; --line: #E7E9ED; --line-2: #D3D7DE;
  --text: #14161A; --text-dim: #626873; --text-faint: #9AA0AC;
  --hot: #FF2E55; --hot-2: #FF5A78; --hot-soft: #FFEAEF; --link: #1568C8; --ok: #16A97C; --headbar: #FFFFFF;
  --readerbg: #0B0A0D;
  --font-ui: "Roboto Condensed", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-head: "Roboto Condensed", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-prose: "Roboto", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Roboto Condensed", ui-monospace, Consolas, monospace;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20,22,26,.04), 0 4px 16px rgba(20,22,26,.06);
  --shadow-lg: 0 6px 28px rgba(20,22,26,.14);
  color-scheme: light only;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
::selection { background: var(--hot-soft); }

/* ============ HEADER ============ */
.topnav { background: var(--headbar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topnav-in { max-width: 1180px; margin: 0 auto; padding: 0 14px; display: flex; align-items: center; gap: 13px; height: 52px; }
.logo { font-family: var(--font-head); font-size: 19.5px; font-weight: 700; letter-spacing: -.032em; color: var(--text); display: flex; align-items: center; gap: 7px; flex: 0 0 auto; text-decoration: none; }
.logo svg { width: 19px; height: 19px; fill: var(--hot); flex: 0 0 auto; }
.mainnav { display: flex; align-items: center; gap: 1px; flex: 1; min-width: 0; }
.mainnav a { padding: 6px 10px; border-radius: 16px; color: var(--text-dim); text-decoration: none; font-size: 13.5px; white-space: nowrap; }
.mainnav a:hover { background: var(--card-2); color: var(--text); }
.mainnav a.sel { color: var(--hot); background: var(--hot-soft); font-weight: 600; }
.navsearch-form { flex: 0 0 auto; margin: 0; }
.navsearch { background: var(--card-2); border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px; font-size: 13px; color: var(--text); width: 200px; font-family: inherit; }
.navsearch::placeholder { color: var(--text-faint); }
.navsearch:focus { outline: none; border-color: var(--hot); background: var(--card); }
.who { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-left: 13px; border-left: 1px solid var(--line); }
.who .av { width: 27px; height: 27px; border-radius: 50%; background: var(--hot-soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--hot); }
.who .nm { font-size: 12.5px; color: var(--text-dim); }

/* ============ GENRE CHIPS ============ */
.chipbar { background: var(--card); border-bottom: 1px solid var(--line); }
.chipbar-in { max-width: 1180px; margin: 0 auto; padding: 8px 14px; display: flex; gap: 8px; align-items: flex-start; }
.chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 66px; overflow: hidden; transition: max-height .2s ease; }
.chips.open { max-height: none; }
@media (prefers-reduced-motion: reduce) { .chips { transition: none; } }
.gchip { font-size: 12.5px; padding: 6px 12px; border-radius: 16px; white-space: nowrap; background: var(--card-2); color: var(--text-dim); border: 0; cursor: pointer; font-family: inherit; line-height: 1.4; text-decoration: none; }
.gchip:hover { background: var(--hot-soft); color: var(--hot); }
.gchip.sel { background: var(--hot); color: #fff; font-weight: 600; }
.morechip { flex: 0 0 auto; font-size: 12.5px; padding: 6px 12px; border-radius: 16px; background: transparent; border: 1px solid var(--line-2); color: var(--text-dim); cursor: pointer; font-family: inherit; line-height: 1.4; white-space: nowrap; }
.morechip:hover { border-color: var(--hot); color: var(--hot); }

/* ============ LAYOUT ============ */
.wrap { max-width: 1180px; margin: 0 auto; padding: 14px; display: grid; grid-template-columns: 1fr 268px; gap: 16px; align-items: start; }
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.boxhead { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.boxhead h2 { font-family: var(--font-head); font-size: 16px; font-weight: 600; letter-spacing: -.015em; margin: 0; display: flex; align-items: center; gap: 7px; }
.boxhead h2 i { color: var(--hot); font-style: normal; }
.boxhead .sp { flex: 1; }
.cnt { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }

/* ============ COMIC GRID ============ */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 16px 12px; padding: 13px; }
.cc { display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; text-decoration: none; color: inherit; }
.cc .thumb { position: relative; border-radius: 3px; overflow: hidden; background: var(--card-2); aspect-ratio: 190/247; }
.cc .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc .when { position: absolute; top: 0; left: 0; z-index: 3; background: rgba(0,0,0,.62); color: #fff; font-size: 10px; padding: 3px 6px; border-bottom-right-radius: 4px; font-family: var(--font-mono); }
.cc .hotflag { position: absolute; top: 0; right: 0; z-index: 3; background: var(--hot); color: #fff; font-size: 9.5px; font-weight: 700; padding: 3px 6px; border-bottom-left-radius: 4px; }
.cc .newflag { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; background: linear-gradient(transparent, rgba(0,0,0,.82)); color: #fff; font-size: 10.5px; padding: 14px 7px 5px; font-family: var(--font-mono); }
.cc .newflag b { color: #FFD84A; font-weight: 700; }
.cc .tt { font-size: 13px; line-height: 1.32; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc:hover .tt { color: var(--hot); }
.cc .row { display: flex; align-items: center; gap: 8px; }
.cc .ch { font-size: 12px; color: var(--link); }

/* followed card with live unfollow */
.cc-wrap { position: relative; min-width: 0; }
.unfollow { position: absolute; top: 5px; right: 5px; z-index: 6; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .15s; display: grid; place-items: center; }
.cc-wrap:hover .unfollow, .unfollow:focus-visible { opacity: 1; }
.unfollow:hover { background: var(--hot); }
@media (hover: none) { .unfollow { opacity: 1; } }

/* section heading with a "see more" link */
.boxhead .seemore { font-size: 12.5px; color: var(--link); text-decoration: none; }
.boxhead .seemore:hover { text-decoration: underline; }

/* inline check-new feedback (no status panel) */
.checkmsg { font-size: 12px; color: var(--text-dim); padding: 0 2px; min-height: 16px; }
.checkmsg.ok { color: var(--ok); }

/* ============ PAGINATION ============ */
.pager { display: flex; gap: 5px; justify-content: center; padding: 4px 13px 15px; flex-wrap: wrap; }
.pager button { min-width: 32px; height: 32px; padding: 0 9px; cursor: pointer; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.pager button.sel { background: var(--hot); border-color: var(--hot); color: #fff; font-weight: 700; }

/* ============ SIDEBAR ============ */
.side-btn { width: 100%; padding: 11px; border: none; border-radius: var(--r); cursor: pointer; background: var(--hot); color: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.side-btn:disabled { opacity: .6; cursor: default; }
.ranklist { display: flex; flex-direction: column; }
.rk { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.ranklist .rk:last-child { border-bottom: 0; }
.rk:hover { background: var(--card-2); }
.rk .mini { width: 34px; aspect-ratio: 190/247; border-radius: 2px; overflow: hidden; flex: 0 0 auto; background: var(--card-2); }
.rk .mini img { width: 100%; height: 100%; object-fit: cover; }
.rk .info { min-width: 0; flex: 1; }
.rk .info .a { font-size: 12.5px; font-weight: 600; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk .info .b { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.sysbox { padding: 11px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); line-height: 1.75; }
.sysbox b { color: var(--ok); font-weight: 400; }
.sysbox a { color: var(--link); }
.sysbox code { background: var(--card-2); padding: 1px 5px; border-radius: 3px; word-break: break-all; }

/* ============ DETAIL ============ */
.dhead { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 16px; }
.dhead .big { border-radius: 3px; overflow: hidden; aspect-ratio: 190/247; background: var(--card-2); }
.dhead .big img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dtitle { font-family: var(--font-head); font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.15; }
.dalt { font-size: 12.5px; color: var(--text-faint); margin-bottom: 12px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11.5px; border: 1px solid var(--line); color: var(--text-dim); padding: 3px 8px; border-radius: 20px; }
.tag-on { border-color: var(--hot); color: var(--hot); background: var(--hot-soft); }
.numrow { display: flex; gap: 22px; margin: 12px 0 14px; }
.numrow div { display: flex; flex-direction: column; gap: 1px; }
.numrow b { font-family: var(--font-mono); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.numrow span { font-size: 11px; color: var(--text-faint); }
.dbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 11px 18px; border: none; border-radius: var(--r); cursor: pointer; background: var(--hot); color: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn s { text-decoration: none; font-family: var(--font-mono); font-size: 10.5px; opacity: .82; font-weight: 400; }
.ghost { padding: 11px 16px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; background: transparent; color: var(--text-dim); font-family: var(--font-ui); font-size: 13.5px; }
.ghost:hover { color: var(--text); border-color: var(--text-faint); }
.ghost.on { color: var(--ok); border-color: var(--ok); }
.synop { padding: 0 16px 16px; font-size: 14px; line-height: 1.72; color: var(--text-dim); margin: 0; }

.chwrap { padding: 0 13px 13px; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.chi { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--card); cursor: pointer; text-decoration: none; color: inherit; }
.chi:hover { background: var(--card-2); }
.chi .n { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; min-width: 62px; font-variant-numeric: tabular-nums; }
.chi .d { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.chi.here { background: var(--card-2); box-shadow: inset 3px 0 0 var(--hot); }

/* ============ READER ============ */
.rd { background: var(--readerbg); }
.rdbar { position: sticky; top: 0; z-index: 25; background: rgba(11,10,13,.96); border-bottom: 1px solid rgba(255,255,255,.1); color: #EDEBF0; display: flex; align-items: center; gap: 13px; padding: 10px 16px; }
.rdbar .bk { background: none; border: none; color: #EDEBF0; font-size: 19px; cursor: pointer; text-decoration: none; }
.rdbar .ti { min-width: 0; }
.rdbar .ti .a { font-family: var(--font-head); font-size: 15px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdbar .ti .b { font-family: var(--font-mono); font-size: 10.5px; color: #9C98A6; margin-top: 1px; }
.rdbar .sp { flex: 1; }
.rnav { display: flex; gap: 6px; }
.rnav .link { text-decoration: none; }
.rnav button { font-size: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #EDEBF0; padding: 8px 12px; border-radius: 3px; cursor: pointer; font-family: inherit; }
.rnav button.pri { background: var(--hot); border-color: var(--hot); font-weight: 600; }
.rnav button:hover { background: rgba(255,255,255,.16); }
.rdstage { position: relative; padding-bottom: 30px; background: var(--readerbg); }
.rdcol { max-width: 760px; margin: 0 auto; }
.mpage { position: relative; border-bottom: 1px solid rgba(255,255,255,.07); }
.mpage img { display: block; width: 100%; height: auto; background: #17161c; min-height: 120px; }
.mpage .pn { position: absolute; top: 8px; right: 9px; font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,.55); background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 3px; font-variant-numeric: tabular-nums; z-index: 3; }
.endblk { padding: 28px 16px 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.endblk .lb { font-family: var(--font-mono); font-size: 11px; color: #7C7987; }
.endblk .bg { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.endblk .b1 { background: var(--hot); color: #fff; border: 0; border-radius: 5px; padding: 13px 28px; font-family: var(--font-head); font-size: 15px; font-weight: 600; cursor: pointer; }
.endblk .b2 { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #EDEBF0; border-radius: 5px; padding: 13px 18px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.endblk .b2:hover { background: rgba(255,255,255,.15); }
.rdfoot { position: sticky; bottom: 0; z-index: 25; background: rgba(11,10,13,.96); border-top: 1px solid rgba(255,255,255,.1); padding: 9px 16px 12px; }
.rdfoot .track { height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; margin-bottom: 9px; }
.rdfoot .track i { display: block; height: 100%; background: var(--hot); border-radius: 2px; width: 0; }
.rdfoot .row { display: flex; align-items: center; gap: 14px; }
.rdfoot .p { font-family: var(--font-mono); font-size: 11.5px; color: #EDEBF0; font-variant-numeric: tabular-nums; }
.rdfoot .p s { color: #7C7987; text-decoration: none; }
a.link { text-decoration: none; }

/* ============ FOOTER ============ */
.foot { background: var(--card); border-top: 1px solid var(--line); margin-top: 6px; padding: 16px 14px; text-align: center; font-size: 12px; color: var(--text-faint); line-height: 1.7; }
.foot b { color: var(--text-dim); }

/* ============ LOGIN ============ */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 28px; width: 300px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { font-size: 22px; font-weight: 700; text-align: center; font-family: var(--font-head); }
.login-logo b { color: var(--hot); }
.login-card input { padding: 11px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 15px; background: var(--card); color: var(--text); }
.login-card .btn { justify-content: center; }
.login-err { color: var(--hot); margin: 0; font-size: 13px; text-align: center; }

/* form inputs (settings/search) */
.field { padding: 10px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 14px; background: var(--card); color: var(--text); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1020px) {
  .wrap { grid-template-columns: 1fr; }
  .dhead { grid-template-columns: 150px 1fr; }
}
@media (max-width: 760px) {
  .dhead { grid-template-columns: 1fr; }
  .who .nm { display: none; }
}

/* ============================================================
   POLISH — nâng cấp giao diện (ghi đè các quy tắc phía trên)
   ============================================================ */

/* Header: nền mờ, bóng nhẹ, chữ đậm hơn */
.topnav { background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(20,22,26,.02); }
.topnav-in { height: 58px; gap: 16px; }
.logo { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.logo svg { width: 21px; height: 21px; filter: drop-shadow(0 1px 2px rgba(255,46,85,.35)); }
.mainnav a { font-size: 15px; font-weight: 500; padding: 7px 12px; border-radius: 999px; }
.mainnav a.sel { background: var(--hot-soft); color: var(--hot); }
.navsearch { border-radius: 999px; padding: 8px 15px; width: 220px; transition: border-color .15s, box-shadow .15s; }
.navsearch:focus { box-shadow: 0 0 0 3px var(--hot-soft); }
.who .av { background: linear-gradient(135deg, var(--hot), var(--hot-2)); color: #fff; box-shadow: 0 2px 6px rgba(255,46,85,.35); font-weight: 700; }

/* Boxes: bóng mềm, không viền cứng */
.box { border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.boxhead { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.boxhead h2 { font-size: 18px; font-weight: 700; letter-spacing: .2px; position: relative; padding-left: 12px; }
.boxhead h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(var(--hot), var(--hot-2)); }
.boxhead h2 i { display: none; }

/* Grid + cards: nâng nhẹ khi hover, ảnh zoom */
.cgrid { padding: 16px; gap: 20px 14px; }
.cc .thumb { border-radius: var(--r-sm); box-shadow: 0 2px 8px rgba(20,22,26,.10); transition: transform .18s ease, box-shadow .18s ease; }
.cc .thumb img { transition: transform .35s ease; }
.cc:hover .thumb { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cc:hover .thumb img { transform: scale(1.06); }
.cc .tt { font-size: 14px; font-weight: 500; margin-top: 2px; }
.cc .newflag { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; padding: 16px 8px 6px; }
.cc .newflag b { color: #FFD84A; }
.cc .hotflag { background: linear-gradient(135deg, var(--hot), var(--hot-2)); border-radius: 0 var(--r-sm) 0 8px; font-size: 10.5px; padding: 3px 7px; }
.cc .when { border-radius: var(--r-sm) 0 8px 0; padding: 3px 7px; font-family: var(--font-mono); }

/* Buttons: gradient, bo vừa, có bóng */
.btn, .side-btn { background: linear-gradient(135deg, var(--hot), var(--hot-2)); border-radius: var(--r-sm); box-shadow: 0 3px 10px rgba(255,46,85,.28); transition: transform .12s ease, box-shadow .12s ease, filter .12s; font-weight: 700; letter-spacing: .3px; }
.btn:hover, .side-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,46,85,.36); filter: brightness(1.03); }
.btn:active, .side-btn:active { transform: translateY(0); }
.ghost { border-radius: var(--r-sm); font-weight: 500; }
.field, .navsearch { border-radius: var(--r-sm); }
.navsearch { border-radius: 999px; }

/* Chips */
.gchip { padding: 7px 14px; font-size: 13px; font-weight: 500; transition: background .12s, color .12s; }
.gchip.sel { background: linear-gradient(135deg, var(--hot), var(--hot-2)); box-shadow: 0 2px 8px rgba(255,46,85,.3); }
.morechip { border-radius: 999px; font-weight: 500; }
.chipbar { background: var(--card); box-shadow: var(--shadow); }

/* Tags + numbers on detail */
.tag { border-radius: 999px; font-weight: 500; }
.tag:hover { background: var(--hot-soft); }
.dtitle { font-weight: 700; letter-spacing: .2px; }
.numrow b { font-family: var(--font-head); }
.numrow .hot b, .numrow div:nth-child(2) b { color: var(--hot); }

/* Sidebar quick links */
.rk { transition: background .12s; }
.rk:hover { background: var(--hot-soft); }
.rk .info .a { font-weight: 500; }

/* Chapter list */
.chi { transition: background .1s; }
.chi.here { box-shadow: inset 4px 0 0 var(--hot); }
.chi .n { font-family: var(--font-mono); }

/* Detail cover */
.dhead .big { border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }

/* Section spacing rhythm */
.col-main { gap: 18px; }
.wrap { padding: 18px 14px; gap: 18px; }

/* Nicer scrollbar (desktop) */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--bg); }

/* Login card polish */
.login-card { border-radius: 16px; box-shadow: var(--shadow-lg); border: none; padding: 32px; }
.login-logo { font-size: 26px; letter-spacing: .3px; }
.login-card .btn { padding: 12px; }

/* Reader top bar keeps dark; refine buttons */
.rnav button.pri { background: linear-gradient(135deg, var(--hot), var(--hot-2)); box-shadow: 0 3px 10px rgba(255,46,85,.3); }
.endblk .b1 { background: linear-gradient(135deg, var(--hot), var(--hot-2)); border-radius: var(--r-sm); box-shadow: 0 4px 14px rgba(255,46,85,.35); }

/* Empty-state text a bit friendlier */
.checkmsg { font-family: var(--font-mono); }

/* Body reading text uses Roboto (dễ đọc hơn Condensed) */
.synop, .dalt { font-family: var(--font-prose); }
.synop { font-size: 14.5px; line-height: 1.75; }

/* ============ HERO BANNER ============ */
.hero { position: relative; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: #14161A; height: 260px; }
.hero-slides { position: absolute; inset: 0; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s ease; }
.slide.on { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
.slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; filter: blur(18px) saturate(1.2); transform: scale(1.15); }
.slide-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,10,16,.92) 0%, rgba(12,10,16,.75) 45%, rgba(12,10,16,.45) 100%); }
.slide-in { position: relative; height: 100%; display: flex; align-items: center; gap: 22px; padding: 24px 28px; }
.slide-cover { flex: 0 0 auto; width: 148px; aspect-ratio: 190/247; border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow-lg); }
.slide-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-meta { min-width: 0; color: #fff; display: flex; flex-direction: column; gap: 9px; }
.slide-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.stag { font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.slide-title { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1.08; letter-spacing: .3px; color: #fff; text-decoration: none; text-shadow: 0 2px 12px rgba(0,0,0,.5); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-title:hover { color: #FFD84A; }
.slide-sub { font-family: var(--font-mono); font-size: 13px; color: rgba(255,255,255,.85); }
.slide-btn { align-self: flex-start; margin-top: 4px; }
.hero-dots { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 7px; z-index: 4; }
.hero-dots button { width: 9px; height: 9px; border-radius: 999px; border: none; background: rgba(255,255,255,.4); cursor: pointer; padding: 0; transition: width .2s, background .2s; }
.hero-dots button.on { width: 22px; background: #fff; }

@media (max-width: 620px) {
  .hero { height: auto; }
  .slide { position: relative; }
  .slide:not(.on) { display: none; }
  .slide-in { flex-direction: row; padding: 16px; gap: 14px; }
  .slide-cover { width: 96px; }
  .slide-title { font-size: 21px; }
}

/* ============ EMPTY STATE ============ */
.emptymsg { padding: 26px 18px; color: var(--text-faint); font-size: 14px; line-height: 1.6; text-align: center; }
.emptymsg a { color: var(--link); }

/* Sidebar quick-links (no cover) vs suggestion (with mini cover) */
.rk-lite { padding: 11px 14px; font-weight: 500; }
.rk-lite:hover { background: var(--hot-soft); color: var(--hot); }
.rk .mini { border-radius: 4px; box-shadow: 0 1px 4px rgba(20,22,26,.15); }
.rk .info .a { font-size: 13px; }

/* Nhãn "đang hot" trên banner */
.stag-hot { background: linear-gradient(135deg, var(--hot), var(--hot-2)); font-weight: 700; }

/* ============ INFO STRIP TRONG TRANG ĐỌC ============ */
.rdinfo { background: #14131A; border-bottom: 1px solid rgba(255,255,255,.08); }
.rdinfo-in { max-width: 900px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rdinfo-name { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: #EDEBF0; text-decoration: none; }
.rdinfo-name:hover { color: var(--hot-2); }
.rdinfo-au, .rdinfo-st { font-size: 12.5px; color: #8E8A98; }
.rdinfo-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.rtag { font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: #C9C6D2; text-decoration: none; }
.rtag:hover { background: var(--hot); color: #fff; }
@media (max-width: 620px) { .rdinfo-tags { margin-left: 0; width: 100%; } }

/* Gợi ý: nhãn lý do */
.sugwhy { padding: 9px 14px 0; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.sugwhy b { color: var(--hot); font-weight: 600; }

/* ============================================================
   TRANG CHI TIẾT — làm lại phần đầu
   ============================================================ */
.dhead { display: grid; grid-template-columns: 210px 1fr; gap: 24px; padding: 22px; align-items: start; }
.dhead .big { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 190/247; background: var(--card-2); box-shadow: var(--shadow-lg); }
.dhead .big img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dbody { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.dtitle { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1.14; letter-spacing: .2px; margin: 0; }
.dalt { font-family: var(--font-prose); font-size: 13.5px; color: var(--text-faint); margin: -8px 0 0; }

/* Hàng dữ kiện dạng viên */
.dfacts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { font-size: 13px; color: var(--text-dim); background: var(--card-2); border-radius: 999px; padding: 6px 13px; }
.fact b { color: var(--text); font-weight: 700; }
.fact.live { color: var(--ok); background: rgba(22,169,124,.10); }
.fact.live b, .fact.done b { color: inherit; }
.fact.done { color: var(--text-dim); }
.fact.reading { color: var(--hot); background: var(--hot-soft); }
.fact.reading b { color: var(--hot); }

/* Nhãn / giá trị căn cột thẳng — chỗ trước đây bị dính chữ */
.dmeta { display: grid; grid-template-columns: 84px 1fr; gap: 10px 14px; margin: 0; align-items: baseline; }
.dmeta dt { font-size: 13px; color: var(--text-faint); }
.dmeta dd { margin: 0; font-size: 14px; font-weight: 500; min-width: 0; }
.dmeta .tagrow { margin: -2px 0; }

.dbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.dbtns .btn { padding: 12px 22px; font-size: 15px; }

/* Giới thiệu */
.dsyn { border-top: 1px solid var(--line); padding: 18px 22px 22px; }
.dsyn h3 { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.dsyn p {
  font-family: var(--font-prose); font-size: 14.5px; line-height: 1.78;
  color: var(--text-dim); margin: 0; max-width: 78ch;
  text-align: justify; text-justify: inter-word;
  hyphens: none; /* tiếng Việt không gạch nối cuối dòng */
  text-wrap: pretty;
}
.dsyn-none { color: var(--text-faint) !important; font-style: italic; }

@media (max-width: 760px) {
  .dhead { grid-template-columns: 132px 1fr; gap: 16px; padding: 16px; }
  .dtitle { font-size: 22px; }
  .dsyn { padding: 16px; }
}

/* ============ LƯU OFFLINE (Google Drive) ============ */
.savebar { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; max-width: 460px; }
.savetrack { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.savetrack i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--hot), var(--hot-2)); transition: width .3s ease; }
.savetext { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.savetext.done { color: var(--ok); }
.savetext.err { color: var(--hot); }

/* ============ TRANG ĐỌC TRÊN ĐIỆN THOẠI ============
   Thanh trên cùng dễ tràn ngang vì 2 nút chương dài -> ẩn chữ, chỉ chừa mũi tên. */
.rd { overflow-x: hidden; }
@media (max-width: 620px) {
  .rdbar { gap: 8px; padding: 8px 12px; }
  .rnav { gap: 6px; flex: 0 0 auto; }
  .rnav button { padding: 8px 11px; }
  .rnav .lbl { display: none; }        /* chỉ còn ← và → */
  .rdbar .ti .a { font-size: 14px; }
}

/* ============ HEADER TRÊN ĐIỆN THOẠI ============
   Đặt cuối file để thắng các quy tắc "POLISH" phía trên.
   Header xuống dòng: hàng 1 logo + avatar, hàng 2 menu (cuộn ngang nếu chật),
   hàng 3 ô tìm kiếm rộng hết ngang. */
@media (max-width: 760px) {
  .topnav-in { flex-wrap: wrap; height: auto; gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .logo { order: 1; }
  .who { order: 2; margin-left: auto; padding-left: 0; border-left: none; }
  .mainnav { order: 3; flex: 1 0 100%; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .navsearch-form { order: 4; flex: 1 0 100%; margin: 0; }
  .navsearch { display: block; width: 100%; box-sizing: border-box; }
}
