:root {
  --bg: #050614;
  --bg-2: #0b1027;
  --card: rgba(13, 18, 42, 0.78);
  --card-2: rgba(22, 29, 62, 0.8);
  --line: rgba(142, 93, 255, 0.22);
  --text: #f5f3ff;
  --muted: #a5a1c6;
  --primary: #8f5bff;
  --primary-2: #20a4ff;
  --accent: #ffd166;
  --danger: #ff5b7d;
  --shadow: 0 24px 80px rgba(34, 19, 88, .34);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 75% 5%, rgba(127, 84, 255, .26), transparent 34rem),
    radial-gradient(circle at 20% 70%, rgba(32, 164, 255, .14), transparent 28rem),
    linear-gradient(180deg, #030411 0%, #090d25 58%, #050614 100%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.stars {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(143,91,255,.7) 1px, transparent 1.5px);
  background-size: 120px 120px, 180px 180px;
  background-position: 0 0, 40px 60px;
  opacity: .16;
  z-index: -2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 74px;
  padding: 0 7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(18px);
  background: rgba(3, 4, 17, .68);
  border-bottom: 1px solid var(--line);
}
.site-header.compact { height: 64px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.16rem;
}
.brand span span { color: var(--primary); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(143,91,255,.95), rgba(32,164,255,.85));
  box-shadow: 0 0 24px rgba(143,91,255,.55);
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a, .nav-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 12px 16px;
  border-radius: 14px;
  transition: .2s ease;
}
.nav a:hover, .nav a.active, .nav-button:hover {
  color: #fff;
  background: rgba(143, 91, 255, .16);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions button, .ghost, .primary {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 42px;
}
.header-actions > button { width: 42px; padding: 0; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 36px rgba(32,164,255,.2);
}
.ghost:hover, .header-actions button:hover { background: rgba(255,255,255,.09); }
.wide { width: 100%; }

.genre-menu {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(760px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(9, 12, 31, .94);
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.genre-menu a {
  padding: 10px 14px;
  color: var(--muted);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}
.hidden { display: none !important; }

.hero {
  min-height: 76vh;
  padding: 78px 7vw 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  align-items: center;
  gap: 7vw;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(32,164,255,.38);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .28;
  filter: saturate(1.15);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(5,6,20,.96));
  z-index: -1;
}
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  color: #c9c2ff;
  background: rgba(143,91,255,.13);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .83rem;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.7rem, 7vw, 6.4rem);
  line-height: .95;
  letter-spacing: -.06em;
  text-shadow: 0 16px 60px rgba(0,0,0,.35);
}
.hero p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
}
.hero-summary {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta { display: flex; gap: 20px; color: var(--muted); margin: 22px 0; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  background: var(--card);
  box-shadow: 0 32px 80px rgba(0,0,0,.42), 0 0 70px rgba(143,91,255,.2);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-radius: 16px;
  padding: 10px 12px;
  font-weight: 900;
}
.slider-dots { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; gap: 9px; }
.slider-dots button { width: 30px; height: 4px; border: 0; border-radius: 999px; background: rgba(255,255,255,.16); padding: 0; }
.slider-dots button.active { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.section {
  padding: 48px 7vw;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.section h2, .panel h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: -.03em;
}
.section-sub { color: var(--muted); margin-top: 6px; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.card {
  display: block;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  transition: .24s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(143,91,255,.55); box-shadow: var(--shadow); }
.card-cover { height: 280px; background: rgba(255,255,255,.05); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px; }
.card h3 { margin: 0 0 8px; font-size: 1.04rem; line-height: 1.35; }
.card p { color: var(--muted); margin: 0; line-height: 1.6; font-size: .94rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.tag { font-size: .76rem; color: #d8d1ff; background: rgba(143,91,255,.16); border: 1px solid rgba(143,91,255,.18); padding: 5px 9px; border-radius: 999px; }
.meta-line { display: flex; justify-content: space-between; color: var(--muted); font-size: .86rem; margin-top: 14px; }

.list-page { padding: 48px 7vw; }
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 220px 140px;
  gap: 12px;
  margin: 24px 0;
}
.input, input, textarea, select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  padding: 13px 15px;
  outline: none;
}
textarea { resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: rgba(32,164,255,.65); box-shadow: 0 0 0 3px rgba(32,164,255,.1); }

.detail {
  padding: 70px 7vw 40px;
}
.detail-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 24px;
  background: rgba(10,13,32,.74);
  box-shadow: var(--shadow);
}
.detail-cover { border-radius: 22px; overflow: hidden; aspect-ratio: 3/4; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail h1 { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.05em; }
.detail-desc { color: var(--muted); line-height: 1.8; }
.chapter-list {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}
.chapter-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.chapter-row:hover { background: rgba(143,91,255,.1); }

.reader {
  max-width: 900px;
  margin: 0 auto;
  padding: 54px 22px 80px;
}
.reader-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(8,11,26,.82);
  padding: clamp(22px, 5vw, 54px);
  box-shadow: var(--shadow);
}
.reader h1 { margin-top: 0; font-size: clamp(1.8rem, 5vw, 3.3rem); letter-spacing: -.04em; }
.reader-content { font-size: 1.08rem; line-height: 2.05; color: #eeeafb; white-space: pre-line; }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

.footer {
  margin-top: 50px;
  padding: 36px 7vw;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.footer strong { color: var(--text); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(8px);
}
.modal-box {
  width: min(440px, calc(100vw - 28px));
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #0b0f27;
  padding: 26px;
  box-shadow: var(--shadow);
}
.modal-box input { margin-bottom: 12px; }
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.muted { color: var(--muted); }
.error, .empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: 18px; }

.admin-layout {
  padding: 40px 7vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(8,11,26,.82);
  box-shadow: var(--shadow);
  padding: 24px;
}
.panel label { display: block; color: var(--muted); margin: 16px 0 8px; }
.message { color: var(--accent); min-height: 24px; }

body.light {
  --bg: #f7f8ff;
  --bg-2: #fff;
  --card: rgba(255,255,255,.8);
  --card-2: rgba(255,255,255,.95);
  --line: rgba(74, 99, 170, .18);
  --text: #16182d;
  --muted: #656b8a;
  background: linear-gradient(180deg, #eff4ff 0%, #ffffff 100%);
}
body.light .site-header { background: rgba(255,255,255,.75); }
body.light .hero::after { background: linear-gradient(transparent, rgba(247,248,255,.96)); }
body.light .stars { opacity: .08; }

@media (max-width: 1100px) {
  .site-header { padding: 0 22px; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-left: 22px; padding-right: 22px; }
  .hero-cover { max-width: 310px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 760px) {
  .header-actions .ghost { display: none; }
  .primary { padding: 10px 13px; }
  .hero { min-height: auto; padding-top: 44px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-cover { height: 210px; }
  .filter-bar { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-cover { max-width: 240px; }
  .section, .list-page, .detail { padding-left: 22px; padding-right: 22px; }
  .footer { flex-direction: column; padding-left: 22px; padding-right: 22px; }
}

/* VIP + bulk import additions */
.card-cover, .detail-cover { position: relative; }
.vip-badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1a102d;
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 12px 28px rgba(255, 159, 28, .28);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 900;
}
.vip-mini {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
  color: #1a102d;
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 900;
}
.vip-pill {
  color: #ffe8a8;
  border-color: rgba(255,209,102,.32);
  background: rgba(255,209,102,.12);
}
.paywall {
  margin: 28px 0;
  padding: 28px;
  border: 1px solid rgba(255,209,102,.32);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,209,102,.12), rgba(255,255,255,.04));
}
.paywall h2 { margin-top: 0; }
.form-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
}
.check-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.check-row label { margin: 0; }
.inline-check { min-height: 50px; align-self: end; }
.small-note { margin: 10px 0 0; font-size: .9rem; }
.wide-panel { grid-column: 1 / -1; }
code {
  color: #ffe8a8;
  background: rgba(255,209,102,.08);
  border: 1px solid rgba(255,209,102,.16);
  border-radius: 8px;
  padding: 2px 6px;
}

@media (max-width: 760px) {
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .chapter-row { flex-direction: column; gap: 8px; }
}

/* V3: user wallet, purchase, combo full-story bundle */
.combo-badge {
  position: absolute;
  z-index: 2;
  top: 48px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  color: #07111f;
  background: linear-gradient(135deg, #7ee8fa, #80ff72);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 12px 28px rgba(126, 232, 250, .24);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
}
.combo-pill {
  color: #cffff8;
  border-color: rgba(126,232,250,.32);
  background: rgba(126,232,250,.12);
}
.combo-box {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(126,232,250,.26);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(126,232,250,.12), rgba(143,91,255,.08));
  box-shadow: var(--shadow);
}
.combo-box h3 { margin: 0 0 8px; }
.combo-box p { color: var(--muted); margin: 0 0 10px; line-height: 1.65; }
.owned-pill, .owned-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #07111f;
  background: linear-gradient(135deg, #80ff72, #7ee8fa);
  font-weight: 900;
}
.owned-pill { padding: 10px 14px; }
.owned-mini { margin-left: 8px; padding: 3px 8px; font-size: .72rem; vertical-align: middle; }
.wallet-balance {
  margin: 16px 0;
  padding: 22px;
  text-align: center;
  border-radius: 20px;
  border: 1px solid rgba(255,209,102,.24);
  background: rgba(255,209,102,.08);
  color: #ffe8a8;
  font-size: 2rem;
  font-weight: 900;
}
.quick-topup button { min-height: 46px; }
.preview-text {
  border-left: 3px solid rgba(255,209,102,.55);
  padding: 10px 0 10px 14px;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-line;
}
.modal-box .ghost.wide { margin-top: 10px; }

@media (max-width: 760px) {
  .combo-box { flex-direction: column; align-items: stretch; }
  .combo-badge { top: 46px; }
}

/* V4 custom UI for Phuvu's corner */
body.copy-protect,
body.copy-protect .reader-content,
body.copy-protect .card,
body.copy-protect .detail,
body.copy-protect .section,
body.copy-protect img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.copy-protect input,
body.copy-protect textarea,
body.copy-protect select,
body.copy-protect .modal-box {
  -webkit-user-select: text;
  user-select: text;
}

.combo-offer {
  margin: 26px 0 8px;
  border: 2px solid rgba(126, 232, 250, .42);
  border-radius: 18px;
  padding: 12px;
  background: rgba(9, 22, 34, .62);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255,255,255,.04);
}
.combo-offer-title {
  display: inline-block;
  margin: -31px 0 6px 14px;
  padding: 0 10px;
  color: #fff3cf;
  background: #07101c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: .01em;
}
.combo-offer-card {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  padding: 22px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(31, 64, 68, .72), rgba(11, 32, 23, .78));
}
.combo-offer-card p {
  margin: 0;
  color: #d9cfbf;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  line-height: 1.6;
}
.combo-offer-card strong { color: #f6e7c6; }
.gold-button {
  border: 0;
  min-width: 150px;
  color: #fff0b8;
  font-weight: 900;
  padding: 12px 22px;
  border-radius: 7px;
  background: linear-gradient(180deg, #caa300, #7d6500);
  box-shadow: 0 12px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
.gold-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.admin-preview { margin-top: 28px; }
.admin-preview .combo-offer-card { min-height: 150px; }

.advanced-upload {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}
.advanced-upload summary { cursor: pointer; color: var(--text); font-weight: 700; }
.file-import-box {
  margin: 18px 0;
  padding: 16px;
  border: 1px dashed rgba(126,232,250,.32);
  border-radius: 18px;
  background: rgba(126,232,250,.05);
}
input[type="file"] {
  padding: 10px;
  border-style: dashed;
}

@media (max-width: 760px) {
  .combo-offer-title { margin-top: -28px; }
  .combo-offer-card { place-items: stretch; }
  .gold-button { width: 100%; }
}

/* V5 Góc Mê Truyện refinements */
.brand-mark.image-mark {
  padding: 4px;
  overflow: hidden;
  background: rgba(92, 255, 125, .11);
  border: 1px solid rgba(128, 255, 114, .28);
  box-shadow: 0 0 26px rgba(92, 255, 125, .34), 0 0 40px rgba(143, 91, 255, .16);
}
.brand-mark.image-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}
.brand { white-space: nowrap; }
.nav a { white-space: nowrap; }
.header-actions, .header-actions a, .header-actions button { white-space: nowrap; }
.header-actions .ghost { min-width: max-content; }

select,
select option,
select optgroup {
  color-scheme: dark;
  background: #10152f;
  color: #f5f3ff;
}
select option:checked,
select option:hover {
  background: #315fd9;
  color: #fff;
}
body.light select,
body.light select option,
body.light select optgroup {
  color-scheme: light;
  background: #fff;
  color: #16182d;
}
.filter-bar select { min-height: 52px; }

.admin-topbar { gap: 22px; }
.admin-key-inline {
  flex: 1;
  max-width: 430px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.admin-key-inline label { color: var(--muted); font-size: .9rem; }
.admin-key-inline input { min-height: 38px; padding: 9px 12px; border-radius: 12px; }
.admin-studio {
  padding: 34px 6vw 70px;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.create-dock {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 106px);
  overflow: auto;
}
.dock-head h1 { margin: 0; }
.story-workspace { min-width: 0; display: grid; gap: 18px; }
.slim-panel { padding: 18px; }
.workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}
.workspace-toolbar label { margin-top: 0; }
.toolbar-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.story-editor-shell { padding: 0; overflow: hidden; }
.admin-story-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 12%, rgba(126,232,250,.14), transparent 22rem),
    linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border-bottom: 1px solid rgba(126, 232, 250, .32);
}
.admin-cover-card {
  position: relative;
  width: 180px;
  aspect-ratio: 3/4;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
}
.admin-cover-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-upload-button {
  position: absolute;
  inset: auto 12px 12px;
  margin: 0 !important;
  display: grid !important;
  place-items: center;
  min-height: 40px;
  color: #fff;
  background: rgba(0,0,0,.58);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-weight: 800;
}
.cover-upload-button input { display: none; }
.admin-story-main { min-width: 0; }
.title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.admin-title-input {
  border: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  border-radius: 0;
  background: transparent;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 900;
  letter-spacing: -.04em;
}
.admin-title-input:focus { box-shadow: none; border-color: rgba(126,232,250,.6); }
.owner-chip {
  color: #d7fff5;
  background: rgba(126,232,250,.1);
  border: 1px solid rgba(126,232,250,.2);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
}
.admin-id-line { margin: 10px 0 18px; color: var(--muted); }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.admin-stat-grid div {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: rgba(0,0,0,.16);
}
.admin-stat-grid span { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.admin-stat-grid strong { display: block; color: #f6e7c6; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 28px;
  border-bottom: 4px solid rgba(24, 219, 204, .85);
  background: rgba(0,0,0,.15);
}
.admin-tabs button {
  min-height: 54px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.08);
  color: #d6d2ec;
  background: rgba(255,255,255,.035);
  padding: 0 18px;
  font-weight: 800;
}
.admin-tabs button.active {
  color: #061822;
  background: linear-gradient(135deg, #26e0d1, #25b7ff);
}
.tab-panel { display: none; padding: 26px 28px 30px; }
.tab-panel.active { display: block; }
.tab-panel h2 { margin: 0 0 14px; }
.tag-editor-row { display: flex; gap: 10px; }
.chapter-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-chapter-list { display: grid; gap: 10px; }
.admin-chapter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.admin-chapter-row strong { display: block; margin-bottom: 5px; }
.admin-chapter-row span { color: var(--muted); font-size: .9rem; }
.admin-chapter-row .ghost { min-height: 38px; display: inline-flex; align-items: center; }

@media (max-width: 1200px) {
  .admin-studio { grid-template-columns: 1fr; }
  .create-dock { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .admin-topbar { height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .admin-key-inline { order: 3; width: 100%; max-width: none; grid-template-columns: 1fr; gap: 6px; }
  .admin-studio { padding-left: 16px; padding-right: 16px; }
  .workspace-toolbar { grid-template-columns: 1fr; }
  .admin-story-hero { grid-template-columns: 1fr; padding: 20px; }
  .admin-cover-card { width: min(220px, 100%); }
  .title-line { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-tabs { padding: 0; overflow-x: auto; flex-wrap: nowrap; }
  .admin-tabs button { white-space: nowrap; }
  .tab-panel { padding: 20px; }
  .admin-chapter-row { grid-template-columns: 1fr; }
}

/* V6 reader/detail/follow/bulk-delete refinements */
.hero-bg {
  background-size: min(420px, 34vw) auto;
  background-repeat: no-repeat;
  background-position: right 15vw center;
  opacity: .18;
  filter: blur(12px) saturate(1.12);
  transform: scale(1.05);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 77% 48%, rgba(143,91,255,.26), transparent 28rem);
}
.story-description-full {
  margin: 18px 0 20px;
  padding: 20px 22px;
  border: 1px solid rgba(143, 91, 255, .22);
  border-radius: 22px;
  background: rgba(255,255,255,.035);
  color: #eeeafb;
  line-height: 1.95;
  font-size: 1.02rem;
  white-space: pre-wrap;
  word-break: break-word;
}
#followStoryBtn {
  min-width: 126px;
  font-weight: 800;
}
#followStoryBtn:hover {
  border-color: rgba(126,232,250,.55);
  background: rgba(126,232,250,.1);
}
.modal-box { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 60px); overflow: auto; }
.account-section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
}
.account-section h3 { margin: 0 0 10px; font-size: 1rem; }
.mini-list, .notice-list { display: grid; gap: 8px; }
.mini-list a, .notice-item {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}
.notice-item.unread { border-color: rgba(32,164,255,.45); background: rgba(32,164,255,.08); }
.notice-item strong { display: block; margin-bottom: 4px; }
.notice-item span { display: block; color: var(--muted); line-height: 1.5; }
.notice-item em { display: block; margin-top: 4px; color: #7f7a9e; font-style: normal; font-size: .82rem; }
.bulk-delete-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.admin-chapter-row.selectable { grid-template-columns: auto minmax(0, 1fr) auto; }
.chapter-select-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chapter-select-cell input { width: 18px; height: 18px; }
.danger-button {
  border: 1px solid rgba(255,91,125,.38);
  color: #ffe8ee;
  background: rgba(255,91,125,.14);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 42px;
  font-weight: 800;
}
.danger-button:hover { background: rgba(255,91,125,.22); }
select, select option, select optgroup {
  background-color: #10152f !important;
  color: #f5f3ff !important;
  color-scheme: dark;
}
select { appearance: auto; }
body.light select, body.light select option, body.light select optgroup {
  background-color: #fff !important;
  color: #16182d !important;
  color-scheme: light;
}

@media (max-width: 760px) {
  .bulk-delete-bar { align-items: stretch; flex-direction: column; }
  .admin-chapter-row.selectable { grid-template-columns: auto 1fr; }
  .admin-chapter-row.selectable .ghost { grid-column: 2; justify-content: center; }
}

/* V7: nạp xu ngân hàng & duyệt xu */
.topup-modal-box { width: min(780px, calc(100vw - 28px)); }
.payment-fail {
  text-align: center;
  padding: 16px 14px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.payment-fail h2 {
  margin: 0 0 12px;
  color: #9b72ff;
  letter-spacing: .08em;
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.payment-fail p { margin: 8px 0; color: #eeeafb; font-size: 1.08rem; line-height: 1.65; }
.payment-fail strong { color: #ff4b61; text-decoration: underline; }
.bank-card {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(126,87,255,.5);
  background: rgba(4,6,12,.84);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  margin-bottom: 18px;
}
.bank-title {
  background: linear-gradient(90deg, #31009b, #4c1dff);
  color: #fff;
  text-align: center;
  padding: 18px;
  font-weight: 900;
  letter-spacing: .08em;
  font-size: 1.2rem;
}
.bank-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px 18px;
  padding: 24px;
  align-items: center;
}
.bank-grid span { color: #f4f0ff; font-weight: 800; }
.bank-grid strong { color: #fff; font-weight: 900; word-break: break-word; }
.copy-btn {
  margin-left: 10px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: #fff;
  background: #4c1dff;
  cursor: pointer;
}
.qr-box { text-align: center; padding: 0 24px 20px; color: var(--muted); }
.qr-box img {
  display: block;
  max-width: min(320px, 90%);
  margin: 10px auto 0;
  border-radius: 16px;
  border: 1px dashed rgba(126,87,255,.7);
  background: #fff;
  padding: 10px;
}
.bank-note { margin: 0; padding: 0 30px 24px 44px; color: #d4d0e8; line-height: 1.7; }
.topup-form { display: grid; gap: 10px; }
.topup-admin-list { display: grid; gap: 12px; margin-top: 14px; }
.topup-admin-item {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
  overflow: hidden;
}
.topup-admin-item.pending { border-color: rgba(255,207,77,.35); }
.topup-admin-item.approved { border-color: rgba(72,220,147,.35); }
.topup-admin-item.rejected { border-color: rgba(255,91,125,.35); }
.topup-admin-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px;
  display: grid;
  gap: 5px;
}
.topup-admin-item summary::-webkit-details-marker { display: none; }
.topup-admin-item summary strong { color: #fff; font-size: 1.04rem; }
.topup-admin-item summary span, .topup-admin-item summary em { color: var(--muted); font-style: normal; }
.topup-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px;
  padding: 0 14px 14px;
}
.proof-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: #fff;
}
.nested-panel { background: rgba(255,255,255,.025); }
.toolbar-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar-between h3 { margin: 0; }
@media (max-width: 760px) {
  .bank-grid { grid-template-columns: 1fr; gap: 8px; padding: 18px; }
  .topup-detail-grid { grid-template-columns: 1fr; }
  .toolbar-between { align-items: stretch; flex-direction: column; }
}

/* V8: mở rộng giao diện đọc, tài khoản user, chọn nhanh truyện và sửa chương */
.reader {
  max-width: 1180px;
  padding-inline: clamp(18px, 5vw, 70px);
}
.reader-card {
  padding: clamp(26px, 5vw, 70px);
}
.reader-content {
  max-width: 980px;
  margin-inline: auto;
  font-size: clamp(1.08rem, 1.1vw, 1.24rem);
  line-height: 2.15;
}
.account-modal-box {
  width: min(980px, calc(100vw - 28px));
}
.account-tab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.account-tab-grid a,
.account-tab-grid button {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
.account-tab-grid a:hover,
.account-tab-grid button:hover {
  background: rgba(143,91,255,.16);
  border-color: rgba(143,91,255,.36);
}
.account-story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.account-story-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.account-story-item img {
  width: 64px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
}
.account-story-item strong {
  display: block;
  color: var(--text);
  line-height: 1.35;
}
.account-story-item em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-size: .9rem;
}
.positive-tx strong { color: #74f2aa; }
.negative-tx strong { color: #ff9db1; }
.generated-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.generated-code-row input { margin-bottom: 0; }
.generated-code-row .copy-btn { height: 46px; }
.compact-check {
  margin-top: 10px;
  padding: 8px 0;
}
.chapter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-chapter-row.selectable {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
#storyQuickSearch {
  margin-bottom: 10px;
}
@media (max-width: 760px) {
  .account-tab-grid { grid-template-columns: 1fr 1fr; }
  .account-story-grid { grid-template-columns: 1fr; }
  .chapter-actions { justify-content: stretch; }
  .chapter-actions .ghost { flex: 1; justify-content: center; }
}


/* V9: tách tab user, duyệt xu admin độc lập, link truyện và rule tách chương chặt hơn */
.account-panel { display: none; }
.account-panel.active { display: block; }
.account-tab-grid button.active {
  background: linear-gradient(135deg, rgba(143,91,255,.92), rgba(32,164,255,.82));
  border-color: rgba(126,232,250,.62);
  color: #fff;
  box-shadow: 0 12px 30px rgba(32,164,255,.16);
}
.admin-mode-tabs {
  display: flex;
  gap: 12px;
  padding: 22px 6vw 0;
}
.admin-mode-tabs button {
  border: 1px solid rgba(255,255,255,.11);
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  min-height: 46px;
  padding: 10px 18px;
  font-weight: 900;
}
.admin-mode-tabs button.active {
  color: #061822;
  border-color: transparent;
  background: linear-gradient(135deg, #26e0d1, #25b7ff);
}
.admin-standalone-panel {
  padding: 24px 6vw 70px;
}
.admin-standalone-panel > .panel {
  max-width: 1440px;
  margin-inline: auto;
}
.admin-public-link-row {
  margin-top: 10px;
}
.inline-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.inline-copy-row input[readonly] {
  opacity: .95;
  color: #d8f6ff;
}
@media (max-width: 760px) {
  .admin-mode-tabs { padding-left: 16px; padding-right: 16px; flex-direction: column; }
  .admin-standalone-panel { padding-left: 16px; padding-right: 16px; }
  .inline-copy-row { grid-template-columns: 1fr; }
}

/* V11: Truyện hot, mục lục phân trang, đọc full màn hình, Google login, cảnh báo user */
.combo-badge {
  top: auto !important;
  right: 12px !important;
  bottom: 12px !important;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-cover .combo-badge,
.detail-cover .combo-badge,
.card-cover .combo-badge {
  bottom: 12px !important;
}
.chapter-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}
.chapter-pager span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  font-weight: 800;
}
.reader {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 32px clamp(18px, 5vw, 96px) 90px !important;
}
.reader-card {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100vh - 150px);
  border-radius: 30px;
}
.reader-content {
  max-width: none !important;
  width: 100% !important;
  margin-inline: 0 !important;
  font-size: clamp(1.18rem, 1.25vw, 1.42rem) !important;
  line-height: 2.2 !important;
}
#loginBtn.user-has-alert {
  position: relative;
  border-color: rgba(255,91,125,.55);
  box-shadow: 0 0 0 1px rgba(255,91,125,.22), 0 0 18px rgba(255,91,125,.22);
}
#loginBtn.user-has-alert::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ff2d55;
  border: 2px solid #07081a;
  box-shadow: 0 0 16px rgba(255,45,85,.75);
}
.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 14px 0;
}
.auth-separator::before,
.auth-separator::after {
  content: '';
  height: 1px;
  flex: 1;
  background: rgba(255,255,255,.1);
}
.google-login {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.055);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.google-login:hover {
  border-color: rgba(32,164,255,.45);
  background: rgba(32,164,255,.12);
}
.google-g {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #4285f4;
  font-weight: 1000;
  font-family: Arial, sans-serif;
}
@media (max-width: 760px) {
  .chapter-pager { flex-direction: column; align-items: stretch; text-align: center; }
  .reader { padding-inline: 14px !important; }
  .reader-card { border-radius: 20px; padding: 24px 18px !important; }
}
