/* ================================================================
   SuperNovel — style.css
   Modern · Mobile-First · Full Feature Parity PC & Mobile
   Font: Outfit (display) + Source Serif 4 (reading)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

/* ----------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------- */
:root {
  /* Brand */
  --primary:        #7c3aed;
  --primary-hover:  #6d28d9;
  --primary-light:  #a78bfa;
  --primary-muted:  rgba(124,58,237,.12);
  --accent:         #f97316;
  --accent-hover:   #ea6c0a;

  /* Neutrals — Light */
  --bg:             #f4f2f8;
  --surface:        #ffffff;
  --card:           #ffffff;
  --card-hover:     #faf9fd;
  --muted:          #ede9f5;
  --muted-2:        #d8d2ec;

  --ink-1:          #1a1625;
  --ink-2:          #4b4568;
  --ink-3:          #8b82a8;
  --ink-inv:        #ffffff;

  --border:         rgba(124,58,237,.15);
  --border-strong:  rgba(124,58,237,.3);

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(26,22,37,.06);
  --shadow-sm:  0 2px 8px rgba(26,22,37,.08);
  --shadow-md:  0 4px 20px rgba(26,22,37,.1);
  --shadow-lg:  0 8px 40px rgba(26,22,37,.14);
  --shadow-glow:0 0 0 3px rgba(124,58,237,.2);

  /* Layout */
  --max-w:        1380px;
  --header-h:     60px;
  --sidebar-w:    268px;
  --reader-w:     700px;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Typography */
  --font:       'Outfit', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

  /* Motion */
  --fast:   120ms ease;
  --normal: 220ms ease;
  --slow:   380ms ease;
}

[data-theme="dark"] {
  --bg:           #100d1a;
  --surface:      #18132a;
  --card:         #1f1935;
  --card-hover:   #26204a;
  --muted:        #2a2245;
  --muted-2:      #3a2e60;

  --ink-1:        #f0eeff;
  --ink-2:        #b8aede;
  --ink-3:        #7264a8;
  --ink-inv:      #100d1a;

  --border:       rgba(167,139,250,.12);
  --border-strong:rgba(167,139,250,.28);

  --shadow-xs:  0 1px 3px rgba(0,0,0,.3);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow-md:  0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.55);
  --shadow-glow:0 0 0 3px rgba(124,58,237,.35);
}

/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-1);
  line-height: 1.65;
  min-height: 100svh;
  overflow-x: hidden;
  transition: background var(--normal), color var(--normal);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--primary-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select {
  font: inherit;
  background: var(--card);
  color: var(--ink-1);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: .6rem .9rem;
  width: 100%;
  transition: border-color var(--fast), box-shadow var(--fast);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }

/* ----------------------------------------------------------------
   3. LAYOUT
   ---------------------------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (max-width: 480px) { .container { padding: 0 .875rem; } }

/* ----------------------------------------------------------------
   4. HEADER
   ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--normal), transform var(--normal);
  will-change: transform;
}
[data-theme="dark"] .site-header {
  background: rgba(16,13,26,.88);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.site-header.hidden {
  transform: translateY(-100%);
}
@media (max-width: 768px) {
  .site-header.hidden { transform: none !important; }
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -.4px;
  flex-shrink: 0;
}
.site-logo span { color: var(--ink-1); }

/* Desktop Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: .125rem;
  flex: 1;
}
@media (max-width: 768px) { .main-nav { display: none !important; } }

.nav-link {
  padding: .38rem .75rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--fast), color var(--fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.nav-link:hover, .nav-link.active {
  background: var(--muted);
  color: var(--ink-1);
}
.nav-link.active { color: var(--primary); }

/* Nav Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .75rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--fast), color var(--fast);
}
.nav-dropdown-btn:hover { background: var(--muted); color: var(--ink-1); }
.dropdown-arrow { transition: transform var(--fast); flex-shrink: 0; }
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--fast), visibility var(--fast), transform var(--fast);
  z-index: 300;
}
.nav-dropdown-wide { min-width: 360px; left: -80px; }
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink-3);
  padding: .4rem .7rem .2rem;
  display: block;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .48rem .7rem;
  border-radius: var(--r-sm);
  font-size: .855rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background var(--fast), color var(--fast);
}
.nav-dropdown-menu a:hover { background: var(--muted); color: var(--ink-1); }
.nav-dropdown-menu .divider { height: 1px; background: var(--border); margin: .4rem 0; }

.nav-genre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  padding: .2rem 0;
}
.nav-genre-item {
  padding: .32rem .5rem;
  border-radius: var(--r-xs);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: background var(--fast), color var(--fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-genre-item:hover { background: var(--muted); color: var(--ink-1); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Search Trigger */
.search-trigger {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .9rem;
  border-radius: var(--r-full);
  background: var(--muted);
  border: 1.5px solid var(--border);
  color: var(--ink-3);
  font-size: .855rem;
  cursor: pointer;
  transition: all var(--fast);
  min-width: 160px;
}
.search-trigger:hover { border-color: var(--primary); color: var(--ink-2); }
.search-trigger kbd {
  margin-left: auto;
  background: var(--muted-2);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  font-size: .72rem;
  color: var(--ink-3);
}
@media (max-width: 768px) {
  .search-trigger { min-width: auto; padding: .42rem .6rem; }
  .search-trigger .search-trigger-text,
  .search-trigger kbd { display: none; }
}

/* Icon Button */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--muted);
  border: 1.5px solid var(--border);
  color: var(--ink-2);
  transition: all var(--fast);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--muted-2); color: var(--primary); border-color: var(--primary); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* Auth Buttons */
.btn-login {
  padding: .4rem .85rem;
  border-radius: var(--r-md);
  font-size: .855rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: all var(--fast);
}
.btn-login:hover { color: var(--primary); background: var(--primary-muted); }

.btn-register {
  padding: .42rem 1rem;
  border-radius: var(--r-md);
  font-size: .855rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  transition: all var(--fast);
}
.btn-register:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* User Menu */
.user-menu { position: relative; }
.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem .5rem .28rem .28rem;
  border-radius: var(--r-full);
  background: var(--muted);
  border: 1.5px solid var(--border);
  transition: all var(--fast);
  cursor: pointer;
}
.user-avatar-btn:hover { border-color: var(--primary); }
.user-avatar-btn img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-avatar-btn .user-name-text {
  font-size: .855rem;
  font-weight: 600;
  color: var(--ink-1);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) { .user-avatar-btn .user-name-text { display: none; } }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  display: none;
  z-index: 300;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .75rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all var(--fast);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--muted); color: var(--ink-1); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: .4rem 0; }

/* Hamburger */
.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--muted);
  border: 1.5px solid var(--border);
  color: var(--ink-2);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 768px) { .mobile-menu-btn { display: flex; } }
@media (min-width: 769px) { .mobile-menu-btn { display: none !important; } }

/* ----------------------------------------------------------------
   5. MOBILE DRAWER
   ---------------------------------------------------------------- */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 500;
  visibility: hidden;
}
.mobile-drawer.open { visibility: visible; }

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16,13,26,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--normal);
}
.mobile-drawer.open .mobile-drawer-overlay { opacity: 1; }

.mobile-drawer-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(82vw, 300px);
  background: var(--card);
  transform: translateX(-100%);
  transition: transform var(--normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }

.mobile-drawer-header {
  padding: 1rem 1.1rem .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: .75rem .75rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-search-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .65rem .9rem;
  background: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: .875rem;
  margin-bottom: .85rem;
  transition: border-color var(--fast);
}
.mobile-search-btn:hover { border-color: var(--primary); color: var(--ink-2); }

.mobile-nav-section { margin-bottom: .5rem; }
.mobile-nav-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink-3);
  padding: .5rem .75rem .2rem;
  display: block;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .58rem .75rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: .875rem;
  transition: background var(--fast), color var(--fast);
  width: 100%;
  text-align: left;
}
.mobile-nav-link:hover, .mobile-nav-link.active { background: var(--muted); color: var(--primary); }
.mobile-nav-link.active { font-weight: 600; }

/* Mobile accordion for genre list */
.mobile-accordion-btn {
  justify-content: space-between;
}
.mobile-accordion-btn svg { transition: transform var(--fast); flex-shrink: 0; }
.mobile-accordion-btn.open svg { transform: rotate(180deg); }
.mobile-accordion-content { display: none; padding-left: .5rem; }
.mobile-accordion-content.open { display: block; }

.mobile-drawer-footer {
  padding: .85rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   6. SEARCH OVERLAY
   ---------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(16,13,26,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--normal), visibility var(--normal);
}
.search-overlay.open { opacity: 1; visibility: visible; }

.search-box {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap svg { color: var(--ink-3); flex-shrink: 0; }
.search-input-wrap input {
  border: none;
  background: none;
  font-size: 1.05rem;
  padding: 0;
  box-shadow: none;
  font-weight: 500;
}
.search-input-wrap input:focus { box-shadow: none; }

.search-hints {
  padding: .6rem 1.2rem;
  font-size: .78rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-hint-tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  background: var(--muted);
  border-radius: var(--r-full);
  font-size: .75rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.search-hint-tag:hover { background: var(--primary-muted); color: var(--primary); }

.search-results-dropdown {
  max-height: 420px;
  overflow-y: auto;
  padding: .5rem;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--r-md);
  transition: background var(--fast);
  cursor: pointer;
}
.search-result-item:hover { background: var(--muted); }
.search-result-cover {
  width: 40px; height: 56px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-info h4 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-1);
  line-height: 1.3;
}
.search-result-info p { font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }
.search-no-result {
  padding: 2rem;
  text-align: center;
  color: var(--ink-3);
  font-size: .875rem;
}

/* ----------------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.35rem;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 700;
  transition: all var(--fast);
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid transparent;
  letter-spacing: -.1px;
}
.btn:disabled { opacity: .55; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124,58,237,.35);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--muted);
  color: var(--ink-1);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--muted-2);
  border-color: var(--border-strong);
  color: var(--ink-1);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--muted); color: var(--ink-1); }

.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: .38rem .85rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.85rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: .55rem; border-radius: var(--r-full); }

.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .55s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------
   8. CARDS
   ---------------------------------------------------------------- */
.novel-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: all var(--normal);
  position: relative;
}
.novel-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.novel-card:active { transform: translateY(-2px); }

.novel-card-cover {
  position: relative;
  overflow: hidden;
  background: var(--muted);
  aspect-ratio: 2/3;
}
.novel-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--slow);
}
.novel-card:hover .novel-card-cover img { transform: scale(1.06); }

.novel-card-badge {
  position: absolute;
  top: 7px; left: 7px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-ongoing   { background: #10b981; color: #fff; }
.badge-completed { background: var(--primary); color: #fff; }
.badge-hiatus    { background: #f59e0b; color: #fff; }
.badge-dropped   { background: #ef4444; color: #fff; }
.badge-new       { background: var(--accent); color: #fff; }

.novel-card-rating {
  position: absolute;
  bottom: 7px; right: 7px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,.72);
  color: #fbbf24;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

.novel-card-body {
  padding: .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.novel-card-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.novel-card-author { font-size: .74rem; color: var(--ink-3); }
.novel-card-chapter {
  font-size: .74rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: auto;
  padding-top: .25rem;
}
.novel-card-genres { display: flex; gap: .28rem; flex-wrap: wrap; margin-top: .28rem; }

/* Novel Grid */
.novels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
}
@media (min-width: 480px)  { .novels-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 768px)  { .novels-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .novels-grid { grid-template-columns: repeat(5, 1fr); } }

/* ----------------------------------------------------------------
   9. GENRE / TAG BADGES
   ---------------------------------------------------------------- */
.genre-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .73rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--ink-2);
  border: 1px solid var(--border);
  transition: all var(--fast);
  white-space: nowrap;
}
.genre-badge:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-muted); }

.tag-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: .72rem;
  font-weight: 500;
  background: var(--muted);
  color: var(--ink-3);
  transition: all var(--fast);
}
.tag-badge:hover { background: var(--primary); color: #fff; }

.genre-quick-links {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .genre-quick-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .25rem;
  }
  .genre-quick-links::-webkit-scrollbar { display: none; }
}

/* ----------------------------------------------------------------
   10. HERO SLIDER
   ---------------------------------------------------------------- */
.hero-slider {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--card);
  min-height: 360px;
  margin-bottom: 2rem;
  border: 1.5px solid var(--border);
}

.hero-slide { display: none; position: relative; }
.hero-slide.active { display: flex; }

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(.35);
  transform: scale(1.12);
}
.hero-slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.4) 0%, transparent 70%);
}

.hero-slide-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem;
  width: 100%;
}
.hero-slide-cover {
  width: 150px;
  flex-shrink: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  aspect-ratio: 2/3;
  object-fit: cover;
}
.hero-slide-info { flex: 1; color: #fff; }
.hero-slide-info .genres { display: flex; gap: .4rem; margin-bottom: .65rem; flex-wrap: wrap; }
.hero-slide-info .genre-pill {
  padding: 3px 10px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--r-full);
  font-size: .73rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.hero-slide-info h2 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -.3px;
}
.hero-slide-info .author { opacity: .78; font-size: .875rem; margin-bottom: .65rem; }
.hero-slide-info .desc {
  opacity: .72;
  font-size: .875rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.hero-slide-info .meta {
  display: flex;
  gap: 1.1rem;
  font-size: .8rem;
  opacity: .82;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.hero-slide-info .meta span { display: flex; align-items: center; gap: .3rem; }

.hero-controls {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .45rem;
  z-index: 10;
}
.hero-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.38);
  cursor: pointer;
  transition: all var(--fast);
}
.hero-dot.active { width: 22px; border-radius: 4px; background: #fff; }

.hero-prev, .hero-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--fast);
  z-index: 10;
  border: 1.5px solid rgba(255,255,255,.25);
}
.hero-prev:hover, .hero-next:hover { background: rgba(255,255,255,.26); }
.hero-prev { left: 1rem; }
.hero-next { right: 1rem; }

@media (max-width: 520px) {
  .hero-slider { min-height: 240px; }
  .hero-slide-content { flex-direction: column; padding: 1.25rem; gap: .85rem; }
  .hero-slide-cover { width: 90px; }
  .hero-slide-info h2 { font-size: 1.15rem; }
  .hero-slide-info .desc { display: none; }
}

/* ----------------------------------------------------------------
   11. SECTION HEADINGS
   ---------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  gap: .75rem;
}
.section-head h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.2px;
}
.section-head h2::before {
  content: '';
  display: block;
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.section-head a {
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.section-head a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   12. LATEST UPDATES
   ---------------------------------------------------------------- */
.updates-list { display: flex; flex-direction: column; gap: .65rem; }
.update-item {
  display: flex;
  gap: .85rem;
  padding: .75rem;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--border);
  transition: all var(--fast);
}
.update-item:hover { border-color: var(--primary); transform: translateX(3px); }
.update-cover {
  width: 54px; height: 76px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.update-info { flex: 1; min-width: 0; }
.update-title {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: color var(--fast);
}
.update-title:hover { color: var(--primary); }
.update-chapter {
  font-size: .78rem;
  color: var(--primary);
  font-weight: 600;
  display: block;
  margin-top: .18rem;
}
.update-meta {
  display: flex;
  gap: .65rem;
  font-size: .72rem;
  color: var(--ink-3);
  margin-top: .28rem;
}
@media (max-width: 480px) {
  .update-cover { width: 46px; height: 64px; }
  .update-item { padding: .6rem; gap: .6rem; }
}

/* ----------------------------------------------------------------
   13. RANKINGS
   ---------------------------------------------------------------- */
.ranking-list { display: flex; flex-direction: column; gap: .4rem; }
.ranking-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem;
  border-radius: var(--r-md);
  transition: background var(--fast);
  cursor: pointer;
}
.ranking-item:hover { background: var(--muted); }
.ranking-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--muted-2);
  color: var(--ink-3);
}
.ranking-num.top-1 { background: #f59e0b; color: #fff; }
.ranking-num.top-2 { background: #94a3b8; color: #fff; }
.ranking-num.top-3 { background: #cd7c54; color: #fff; }
.ranking-cover {
  width: 34px; height: 48px;
  border-radius: var(--r-xs);
  object-fit: cover;
  flex-shrink: 0;
}
.ranking-info { flex: 1; min-width: 0; }
.ranking-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  transition: color var(--fast);
}
.ranking-title:hover { color: var(--primary); }
.ranking-meta { font-size: .72rem; color: var(--ink-3); }

/* ----------------------------------------------------------------
   14. SIDEBAR WIDGET
   ---------------------------------------------------------------- */
.sidebar-widget {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.sidebar-widget-head {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.sidebar-widget-head svg { color: var(--primary); }
.sidebar-widget-body { padding: .85rem; }

/* ----------------------------------------------------------------
   15. HOME & BROWSE LAYOUT
   ---------------------------------------------------------------- */
.home-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 0;
}
@media (min-width: 1025px) {
  .home-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 1.75rem;
    align-items: start;
  }
}
.home-main { min-width: 0; }
@media (max-width: 1024px) { .home-sidebar { display: none; } }

.browse-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 0;
}
@media (min-width: 1025px) {
  .browse-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
  }
}
.browse-main { min-width: 0; }

/* ----------------------------------------------------------------
   16. NOVEL DETAIL PAGE
   ---------------------------------------------------------------- */
.novel-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem 0;
}
@media (min-width: 1025px) {
  .novel-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 1.75rem;
    align-items: start;
  }
}
.novel-layout-main { min-width: 0; }
@media (max-width: 1024px) { .novel-layout-sidebar { display: none; } }

.novel-detail-hero {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.novel-detail-banner {
  height: 190px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  position: relative;
  overflow: hidden;
}
.novel-detail-banner img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .28;
}
.novel-detail-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  margin-top: -72px;
  position: relative;
}
.novel-detail-cover {
  width: 130px;
  flex-shrink: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 3px solid var(--card);
}
.novel-detail-info { flex: 1; padding-top: .5rem; min-width: 0; }
.novel-detail-title {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .28rem;
  color: var(--ink-1);
  letter-spacing: -.3px;
}
.novel-detail-alt { font-size: .855rem; color: var(--ink-3); margin-bottom: .5rem; }
.novel-detail-author { font-size: .875rem; color: var(--ink-2); margin-bottom: .65rem; }
.novel-detail-author a { font-weight: 700; color: var(--primary); }

.novel-stats-bar {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: .85rem 1.5rem;
  border-top: 1px solid var(--border);
}
.novel-stat { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.novel-stat-value { font-size: 1.05rem; font-weight: 800; color: var(--ink-1); }
.novel-stat-label {
  font-size: .68rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.novel-actions { display: flex; gap: .65rem; margin-top: .85rem; flex-wrap: wrap; }

.novel-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .65rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 400px) { .novel-info-grid { grid-template-columns: 1fr 1fr; } }

.novel-info-item {
  background: var(--muted);
  border-radius: var(--r-md);
  padding: .65rem .85rem;
}
.novel-info-item .label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-3);
  margin-bottom: .2rem;
}
.novel-info-item .value {
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-1);
}

.novel-description {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--ink-2);
  line-height: 1.8;
}
.novel-description h3 {
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink-1);
  margin-bottom: .65rem;
}
.novel-description.collapsed { position: relative; max-height: 110px; overflow: hidden; }
.novel-description.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55px;
  background: linear-gradient(transparent, var(--card));
}
.show-more-btn {
  font-size: .845rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  margin-top: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: opacity var(--fast);
}
.show-more-btn:hover { opacity: .75; }

@media (max-width: 520px) {
  .novel-detail-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -55px;
    padding: 1rem;
  }
  .novel-detail-cover { width: 108px; }
  .novel-detail-title { font-size: 1.25rem; }
  .novel-actions { justify-content: center; }
  .novel-stats-bar { gap: .85rem; justify-content: center; padding: .85rem 1rem; }
}

/* ----------------------------------------------------------------
   17. CHAPTER LIST
   ---------------------------------------------------------------- */
.chapter-list-wrap {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.chapter-list-head {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.chapter-list-head h3 { font-size: .95rem; font-weight: 800; }
.chapter-list-body { max-height: 420px; overflow-y: auto; }

.chapter-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .68rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--fast);
}
.chapter-item:hover { background: var(--muted); }
.chapter-item:last-child { border-bottom: none; }
.chapter-num { font-size: .78rem; font-weight: 700; color: var(--ink-3); min-width: 48px; }
.chapter-title-link {
  flex: 1;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--fast);
}
.chapter-title-link:hover { color: var(--primary); }
.chapter-date { font-size: .73rem; color: var(--ink-3); white-space: nowrap; }
.chapter-item.read .chapter-title-link { color: var(--ink-3); }

@media (max-width: 480px) {
  .chapter-item { padding: .6rem 1rem; }
  .chapter-date { display: none; }
}

/* ----------------------------------------------------------------
   18. READING PAGE
   ---------------------------------------------------------------- */
.reading-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 9999;
  transition: width .1s linear;
  width: 0%;
}

.reader-header {
  position: sticky;
  top: 0;
  z-index: 150;
  background: var(--card);
  border-bottom: 1.5px solid var(--border);
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  transition: transform var(--normal);
}
.reader-header.hidden { transform: translateY(-100%); }
.reader-header-back {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.reader-header-back:hover { color: var(--primary); }
.reader-header-title {
  flex: 1;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-1);
}
.reader-header-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.reader-content {
  max-width: var(--reader-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}
.reader-chapter-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink-1);
  margin-bottom: 2rem;
  line-height: 1.3;
  letter-spacing: -.3px;
}
.reader-text {
  font-family: var(--reader-font, var(--font-serif));
  font-size: var(--reader-size, 18px);
  line-height: var(--reader-line-height, 1.95);
  color: var(--reader-text-color, var(--ink-1));
}
.reader-text p { margin-bottom: 1.3em; }
.reader-text p:last-child { margin-bottom: 0; }

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.5rem 0;
  border-top: 1.5px solid var(--border);
  margin-top: 2rem;
}

.reader-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: var(--card);
  border-top: 1.5px solid var(--border);
  padding: .65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  justify-content: center;
  transition: transform var(--normal);
}
.reader-bottom-bar.hidden { transform: translateY(100%); }

/* Reader settings panel */
.reader-settings {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, calc(100vw - 2rem));
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  z-index: 300;
  display: none;
}
.reader-settings.open { display: block; }
.reader-settings h4 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink-1);
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
  gap: 1rem;
}
.setting-row label { font-size: .855rem; color: var(--ink-2); font-weight: 500; }
.setting-controls { display: flex; gap: .4rem; }
.setting-btn {
  padding: .35rem .8rem;
  border-radius: var(--r-md);
  font-size: .8rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--ink-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--fast);
}
.setting-btn.active, .setting-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Chapter list popup (bottom sheet) */
.chapter-list-popup {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  visibility: hidden;
}
.chapter-list-popup.open { visibility: visible; }
.chapter-list-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--normal);
}
.chapter-list-popup.open .chapter-list-popup-overlay { opacity: 1; }
.chapter-list-popup-panel {
  position: relative;
  width: 100%;
  max-height: 72vh;
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--normal);
}
.chapter-list-popup.open .chapter-list-popup-panel { transform: translateY(0); }
.chapter-list-popup-head {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chapter-list-popup-body { overflow-y: auto; flex: 1; }
.chapter-popup-search { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.chapter-popup-search input { border-radius: var(--r-full); }

/* Handle bar */
.bottom-sheet-handle {
  width: 36px; height: 4px;
  background: var(--muted-2);
  border-radius: var(--r-full);
  margin: .75rem auto 0;
}

@media (max-width: 480px) {
  .reader-content { padding: 1.5rem .875rem 6rem; }
  .reader-chapter-title { font-size: 1.2rem; }
  .reader-bottom-bar { padding: .55rem .875rem; gap: .5rem; }
}

/* ----------------------------------------------------------------
   19. COMMENTS
   ---------------------------------------------------------------- */
.comments-section {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.comments-head {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink-1);
}
.comment-form-wrap { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.comment-form-wrap textarea { resize: vertical; min-height: 78px; }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: .65rem; }

.comment-list { padding: .65rem 1.25rem; }
.comment-item {
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .45rem;
}
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.comment-username { font-size: .855rem; font-weight: 700; color: var(--ink-1); }
.comment-time { font-size: .72rem; color: var(--ink-3); }
.comment-level {
  font-size: .67rem;
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.comment-body {
  font-size: .875rem;
  color: var(--ink-2);
  line-height: 1.7;
  padding-left: 2.4rem;
}
.comment-actions {
  display: flex;
  gap: .75rem;
  padding-left: 2.4rem;
  margin-top: .45rem;
}
.comment-action-btn {
  font-size: .77rem;
  color: var(--ink-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .28rem;
  cursor: pointer;
  transition: color var(--fast);
}
.comment-action-btn:hover, .comment-action-btn.liked { color: var(--primary); }
.replies { padding-left: 2.4rem; margin-top: .65rem; }
.reply-item {
  padding: .55rem 0;
  border-left: 2px solid var(--border);
  padding-left: .85rem;
  margin-bottom: .45rem;
}

/* ----------------------------------------------------------------
   20. FORMS / AUTH
   ---------------------------------------------------------------- */
.auth-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  border: 1.5px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo a { font-size: 1.55rem; font-weight: 900; color: var(--primary); }
.auth-title { font-size: 1.45rem; font-weight: 800; text-align: center; margin-bottom: .4rem; color: var(--ink-1); letter-spacing: -.3px; }
.auth-subtitle { text-align: center; color: var(--ink-3); font-size: .855rem; margin-bottom: 1.85rem; }

.form-group { margin-bottom: 1.05rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--ink-1); margin-bottom: .38rem; }
.form-hint { font-size: .775rem; color: var(--ink-3); margin-top: .28rem; }
.form-error { font-size: .78rem; color: #ef4444; margin-top: .28rem; }
.input-group { position: relative; }
.input-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.input-group input { padding-left: 2.6rem; }
.input-eye { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); cursor: pointer; }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.1rem 0;
  color: var(--ink-3);
  font-size: .78rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 1.8rem);
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer { text-align: center; margin-top: 1.35rem; font-size: .855rem; color: var(--ink-3); }
.auth-footer a { color: var(--primary); font-weight: 700; }

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; border-radius: var(--r-lg); }
}

/* ----------------------------------------------------------------
   21. ALERTS & TOASTS
   ---------------------------------------------------------------- */
.alert {
  padding: .82rem 1.05rem;
  border-radius: var(--r-md);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin-bottom: .85rem;
  border: 1px solid transparent;
}
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
[data-theme="dark"] .alert-success { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.3); }
[data-theme="dark"] .alert-error   { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.3); }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.3); }
[data-theme="dark"] .alert-info    { background: rgba(59,130,246,.12); color: #60a5fa; border-color: rgba(59,130,246,.3); }

.toast-container {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .82rem 1.05rem;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  min-width: 270px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn .28s ease forwards;
}
.toast.removing { animation: toastOut .28s ease forwards; }
.toast-success { border-color: #10b981; }
.toast-error   { border-color: #ef4444; }
.toast-icon-success { color: #10b981; flex-shrink: 0; }
.toast-icon-error   { color: #ef4444; flex-shrink: 0; }
@keyframes toastIn  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }
@media (max-width: 480px) {
  .toast-container { top: auto; bottom: 5.5rem; right: .75rem; left: .75rem; }
  .toast { min-width: auto; max-width: 100%; }
}

/* ----------------------------------------------------------------
   22. PAGINATION
   ---------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 2rem;
}
.pagination-info { font-size: .78rem; color: var(--ink-3); }
.pagination-list { display: flex; gap: .28rem; flex-wrap: wrap; }
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .45rem;
  border-radius: var(--r-md);
  font-size: .855rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1.5px solid var(--border);
  transition: all var(--fast);
}
.pagination-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination-btn:disabled { opacity: .45; pointer-events: none; }
.pagination-dots { padding: 0 .25rem; color: var(--ink-3); display: flex; align-items: center; }

/* ----------------------------------------------------------------
   23. FOOTER
   ---------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; } }

.footer-brand .site-logo { font-size: 1.2rem; margin-bottom: .75rem; }
.footer-desc { font-size: .855rem; color: var(--ink-3); line-height: 1.7; }
.footer-heading {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink-2);
  margin-bottom: .75rem;
}
.footer-links { display: flex; flex-direction: column; gap: .38rem; }
.footer-links a { font-size: .855rem; color: var(--ink-3); transition: color var(--fast); }
.footer-links a:hover { color: var(--primary); }

.footer-social { display: flex; gap: .5rem; margin-top: .85rem; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: all var(--fast);
}
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.footer-bottom {
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  font-size: .78rem;
  color: var(--ink-3);
}
.footer-bottom a { color: var(--ink-3); }
.footer-bottom a:hover { color: var(--primary); }

/* ----------------------------------------------------------------
   24. ANNOUNCEMENT BAR
   ---------------------------------------------------------------- */
.announcement-bar {
  padding: .55rem 1rem;
  text-align: center;
  font-size: .84rem;
  font-weight: 500;
  position: relative;
}
.announcement-bar.info    { background: #dbeafe; color: #1e40af; }
.announcement-bar.warning { background: #fef3c7; color: #92400e; }
.announcement-bar.success { background: #dcfce7; color: #166534; }
.announcement-bar.danger  { background: #fee2e2; color: #991b1b; }
.announcement-bar .close-bar {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: .65;
}
.announcement-bar .close-bar:hover { opacity: 1; }

/* ----------------------------------------------------------------
   25. SKELETON LOADING
   ---------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, var(--muted-2) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ----------------------------------------------------------------
   26. SCROLL TO TOP
   ---------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 1.1rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--normal);
  z-index: 80;
  cursor: pointer;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-hover); transform: translateY(-3px); }
@media (max-width: 480px) { .scroll-top { bottom: 5.5rem; right: .75rem; width: 38px; height: 38px; } }

/* ----------------------------------------------------------------
   27. STATIC PAGES
   ---------------------------------------------------------------- */
.static-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}
.static-page h1 { font-size: 1.9rem; font-weight: 900; margin-bottom: .45rem; color: var(--ink-1); letter-spacing: -.3px; }
.static-page .page-meta { font-size: .84rem; color: var(--ink-3); margin-bottom: 2rem; padding-bottom: .85rem; border-bottom: 1.5px solid var(--border); }
.static-page h2 { font-size: 1.15rem; font-weight: 800; color: var(--ink-1); margin: 1.85rem 0 .65rem; }
.static-page p { font-size: .9rem; color: var(--ink-2); line-height: 1.8; margin-bottom: .8rem; }
.static-page ul { list-style: disc; padding-left: 1.5rem; margin-bottom: .8rem; }
.static-page ul li { font-size: .9rem; color: var(--ink-2); line-height: 1.8; margin-bottom: .22rem; }
.static-page a { color: var(--primary); }
.static-page a:hover { text-decoration: underline; }

.contact-form {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.85rem;
  margin-top: 1.5rem;
}
@media (max-width: 480px) {
  .static-page h1 { font-size: 1.45rem; }
  .contact-form { padding: 1.25rem; }
}

/* ----------------------------------------------------------------
   28. THEME TOGGLE
   ---------------------------------------------------------------- */
.theme-toggle svg { transition: transform .4s ease; }
.theme-toggle:hover svg { transform: rotate(22deg); }

/* ----------------------------------------------------------------
   29. UTILITY CLASSES
   ---------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-3); }
.text-primary-color { color: var(--primary); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .78rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.rounded { border-radius: var(--r-md); }
.rounded-full { border-radius: var(--r-full); }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ----------------------------------------------------------------
   30. OVERFLOW PREVENTION
   ---------------------------------------------------------------- */
html, body { max-width: 100%; overflow-x: hidden; }
.container { max-width: min(var(--max-w), 100%); }
img { max-width: 100%; height: auto; }
@media (max-width: 768px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ================================================================
   END OF STYLE.CSS — SuperNovel
   ================================================================ */

/* ── Desktop-only: sembunyikan di mobile (sudah ada di drawer) ── */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}
