/* ===================================================
   TRUYENFULL THEME - MAIN STYLESHEET
   Version: 1.0
   =================================================== */

/* === CSS VARIABLES === */
:root {
  --header-bg: #1a1a2e;
  --header-text: #ffffff;
  --nav-bg: #16213e;
  --nav-link: #c8d0e0;
  --nav-link-hover: #ffffff;
  --nav-active-bg: #e63946;
  --accent: #e63946;
  --accent-hover: #c1121f;
  --accent2: #f4a261;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;

  /* Light Theme */
  --body-bg: #f0f2f5;
  --content-bg: #ffffff;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --card-hover-shadow: 0 4px 12px rgba(0,0,0,.12);
  --section-title-bg: #f8fafc;
  --section-title-border: #e63946;
  --tag-bg: #eff6ff;
  --tag-color: #2563eb;
  --tag-border: #bfdbfe;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-focus: #3b82f6;
  --hot-badge: #ef4444;
  --new-badge: #10b981;
  --full-badge: #8b5cf6;
  --rank-1: #f59e0b;
  --rank-2: #94a3b8;
  --rank-3: #cd7c3a;

  /* Reading Page */
  --reading-bg: #fdf6e3;
  --reading-text: #3d3325;
  --reading-font-size: 18px;
  --reading-line-height: 2;

  --footer-bg: #1a1a2e;
  --footer-text: #94a3b8;
  --scrollbar-thumb: #cbd5e1;
}

[data-theme="dark"] {
  --body-bg: #0f172a;
  --content-bg: #1e293b;
  --card-bg: #1e293b;
  --sidebar-bg: #1e293b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --card-shadow: 0 1px 3px rgba(0,0,0,.3);
  --card-hover-shadow: 0 4px 12px rgba(0,0,0,.5);
  --section-title-bg: #1e293b;
  --tag-bg: #1e3a5f;
  --tag-color: #93c5fd;
  --tag-border: #1e40af;
  --input-bg: #1e293b;
  --input-border: #475569;
  --reading-bg: #1a1a1a;
  --reading-text: #d4c9b0;
  --scrollbar-thumb: #475569;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color .3s, color .3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link-color); text-decoration: none; transition: color .2s; }
a:hover { color: var(--link-hover); }

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

ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 20px 0;
}

.main-content { min-width: 0; }

/* === HEADER === */
#site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.logo-text span { color: var(--accent2); }

/* Search Bar */
.search-form {
  flex: 1;
  display: flex;
  max-width: 600px;
  position: relative;
}

.search-input {
  flex: 1;
  padding: 9px 16px;
  border: 2px solid #2d3560;
  border-right: none;
  border-radius: 6px 0 0 6px;
  background: #0d1428;
  color: #e2e8f0;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.search-input::placeholder { color: #64748b; }

.search-input:focus { border-color: var(--accent); }

.search-btn {
  padding: 9px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 15px;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-btn:hover { background: var(--accent-hover); }

/* Search Suggest */
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  display: none;
  z-index: 100;
  max-height: 360px;
  overflow-y: auto;
}

.search-suggest.active { display: block; }

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border-color);
}

.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--body-bg); }

.suggest-item img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.suggest-info .title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.suggest-info .meta { font-size: 11px; color: var(--text-muted); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  position: relative;
}

.btn-icon:hover { background: rgba(255,255,255,.2); }

.btn-login {
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-login:hover { background: var(--accent-hover); }

/* === NAVIGATION === */
#main-nav {
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,.05);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  color: var(--nav-link);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--nav-link-hover);
  background: rgba(255,255,255,.07);
}

.nav-link.active { border-bottom: 2px solid var(--accent); }

.nav-item.has-dropdown:hover > .dropdown { display: block; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 200px;
  z-index: 200;
}

.dropdown.mega {
  left: 0;
  width: 600px;
  padding: 16px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.nav-item.has-dropdown:hover > .dropdown.mega { display: grid; }

.dropdown-item {
  display: block;
  padding: 9px 16px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all .15s;
  border-radius: 6px;
}

.dropdown-item:hover { background: var(--body-bg); color: var(--accent); }

.dropdown-item .icon { margin-right: 6px; font-size: 14px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
}

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border-color); }
.breadcrumb .current { color: var(--text-primary); }

/* === SECTION TITLE === */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--section-title-bg);
  border-left: 4px solid var(--section-title-border);
  border-radius: 0 6px 0 0;
  margin-bottom: 0;
}

.section-title h2, .section-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon { color: var(--accent); font-size: 16px; }

.section-title .view-all {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.section-title .view-all:hover { color: var(--accent-hover); }

.section-box {
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

/* === NOVEL CARD === */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  padding: 14px;
}

.novel-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.novel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
}

.novel-card-cover {
  display: block;
  position: relative;
  padding-top: 140%;
  overflow: hidden;
  background: #e2e8f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='80' viewBox='0 0 60 80'%3E%3Crect width='60' height='80' fill='%23e2e8f0'/%3E%3Ctext x='30' y='44' text-anchor='middle' font-size='28' fill='%23a0aec0'%3E📖%3C/text%3E%3C/svg%3E") center/contain no-repeat;
}

.novel-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.novel-card:hover .novel-card-cover img { transform: scale(1.05); }

.novel-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #fff;
}

.badge-hot { background: var(--hot-badge); }
.badge-new { background: var(--new-badge); }
.badge-full { background: var(--full-badge); }
.badge-vip { background: #f59e0b; }

.novel-card-chapter {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  font-size: 11px;
  color: rgba(255,255,255,.9);
}

.novel-card-body { padding: 8px; }

.novel-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}

.novel-card-title:hover { color: var(--accent); }

.novel-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  display: inline-block;
  padding: 1px 6px;
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}

/* === NOVEL LIST (Latest Updates) === */
.novel-list { padding: 0; }

.novel-list-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background .15s;
}

.novel-list-item:last-child { border-bottom: none; }
.novel-list-item:hover { background: var(--body-bg); }

.novel-list-cover {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.novel-list-info {}

.novel-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novel-list-title:hover { color: var(--accent); }

.novel-list-chapters {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.chapter-link {
  font-size: 12px;
  color: var(--link-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-link:hover { color: var(--accent); }

.chapter-link .time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.novel-list-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === SLIDER / FEATURED === */
.featured-slider {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
  background: var(--content-bg);
}

.slider-track {
  display: flex;
  transition: transform .4s ease;
}

.slide {
  min-width: 100%;
  position: relative;
  height: 300px;
  overflow: hidden;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px) brightness(.5);
  transform: scale(1.05);
}

.slide-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 30px;
  height: 100%;
}

.slide-cover {
  width: 130px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  flex-shrink: 0;
}

.slide-info { color: #fff; flex: 1; }

.slide-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.slide-tags { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }

.slide-tag {
  padding: 3px 10px;
  background: rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(4px);
}

.slide-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.slide-actions { display: flex; gap: 10px; }

.btn-read {
  padding: 9px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-read:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  padding: 9px 22px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover { background: rgba(255,255,255,.25); color: #fff; }

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: all .2s;
}

.dot.active { background: #fff; width: 20px; border-radius: 4px; }

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.slider-btn:hover { background: var(--accent); }
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }

/* === HOT NOVELS TABS === */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--section-title-bg);
}

.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === RANKING === */
.rank-list { padding: 0; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background .15s;
}

.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: var(--body-bg); }

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--body-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-num.gold { background: var(--rank-1); color: #fff; }
.rank-num.silver { background: var(--rank-2); color: #fff; }
.rank-num.bronze { background: var(--rank-3); color: #fff; }

.rank-cover {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }

.rank-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-title:hover { color: var(--accent); }

.rank-meta { font-size: 11px; color: var(--text-muted); }

/* === SIDEBAR === */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

/* === CATEGORIES WIDGET === */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 10px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.cat-item { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.cat-item:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.cat-icon { font-size: 20px; color: var(--accent); }
.cat-name { font-size: 12px; color: var(--text-primary); font-weight: 500; }

/* === NOVEL DETAIL LAYOUT === */
.novel-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.novel-detail-main {
  min-width: 0;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.novel-sidebar-right {
  min-width: 0;
}

/* Novel detail: cover beside info */
.novel-detail-top {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.novel-detail-cover {
  flex-shrink: 0;
}

.novel-detail-cover img {
  width: 160px;
  height: 225px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border: 2px solid var(--border-color);
  display: block;
}

.novel-detail-info {
  flex: 1;
  min-width: 0;
}

.novel-description {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.desc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.description-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.description-content.expanded { -webkit-line-clamp: unset; }

/* Reading page side banners */
.reading-side-banner {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reading-side-left  { left: 0; }
.reading-side-right { right: 0; }

@media (max-width: 1200px) {
  .reading-side-banner { display: none; }
  .novel-detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .novel-detail-top { flex-direction: column; align-items: center; text-align: center; }
  .novel-detail-cover img { width: 140px; height: 196px; }
}

/* === NOVEL DETAIL PAGE === */
.novel-detail {
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.novel-detail-top {
  display: flex;
  gap: 24px;
}

.novel-detail-cover {
  flex-shrink: 0;
}

.novel-detail-cover img {
  width: 160px;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border: 2px solid var(--border-color);
}

.novel-detail-info { flex: 1; }

.novel-detail-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
}

.novel-meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.novel-meta-item {
  display: flex;
  gap: 10px;
  font-size: 14px;
  align-items: flex-start;
}

.novel-meta-item .label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 80px;
  font-weight: 600;
}

.novel-meta-item .value { color: var(--text-primary); }

.novel-meta-item .value a { color: var(--link-color); }
.novel-meta-item .value a:hover { color: var(--accent); }

.novel-stats {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-value { font-size: 18px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); }

.novel-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.novel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
}

.novel-tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.novel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

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

.btn-secondary {
  padding: 10px 20px;
  background: var(--body-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  padding: 10px 20px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-danger:hover { background: var(--accent); color: #fff; }

/* Description */
.novel-desc {
  padding: 16px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.novel-desc.collapsed {
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.novel-desc.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--content-bg));
}

.btn-expand {
  display: block;
  text-align: center;
  padding: 8px;
  color: var(--link-color);
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}

/* === CHAPTER LIST === */
.chapter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--body-bg);
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-search {
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 300px;
}

.chapter-search input {
  flex: 1;
  padding: 7px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.chapter-search input:focus { border-color: var(--input-focus); }

.chapter-sort {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.chapter-sort button {
  padding: 6px 12px;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .2s;
}

.chapter-sort button.active, .chapter-sort button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chapter-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.chapter-item {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  transition: background .15s;
  gap: 6px;
}

.chapter-item:hover { background: var(--body-bg); }

.chapter-item:nth-child(3n) { border-right: none; }

.chapter-item a {
  min-width: 0;
  font-size: 12.5px;
  color: var(--link-color);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-item a:hover { color: var(--accent); }

.chapter-item .time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chapter-item.new a { font-weight: 600; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--content-bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }

/* === RATING === */
.rating-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stars {
  display: flex;
  gap: 3px;
  font-size: 20px;
  cursor: pointer;
}

.star { color: #d1d5db; transition: color .1s; }
.star.active, .star.hover { color: #f59e0b; }

.rating-text { font-size: 14px; color: var(--text-secondary); }
.rating-value { font-size: 22px; font-weight: 800; color: #f59e0b; }

/* === READING PAGE === */
.reading-page { background: var(--reading-bg); }

.reading-header {
  background: var(--header-bg);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* Reading header inner layout */
.reading-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 12px;
}

.back-to-novel {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  max-width: 220px;
  overflow: hidden;
}
.back-to-novel:hover { color: #fff; }
.back-to-novel .novel-name-short {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-header-center {
  flex: 1;
  text-align: center;
  overflow: hidden;
  padding: 0 8px;
}
.chapter-title-short {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.reading-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Main reading area */
.reading-main {
  min-height: 100vh;
  background: var(--reading-bg);
  position: relative;
}

/* Reading content — constrained center column */
.reading-content-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  background: var(--reading-bg);
  color: var(--reading-text);
}

/* Settings panel header row */
.setting-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.setting-header-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  padding: 0;
  margin: 0;
}

/* Chapter header & meta */
.chapter-header {
  margin-bottom: 16px;
}
.chapter-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--reading-text);
  margin: 8px 0 6px;
  line-height: 1.4;
}
.chapter-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.reading-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reading-title {
  text-align: center;
  flex: 1;
}

.reading-title .novel-name {
  font-size: 13px;
  color: rgba(255,255,255,.7);
}

.reading-title .chapter-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.reading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-setting {
  padding: 7px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .2s;
}

.btn-setting:hover { background: rgba(255,255,255,.2); }

.chapter-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  justify-content: center;
  flex-wrap: wrap;
}

/* Reading page nav buttons — adapt to any background (sepia/white/green/dark) */
.reading-page .btn-nav {
  padding: 9px 20px;
  background: transparent;
  color: inherit;            /* picks up .reading-content-wrapper's inline color */
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, opacity .2s;
  opacity: 0.8;
  font-family: inherit;
}

.reading-page .btn-nav:hover {
  background: rgba(128,128,128,.15);
  opacity: 1;
}

/* Override slider's white-on-dark .btn-outline inside reading page */
.reading-page .btn-nav.btn-outline {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

/* Chương Sau (primary) — accent red, always contrasts on all reading backgrounds */
.reading-page .btn-nav.btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
  opacity: 1;
}

.reading-page .btn-nav.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-chapter {
  padding: 8px 18px;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  text-decoration: none;
}

.btn-chapter:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-chapter:disabled { opacity: .5; cursor: not-allowed; }

.chapter-select {
  padding: 8px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  min-width: 180px;
}

/* Reading Content */
.reading-content-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.reading-title-box {
  text-align: center;
  padding: 24px 0 20px;
  border-bottom: 1px solid rgba(128,128,128,.2);
  margin-bottom: 24px;
}

.reading-novel-name {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.reading-chapter-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--reading-text);
  line-height: 1.4;
}

.reading-body {
  font-size: var(--reading-font-size);
  line-height: var(--reading-line-height);
  color: var(--reading-text);
  font-family: 'Taviraj', 'Times New Roman', "Helvetica Neue", sans-serif;
  text-align: justify;
}

.reading-body p,
.reading-body div {
  margin-bottom: 1.2em;
  text-align: justify;
  text-indent: 2em;
}

.reading-body p:empty,
.reading-body div:empty { display: none; }

/* Anti-copy styles */
.reading-body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  position: relative;
}

.content-watermark {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .03;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 80px,
    rgba(0,0,0,.1) 80px,
    rgba(0,0,0,.1) 82px
  );
}

.watermark-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-size: 60px;
  font-weight: 900;
  color: rgba(128,128,128,.04);
  pointer-events: none;
  white-space: nowrap;
  z-index: 9;
  user-select: none;
  letter-spacing: 10px;
}

/* Reading Settings Panel */
.setting-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 300px;
  height: 100%;
  overflow-y: auto;
  background: var(--content-bg);
  box-shadow: -4px 0 20px rgba(0,0,0,.2);
  padding: 20px;
  z-index: 1001;
  transition: right .3s ease;
  display: block;
}

.setting-panel.active { right: 0; }

.setting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: none;
}

.setting-overlay.active { display: block; }

/* === TOC PANEL === */
.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1002;
  display: none;
}
.toc-overlay.active { display: block; }

.toc-panel {
  position: fixed;
  top: 0;
  left: -340px;
  width: 300px;
  height: 100%;
  background: var(--content-bg);
  box-shadow: 4px 0 20px rgba(0,0,0,.2);
  z-index: 1003;
  display: flex;
  flex-direction: column;
  transition: left .3s ease;
}
.toc-panel.active { left: 0; }

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.toc-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}
.toc-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px 6px;
}
.toc-close:hover { color: var(--accent); }

.toc-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.toc-search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
}
.toc-search input:focus { border-color: var(--accent); }

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.toc-loading { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

.toc-item {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-item:hover { background: var(--body-bg); color: var(--accent); }
.toc-item.current {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.setting-panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.setting-group {
  margin-bottom: 16px;
}

.setting-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.setting-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.setting-opt {
  padding: 7px 14px;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

.setting-opt:hover, .setting-opt.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.font-size-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
}

.font-size-ctrl button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-size-ctrl span {
  font-size: 15px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  color: var(--text-primary);
}

.close-setting {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
}

/* === COMMENTS === */
.comment-form {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}

.comment-form textarea:focus { border-color: var(--input-focus); }

.comment-submit {
  margin-top: 8px;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.comment-submit:hover { background: var(--accent-hover); }

.comment-list {}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.comment-body {}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.comment-user { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.comment-time { font-size: 11px; color: var(--text-muted); }

.comment-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }

.comment-actions {
  margin-top: 6px;
  display: flex;
  gap: 12px;
}

.comment-action-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}

.comment-action-btn:hover { color: var(--accent); }

/* === FOOTER === */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 40px 0 30px;
}

.footer-about .logo-text { font-size: 20px; }

.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--footer-text);
  margin: 12px 0;
}

.social-links { display: flex; gap: 8px; }

.social-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background .2s;
}

.social-btn:hover { background: var(--accent); color: #fff; }

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
  font-size: 13px;
  color: var(--footer-text);
  transition: color .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a::before {
  content: '›';
  color: var(--accent);
  font-size: 16px;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

/* === BACK TO TOP === */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(230,57,70,.4);
  transition: all .2s;
  z-index: 500;
}

#back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }
#back-to-top.show { display: flex; }

/* === TOAST === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  padding: 12px 18px;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  animation: slideIn .3s ease;
  border-left: 4px solid var(--accent);
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === MODAL === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--content-bg);
  border-radius: 12px;
  padding: 28px;
  min-width: 360px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s;
}

.modal-close:hover { color: var(--text-primary); }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.form-input:focus { border-color: var(--input-focus); }

/* === LOADING SPINNER === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--body-bg) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton { to { background-position: -200% 0; } }

/* === CATEGORY PAGE === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--body-bg);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.filter-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }

.filter-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-tag {
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--content-bg);
  transition: all .15s;
  white-space: nowrap;
}

.filter-tag:hover, .filter-tag.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sort-select {
  padding: 6px 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.view-toggle { display: flex; gap: 4px; }

.view-btn {
  width: 30px;
  height: 30px;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.view-btn.active, .view-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === STATS BAR === */
.stats-bar {
  display: flex;
  gap: 20px;
  padding: 12px 14px;
  background: var(--body-bg);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}

.stats-bar span { display: flex; align-items: center; gap: 5px; }

/* === NOTICE/ALERT === */
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.notice-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.notice-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

[data-theme="dark"] .notice-info { background: #1e3a5f; border-color: #1e40af; color: #93c5fd; }
[data-theme="dark"] .notice-warn { background: #451a03; border-color: #92400e; color: #fcd34d; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

/* === HIDE COMMENTS & WP DEFAULT WIDGETS === */
#comments,
#respond,
.comments-area,
.comments-section,
.comment-respond { display: none !important; }


.widget_recent_comments,
.widget_recent_entries,
.widget_archive,
.widget_calendar,
.widget_meta,
.widget_pages,
.widget_rss,
.widget_search,
.widget_tag_cloud { display: none !important; }

/* === NOVEL LIST ITEM improvements === */
.novel-list-item { padding: 10px 14px; }
.chapter-link { color: var(--accent); font-size: 12px; font-weight: 600; }
.chapter-link:hover { color: var(--accent-hover); }
.chapter-link .time { color: var(--text-muted); font-weight: 400; margin-left: 6px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .wrapper { grid-template-columns: 1fr 260px; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .chapter-list-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .wrapper { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.show-mobile { display: flex; }

  .header-top { flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; max-width: 100%; width: 100%; }
  .logo-text { font-size: 18px; }
  .mobile-menu-btn { display: flex; }

  .nav-list {
    display: none;
    flex-direction: column;
    padding: 8px 0;
    background: var(--nav-bg);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 16px rgba(0,0,0,.3);
  }

  .nav-list.open { display: flex; }
  .nav-link { padding: 12px 16px; width: 100%; }
  .dropdown { position: static; display: none !important; }
  .dropdown.mega { grid-template-columns: repeat(2, 1fr); position: static; width: 100%; }

  .novel-detail-top { flex-direction: column; align-items: center; text-align: center; }
  .novel-meta-item { justify-content: center; }
  .novel-stats { justify-content: center; }
  .novel-actions { justify-content: center; }
  .novel-tags-list { justify-content: center; }

  .chapter-list-grid { grid-template-columns: repeat(2, 1fr); }

  .slide { height: 220px; }
  .slide-content { padding: 16px; gap: 12px; }
  .slide-cover { width: 90px; height: 126px; }
  .slide-title { font-size: 16px; }
  .slide-desc { display: none; }

  .footer-main { grid-template-columns: 1fr 1fr; gap: 20px; }

  .novel-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }

  .reading-content-wrapper { padding: 16px 12px; }

  .chapter-list-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .footer-main { grid-template-columns: 1fr; }
  .novel-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .chapter-list-grid { grid-template-columns: 1fr 1fr; }
  .slide-cover { display: none; }
  .novel-detail-cover img { width: 120px; height: 168px; }
  .modal-box { min-width: unset; }
}

/* === UTILITY === */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width .1s;
}

/* Highlight search term */
.highlight { background: #fff176; color: #333; border-radius: 2px; padding: 0 2px; }

/* VIP chapter indicator */
.vip-lock {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f59e0b;
  font-size: 10px;
  font-weight: 700;
}
