:root {
  --font-ui: "Be Vietnam Pro", system-ui, sans-serif;
  --font-body: "Literata", Georgia, serif;
  --bg: #121212;
  --bg-elevated: #161618;
  --surface: #1c1c1f;
  --surface-hover: #252528;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #2e2e33;
  --gold: #ffb800;
  --gold-hover: #e6a600;
  --gold-muted: rgba(255, 184, 0, 0.15);
  --brand: #5eead4;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
  --max: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  color-scheme: dark;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: #121212;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

@media (min-width: 1100px) {
  .site-header__inner {
    gap: 0.85rem;
    padding: 0 1.5rem;
  }
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffd54a, var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.9rem;
  color: #121212;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(255, 184, 0, 0.35);
}

.site-logo__text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

@media (min-width: 1200px) {
  .site-nav a {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
  }
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: var(--surface-hover);
}

.site-nav a.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}


.site-search {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 320px;
  margin-left: auto;
  position: relative;
}

@media (min-width: 1100px) {
  .site-search {
    min-width: 220px;
    max-width: 360px;
  }
}

.site-search input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.site-search input::placeholder {
  color: var(--muted);
}

.site-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-muted);
}

.site-search__icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.site-search__suggestions {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 350;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #17171a;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.site-search__suggestions[hidden] {
  display: none;
}

.site-search__suggest-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.site-search__suggest-item:hover,
.site-search__suggest-item.is-active {
  background: rgba(255, 184, 0, 0.1);
  color: var(--gold);
}

.site-search__suggest-cover {
  width: 34px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.site-search__suggest-cover--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
}

.site-search__suggest-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.site-search__suggest-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  line-height: 1.25;
}

.site-search__suggest-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.72rem;
}

.site-search__suggest-all {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.site-search__suggest-all:hover {
  background: rgba(255, 184, 0, 0.08);
  border-color: rgba(255, 184, 0, 0.45);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ==== Hamburger mobile ==== */
.site-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  margin-left: 0.25rem;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.site-burger:hover {
  border-color: var(--gold);
  color: var(--gold);
}

@media (min-width: 900px) {
  .site-burger {
    display: none;
  }
}

/* Mobile-only header tweaks */
@media (max-width: 899px) {
  .site-logo__text {
    display: none;
  }
  .site-search {
    display: none;
  }
  .site-actions {
    margin-left: auto;
  }
  .currency-pill {
    display: inline-flex;
    padding: 0.28rem 0.55rem;
    font-size: 0.7rem;
    gap: 0.3rem;
  }
  .currency-pill .pill-text {
    font-size: 0.7rem;
  }
  .btn-vip {
    display: none !important;
  }
  .user-chip span:not(.user-chip__avatar) {
    display: none;
  }
  .user-chip {
    padding: 0.18rem;
  }
  .site-main {
    padding: 1rem 0.85rem 2.5rem;
  }
  .section-head h2 {
    font-size: 1rem;
  }
  .featured-row {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
}

/* Drawer */
.site-mobile-drawer {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 99;
  animation: site-drawer-in 0.18s ease-out;
}

@keyframes site-drawer-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-mobile-drawer[hidden] {
  display: none;
}

.site-mobile-drawer__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.5rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.site-mobile-drawer__link {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s, color 0.15s;
}

.site-mobile-drawer__link:last-child {
  border-bottom: 0;
}

.site-mobile-drawer__link:hover {
  background: var(--surface-hover);
  color: var(--gold);
}

.site-mobile-drawer__link.is-active {
  color: var(--gold);
  background: rgba(255, 184, 0, 0.08);
}

@media (min-width: 900px) {
  .site-mobile-drawer {
    display: none !important;
  }
}

.btn-vip {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

@media (min-width: 1280px) {
  .btn-vip {
    display: inline-flex;
  }
}

.btn-vip:hover {
  background: var(--gold-muted);
}

.currency-pill {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.currency-pill svg {
  color: var(--gold);
  flex-shrink: 0;
}

.currency-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

@media (min-width: 1100px) {
  .currency-pill {
    display: inline-flex;
  }
}

.currency-pill strong {
  color: var(--gold);
  font-weight: 600;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
}

.user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

/* —— Main shell —— */
.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-head__accent {
  width: 4px;
  height: 1.25rem;
  border-radius: 2px;
  background: var(--gold);
}

.link-all {
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.link-all:hover {
  text-decoration: underline;
}

/* Continue reading */
.continue-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

@media (max-width: 560px) {
  .continue-card {
    grid-template-columns: 56px 1fr;
  }

  .continue-card .btn-read-go {
    grid-column: 1 / -1;
  }
}

.continue-card__cover {
  width: 72px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-elevated);
}

.continue-card__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.continue-card__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-read-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--gold);
  color: #121212;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
}

.btn-read-go:hover {
  filter: brightness(1.05);
}

/* Featured hero */
.hero-featured {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.hero-featured__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(18, 18, 18, 0.95) 0%,
    rgba(18, 18, 18, 0.75) 45%,
    rgba(18, 18, 18, 0.35) 100%
  );
}

.hero-featured__content {
  position: relative;
  padding: 1.75rem 1.5rem;
  max-width: 520px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--gold-muted);
  color: var(--gold);
  border: 1px solid rgba(255, 184, 0, 0.35);
}

.badge--muted {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
}

.hero-featured h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero-featured__sub {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .hero-featured__sub {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    font-size: 0.82rem;
  }
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip:hover {
  border-color: var(--muted);
  color: var(--text);
}

.chip.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #121212;
}

/* Two column */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 960px) {
  .home-grid {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .story-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

/* Trang chủ: 6 truyện mới đăng — 2 cột mobile, 3 cột desktop */
.story-grid--home-recent {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 0.7rem;
}

@media (min-width: 560px) {
  .story-grid--home-recent {
    gap: 1.1rem 1rem;
  }
}

@media (min-width: 960px) {
  .story-grid--home-recent {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 1.35rem;
  }
}

.story-grid--home-recent .story-card__body {
  padding: 0.65rem 0.7rem 0.85rem;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__body {
    padding: 1rem 1.1rem 1.15rem;
  }
}

.story-grid--home-recent .story-card__genre {
  font-size: 0.62rem;
  margin-bottom: 0.3rem;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__genre {
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
  }
}

.story-grid--home-recent .story-card__title {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__title {
    font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  }
}

.story-grid--home-recent .story-card__author {
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__author {
    font-size: 0.82rem;
    margin-bottom: 0.55rem;
  }
}

/* Ẩn blurb trên mobile để layout gọn như đối thủ */
.story-grid--home-recent .story-card__blurb {
  display: none;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__blurb {
    display: -webkit-box;
    font-size: 0.8rem;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: 3.6em;
  }
}

.story-grid--home-recent .story-card__badge {
  font-size: 0.58rem;
  padding: 0.2rem 0.45rem;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__badge {
    font-size: 0.65rem;
    padding: 0.28rem 0.55rem;
  }
}

.story-grid--home-recent .story-card__stats {
  font-size: 0.72rem;
  gap: 0.7rem;
  padding-top: 0.45rem;
}

@media (min-width: 720px) {
  .story-grid--home-recent .story-card__stats {
    font-size: 0.82rem;
    gap: 1rem;
    padding-top: 0.85rem;
  }
}

.story-grid--home-recent .story-card__stats span {
  display: inline-flex;
  align-items: center;
}

.story-card__stat-ico {
  display: inline-block;
  vertical-align: -0.2em;
  margin-right: 0.35rem;
  opacity: 0.85;
}

.story-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.story-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 184, 0, 0.4);
  box-shadow: var(--shadow);
}

.story-card__cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.story-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-card__badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.story-card__badge--hot {
  background: var(--danger);
  color: #fff;
}

.story-card__badge--new {
  background: var(--success);
  color: #fff;
}

.story-card__body {
  padding: 0.75rem 0.85rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.story-card__genre {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.story-card__title {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.story-card__author {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.story-card__blurb {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card__stats {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Featured row (3 cards) */
.featured-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 720px) {
  .featured-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.featured-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}

.featured-card:hover {
  border-color: rgba(255, 184, 0, 0.35);
}

.featured-card__genre {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.featured-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.featured-card__author {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.featured-card__blurb {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-card__stats {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Updates table */
.updates-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 2rem;
}

.updates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.updates-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.updates-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.updates-table tr:last-child td {
  border-bottom: none;
}

.updates-table a {
  text-decoration: none;
  font-weight: 600;
}

.updates-table a:hover {
  color: var(--gold);
}

.tag-genre {
  font-size: 0.75rem;
  color: var(--gold);
  white-space: nowrap;
}

/* Featured row trên mobile: carousel ngang trượt */
@media (max-width: 720px) {
  .featured-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.7rem;
    padding-bottom: 0.4rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
  }
  .featured-row::-webkit-scrollbar {
    display: none;
  }
  .featured-card {
    flex: 0 0 80%;
    scroll-snap-align: start;
    padding: 0.85rem;
  }
  .featured-card__blurb {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 0.78rem;
  }
}

/* Bảng cập nhật: chuyển thành list trên mobile */
@media (max-width: 720px) {
  .updates-panel {
    overflow-x: visible;
    margin-bottom: 1.5rem;
  }
  .updates-table,
  .updates-table tbody {
    display: block;
    width: 100%;
  }
  .updates-table thead {
    display: none;
  }
  .updates-table tr {
    display: block;
    padding: 0.7rem 0.9rem 0.8rem;
    border-bottom: 1px solid var(--border);
  }
  .updates-table tr:last-child {
    border-bottom: 0;
  }
  .updates-table td {
    display: inline;
    padding: 0;
    border: 0;
    vertical-align: baseline;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
  }
  .updates-table td:nth-child(1) {
    display: block;
    margin-bottom: 0.2rem;
  }
  .updates-table td:nth-child(1) .tag-genre {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 184, 0, 0.12);
    border: 1px solid rgba(255, 184, 0, 0.3);
  }
  .updates-table td:nth-child(2) {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
    line-height: 1.3;
  }
  .updates-table td:nth-child(2) a {
    color: var(--text);
  }
  .updates-table td:nth-child(2) a:hover {
    color: var(--gold);
  }
  .updates-table td:nth-child(3)::after,
  .updates-table td:nth-child(4)::after {
    content: " · ";
    color: var(--border);
    padding: 0 0.15rem;
  }
}

/* Sidebar widgets — gọn hơn trên mobile */
@media (max-width: 720px) {
  .sidebar-stack {
    gap: 1rem;
  }
  .widget {
    padding: 0.85rem 0.9rem;
  }
  .widget h3 {
    font-size: 0.8rem;
    margin-bottom: 0.65rem;
  }
}

/* Sidebar widgets */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.widget h3 {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item {
  display: grid;
  grid-template-columns: 22px 48px 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item__num {
  font-weight: 800;
  color: var(--gold);
  font-size: 0.9rem;
}

.rank-item__thumb {
  width: 48px;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg);
}

.rank-item__title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.rank-item__meta {
  font-size: 0.7rem;
  color: var(--muted);
}

.rank-item__hh {
  font-size: 0.72rem;
  color: #f87171;
  margin-top: 0.15rem;
}

.new-chap-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-chap-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.new-chap-item:last-child {
  border-bottom: none;
}

.new-chap-item img {
  width: 40px;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  object-fit: cover;
}

.donate-qr {
  text-align: center;
}

.donate-qr p {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.qr-image {
  display: block;
  width: 180px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.qr-image img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-image:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 184, 0, 0.55);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
  .qr-image {
    width: 160px;
  }
}

.qr-placeholder {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 8px;
  background: repeating-linear-gradient(
      45deg,
      #2a2a2e,
      #2a2a2e 8px,
      #36363b 8px,
      #36363b 16px
    ),
    var(--bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.5rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 3rem 1.25rem 1.5rem;
  background: #0d0d0f;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

.footer-brand .site-logo__text {
  font-size: 1.25rem;
}

.footer-brand p {
  margin: 0.75rem 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.footer-social a svg {
  display: block;
}

.footer-social a:hover {
  color: var(--gold);
  border-color: rgba(255, 184, 0, 0.55);
  background: rgba(255, 184, 0, 0.08);
  transform: translateY(-1px);
}

.footer-col h4 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.45rem;
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-copy {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* —— Auth pages (đăng nhập / đăng ký) —— */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.auth-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-card__sub {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: #5a5a5e;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-muted);
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--gold);
  color: #121212;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: filter 0.15s;
}

.auth-card .btn-primary:hover {
  filter: brightness(1.05);
}

.auth-card .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.auth-alert {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
  line-height: 1.4;
}

.auth-alert--error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.auth-alert--success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.auth-switch {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-note {
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  line-height: 1.5;
}

/* —— User chip states + dropdown —— */
.user-chip__name {
  max-width: 8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip--guest {
  color: var(--gold);
  border-color: rgba(255, 184, 0, 0.4);
}

.user-chip--guest:hover {
  background: var(--gold-muted);
}

.user-chip__avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.75rem;
  color: #121212;
  background: linear-gradient(135deg, #ffd54a, var(--gold));
}

.user-chip__caret {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 0.15rem;
}

.user-menu {
  position: absolute;
  z-index: 200;
}

.user-menu--panel {
  min-width: 200px;
  max-width: min(260px, calc(100vw - 16px));
  background: #1a1a1e;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  padding: 0;
  overflow: hidden;
}

.user-menu__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem 0.45rem;
  border-bottom: 1px solid var(--border);
}

.user-menu__avatar-lg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.8rem;
  color: #121212;
  background: linear-gradient(145deg, #ffd54a, var(--gold));
  box-shadow: none;
}

.user-menu__identity {
  flex: 1;
  min-width: 0;
}

.user-menu__display {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__mail {
  margin-top: 0.05rem;
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__body {
  padding: 0.15rem 0 0.2rem;
}

.user-menu__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1.3;
}

.user-menu__row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu__ico {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 244, 245, 0.88);
}

.user-menu__svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.user-menu__hl {
  color: var(--gold);
  font-weight: 600;
}

.user-menu__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.1rem 0.35rem;
  opacity: 0.85;
}

.user-menu__row--logout,
.user-menu__row--logout .user-menu__ico {
  color: #ef4444;
}

.user-menu__row--logout .user-menu__svg {
  stroke: currentColor;
}

.user-menu__row--logout:hover {
  background: rgba(239, 68, 68, 0.1);
}
