/* ============================================================
   TTRUYEN — Giao diện chung (trang chủ, chi tiết, lưu trữ)
   ============================================================ */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1f2333;
  --bg-card-hover: #252840;
  --text-primary: #e8eaf0;
  --text-secondary: #9197a8;
  --text-muted: #5c6270;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-dim: rgba(245, 158, 11, 0.12);
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(245,158,11,0.3);
  --red: #ef4444;
  --green: #10b981;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="light"] {
  --bg-primary: #f4f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1,h2,h3,h4,h5 { margin: 0; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== HEADER ===== */
.site-header {
  background: rgba(15,17,23,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
  transition: var(--transition);
}
[data-theme="light"] .site-header { background: rgba(255,255,255,0.95); }
.header-top { padding: 12px 0; border-bottom: 1px solid var(--border); }
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 900;
  color: var(--accent); letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.logo span { color: var(--text-primary); }
.logo img { max-height: 40px; width: auto; }
.logo-icon {
  width: 36px; height: 36px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 1rem;
}

/* Search */
.search-wrapper { position: relative; flex: 1; max-width: 480px; }
.tt-search-form { margin: 0; position: relative; }
.search-input {
  width: 100%; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: 50px;
  padding: 10px 20px 10px 48px; color: var(--text-primary);
  font-size: 0.9rem; font-family: 'Be Vietnam Pro', sans-serif;
  transition: var(--transition); outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; z-index:1; }
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: var(--radius); padding: 8px; display: none;
  box-shadow: var(--shadow); z-index: 100;
}
.search-dropdown.show { display: block; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.search-item:hover { background: var(--accent-dim); }
.search-item img { width: 36px; height: 48px; object-fit: cover; border-radius: 4px; }
.search-item-info { flex: 1; min-width: 0; }
.search-item-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-meta { font-size: 0.75rem; color: var(--text-muted); }
.search-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* Auth buttons */
.btn-login { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 50px; padding: 8px 20px; font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition); }
.btn-login:hover { background: var(--accent); color: #000; }
.btn-register { background: var(--accent); border: none; color: #000; border-radius: 50px; padding: 8px 20px; font-size: 0.85rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: var(--transition); }
.btn-register:hover { background: var(--accent-hover); transform: translateY(-1px); }

.theme-toggle { width: 36px; height: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--text-secondary); }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Main Nav */
.main-nav { padding: 0; }
.nav-list { list-style: none; display: flex; gap: 0; margin: 0; }
.nav-list li a { display: flex; align-items: center; gap: 6px; padding: 14px 16px; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); transition: var(--transition); position: relative; }
.nav-list li a:hover, .nav-list li.active a { color: var(--accent); }
.nav-list li.active a::after { content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.nav-badge { background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 1px 5px; border-radius: 50px; }

.nav-dropdown { position: relative; }
.dropdown-menu-custom { position: absolute; top: 100%; left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; width: 480px; display: none; box-shadow: var(--shadow); z-index: 200; }
.nav-dropdown:hover .dropdown-menu-custom { display: block; }
.genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.genre-link { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--text-secondary); transition: var(--transition); white-space: nowrap; }
.genre-link:hover { background: var(--accent-dim); color: var(--accent); }

/* ===== BANNER SLIDER ===== */
.hero-slider { position: relative; height: 420px; overflow: hidden; background: var(--bg-secondary); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.slide.active { opacity: 1; pointer-events: auto; }
.slide-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.3); }
.slide-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 60px; background: linear-gradient(transparent, rgba(0,0,0,0.9)); display: flex; align-items: flex-end; gap: 30px; }
.slide-cover { width: 100px; height: 140px; object-fit: cover; border-radius: var(--radius-sm); box-shadow: 0 8px 30px rgba(0,0,0,0.5); flex-shrink: 0; border: 2px solid rgba(255,255,255,0.1); }
.slide-info { flex: 1; }
.slide-genres { display: flex; gap: 6px; margin-bottom: 8px; }
.genre-tag { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-accent); font-size: 0.72rem; font-weight: 600; padding: 2px 10px; border-radius: 50px; letter-spacing: 0.5px; }
.slide-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 900; color: #fff; margin-bottom: 6px; line-height: 1.2; }
.slide-desc { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 500px; }
.slide-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.slide-meta span { font-size: 0.8rem; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 4px; }
.slide-meta .stars { color: var(--accent); }
.btn-read-now { background: var(--accent); color: #000; border: none; border-radius: 50px; padding: 10px 28px; font-weight: 700; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 8px; }
.btn-read-now:hover { background: var(--accent-hover); transform: translateY(-2px); color:#000; }
.btn-detail { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 50px; padding: 10px 24px; font-weight: 500; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: var(--transition); margin-left: 10px; display:inline-block; }
.btn-detail:hover { background: rgba(255,255,255,0.2); color:#fff; }
.slider-dots { position: absolute; bottom: 16px; right: 60px; display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; cursor: pointer; transition: var(--transition); }
.dot.active { width: 24px; background: var(--accent); }
.slider-arrows { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); display: flex; justify-content: space-between; padding: 0 20px; pointer-events: none; }
.arrow-btn { width: 44px; height: 44px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; pointer-events: all; transition: var(--transition); }
.arrow-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 32px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 22px; background: var(--accent); border-radius: 2px; }
.section-icon { color: var(--accent); font-size: 1.1rem; }
.view-all { font-size: 0.8rem; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 4px; transition: var(--transition); }
.view-all:hover { gap: 8px; color: var(--accent); }

/* Story Card */
.story-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); position: relative; }
.story-card:hover { transform: translateY(-4px); border-color: var(--border-accent); box-shadow: 0 8px 32px rgba(245,158,11,0.12); }
.card-cover-wrap { position: relative; overflow: hidden; aspect-ratio: 2/3; display: block; }
.card-cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.story-card:hover .card-cover { transform: scale(1.05); }
.card-badge { position: absolute; top: 8px; left: 8px; font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 50px; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-full { background: var(--green); color: #fff; }
.badge-ongoing { background: var(--blue); color: #fff; }
.badge-hot { background: var(--red); color: #fff; }
.badge-new { background: var(--purple); color: #fff; }
.card-rating { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7); color: var(--accent); font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 50px; display: flex; align-items: center; gap: 3px; backdrop-filter: blur(4px); }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,0.8)); opacity: 0; transition: var(--transition); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px; }
.story-card:hover .card-overlay { opacity: 1; }
.btn-quick-read { background: var(--accent); color: #000; border: none; border-radius: 50px; padding: 7px 18px; font-size: 0.78rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: var(--transition); }
.card-body { padding: 12px; }
.card-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--transition); display: block; }
.story-card:hover .card-title { color: var(--accent); }
.card-author { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--text-secondary); }
.card-chapters { display: flex; align-items: center; gap: 3px; }
.card-genre-tag { background: var(--accent-dim); color: var(--accent); padding: 2px 8px; border-radius: 50px; font-size: 0.68rem; font-weight: 600; }

/* Horizontal scroll */
.scroll-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .story-card { min-width: 140px; flex: 0 0 140px; }

/* New updates list */
.update-list { display: flex; flex-direction: column; gap: 8px; }
.update-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; align-items: center; gap: 12px; transition: var(--transition); }
.update-item:hover { border-color: var(--border-accent); background: var(--bg-card-hover); }
.update-thumb { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.update-info { flex: 1; min-width: 0; }
.update-title { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.update-item:hover .update-title { color: var(--accent); }
.update-chapter { font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-meta { font-size: 0.72rem; color: var(--text-muted); display: flex; gap: 10px; align-items:center; }
.update-time { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }

/* Rankings */
.rank-list { display: flex; flex-direction: column; gap: 0; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); transition: var(--transition); }
.rank-item:last-child { border-bottom: none; }
.rank-item:hover .rank-title { color: var(--accent); }
.rank-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 900; flex-shrink: 0; }
.rank-num.top-1 { background: #fbbf24; color: #000; }
.rank-num.top-2 { background: #9ca3af; color: #000; }
.rank-num.top-3 { background: #cd7c2f; color: #fff; }
.rank-num.other { background: var(--bg-secondary); color: var(--text-muted); font-size: 0.75rem; }
.rank-thumb { width: 40px; height: 54px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.rank-info { flex: 1; min-width: 0; }
.rank-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.rank-views { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* Sidebar */
.sidebar { position: sticky; top: 80px; }
.sidebar-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.widget-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.widget-title i { color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.75rem; padding: 4px 12px; border-radius: 50px; transition: var(--transition); }
.tag-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.author-list { display: flex; flex-direction: column; gap: 10px; }
.author-item { display: flex; align-items: center; gap: 10px; }
.author-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.author-name { font-size: 0.82rem; font-weight: 600; }
.author-count { font-size: 0.72rem; color: var(--text-muted); }

/* Genre section */
.genre-section { margin-bottom: 40px; }
.genre-selector { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.genre-btn { padding: 6px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: var(--transition); font-family: inherit; }
.genre-btn.active, .genre-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

/* Grid */
.stories-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.stories-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stories-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Promo banner */
.promo-banner { background: linear-gradient(135deg, #1a1d27, #252840); border: 1px solid var(--border-accent); border-radius: var(--radius); padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; position: relative; overflow: hidden; }
.promo-banner::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.promo-text h3 { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.promo-text p { font-size: 0.85rem; color: var(--text-secondary); }
.btn-vip { background: linear-gradient(135deg, var(--accent), #f97316); color: #000; border: none; border-radius: 50px; padding: 10px 28px; font-weight: 700; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.btn-vip:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(245,158,11,0.3); }

/* Footer */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-main { padding: 48px 0 32px; }
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 900; color: var(--accent); margin-bottom: 12px; }
.footer-desc { font-size: 0.85rem; color: var(--text-secondary); max-width: 280px; line-height: 1.7; margin-bottom: 16px; }
.social-links { display: flex; gap: 10px; }
.social-btn { width: 36px; height: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.85rem; transition: var(--transition); }
.social-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.footer-heading { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; }
.footer-links li a { font-size: 0.82rem; color: var(--text-secondary); transition: var(--transition); }
.footer-links li a:hover { color: var(--accent); padding-left: 4px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; gap: 8px; }

/* Mobile nav */
.mobile-nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; cursor: pointer; }

/* Pulse */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.live-dot { width: 6px; height: 6px; background: var(--red); border-radius: 50%; display: inline-block; animation: pulse 1.5s infinite; }

/* Scroll top */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; background: var(--accent); border: none; border-radius: 50%; display: none; align-items: center; justify-content: center; color: #000; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 16px rgba(245,158,11,0.4); transition: var(--transition); z-index: 999; }
.scroll-top.show { display: flex; }
.scroll-top:hover { transform: translateY(-3px); background: var(--accent-hover); }

/* Ads */
.ad-banner { background: var(--bg-card); border: 1px dashed var(--text-muted); border-radius: var(--radius); min-height: 80px; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 20px; overflow:hidden; }

/* Pagination */
.tt-pagination { margin-top: 28px; }
.tt-pagination .nav-links { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tt-pagination .page-numbers { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; transition: var(--transition); }
.tt-pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #000; }
.tt-pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   CHI TIẾT TRUYỆN
   ============================================================ */
.breadcrumb-bar { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 10px 0; }
.breadcrumb-bar .breadcrumb { margin: 0; font-size: 0.8rem; }
.breadcrumb-item a { color: var(--text-secondary); transition: var(--transition); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

.story-hero { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 40px 0; position: relative; overflow: hidden; }
.story-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(245,158,11,0.06) 0%, transparent 60%); pointer-events: none; }
.cover-wrap { position: relative; display: inline-block; }
.cover-img { width: 200px; height: 280px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.08); display: block; }
.cover-badge { position: absolute; top: 10px; left: 10px; background: var(--green); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 4px 12px; border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px; }
.story-title { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; line-height: 1.2; margin-bottom: 8px; }
.story-author { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.story-author a { color: var(--accent); font-weight: 600; }
.story-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.story-tags .genre-tag { transition: var(--transition); }
.story-tags .genre-tag:hover { background: var(--accent); color: #000; }
.story-stats { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-item { text-align: center; }
.stat-value { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); display: block; line-height: 1.2; }
.stat-value.accent { color: var(--accent); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.stat-divider { width: 1px; background: var(--border); align-self: stretch; }
.rating-display { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.stars-visual { color: var(--accent); font-size: 1.1rem; letter-spacing: 2px; }
.rating-score { font-size: 1.4rem; font-weight: 900; color: var(--accent); }
.rating-count { font-size: 0.8rem; color: var(--text-muted); }

.action-group { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-read-first { background: var(--accent); color: #000; border: none; border-radius: 50px; padding: 12px 28px; font-weight: 700; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.btn-read-first:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(245,158,11,0.3); color:#000; }
.btn-continue { background: var(--bg-card); color: var(--text-primary); border: 1.5px solid var(--border); border-radius: 50px; padding: 12px 24px; font-weight: 600; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.btn-continue:hover { border-color: var(--accent); color: var(--accent); }
.btn-follow { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); border-radius: 50px; padding: 12px 20px; font-weight: 600; font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 6px; }
.btn-follow:hover, .btn-follow.active { border-color: var(--red); color: var(--red); }
.btn-follow.active { background: rgba(239,68,68,0.08); }
.btn-share { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); border-radius: 50px; padding: 12px 16px; cursor: pointer; transition: var(--transition); }
.btn-share:hover { border-color: var(--blue); color: var(--blue); }

.content-section { padding: 40px 0; }
.desc-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.desc-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.desc-box h3::before { content: ''; display: inline-block; width: 3px; height: 18px; background: var(--accent); border-radius: 2px; }
.desc-text { font-size: 0.9rem; line-height: 1.85; color: var(--text-secondary); overflow: hidden; transition: max-height 0.4s ease; max-height: 80px; }
.desc-text.expanded { max-height: 2000px; }
.btn-expand { margin-top: 10px; color: var(--accent); font-size: 0.82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; background: none; border: none; padding: 0; font-family: inherit; transition: var(--transition); }
.btn-expand:hover { color: var(--accent-hover); }

.info-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.info-row:nth-child(odd) { padding-right: 20px; }
.info-row:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--border); }
.info-label { color: var(--text-muted); min-width: 80px; }
.info-value { font-weight: 600; color: var(--text-primary); }
.info-value a { color: var(--accent); }
.info-value.green { color: var(--green); }

/* Chapter list */
.chapter-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.chapter-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chapter-header h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chapter-header h3 i { color: var(--accent); }
.chapter-controls { display: flex; gap: 8px; }
.ch-ctrl-btn { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 12px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: var(--transition); }
.ch-ctrl-btn.active, .ch-ctrl-btn:hover { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }
.chapter-search { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.chapter-search input { flex: 1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 0.82rem; color: var(--text-primary); font-family: inherit; outline: none; transition: var(--transition); }
.chapter-search input:focus { border-color: var(--accent); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; max-height: 480px; overflow-y: auto; }
.chapter-grid::-webkit-scrollbar { width: 4px; }
.chapter-grid::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
.chapter-item { padding: 10px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); font-size: 0.82rem; display: block; }
.chapter-item:hover { background: var(--accent-dim); color: var(--accent); }
.chapter-item:nth-child(3n) { border-right: none; }
.chapter-num { font-weight: 700; display: block; }
.chapter-title { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display:block; }
.chapter-pagination { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.page-btns { display: flex; gap: 6px; }
.page-btn { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap:4px; justify-content: center; padding: 7px 14px; font-size: 0.8rem; cursor: pointer; transition: var(--transition); color: var(--text-secondary); font-family: inherit; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Comments */
.comments-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.comments-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.comments-header i { color: var(--accent); }
.comment-form-wrap { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.comment-input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-primary); font-size: 0.85rem; font-family: inherit; resize: vertical; min-height: 80px; outline: none; transition: var(--transition); }
.comment-input:focus { border-color: var(--accent); }
.btn-submit-comment { margin-top: 8px; background: var(--accent); color: #000; border: none; border-radius: 50px; padding: 8px 22px; font-size: 0.82rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: var(--transition); }
.btn-submit-comment:hover { background: var(--accent-hover); }
.comment-list { padding: 0 20px; margin: 0; list-style: none; }
.comment-list ol.children { list-style: none; padding-left: 44px; margin-top: 12px; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.comment-user-av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.comment-meta { flex: 1; }
.comment-username { font-size: 0.85rem; font-weight: 700; margin-bottom: 1px; }
.comment-time { font-size: 0.72rem; color: var(--text-muted); }
.comment-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; padding-left: 44px; margin-bottom: 8px; }
.comment-actions { display: flex; gap: 16px; padding-left: 44px; }
.comment-action-btn { font-size: 0.75rem; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: var(--transition); background: none; border: none; font-family: inherit; padding: 0; }
.comment-action-btn:hover { color: var(--accent); }
.comment-form .comment-form-comment { margin: 0; }
.comment-form p.form-submit { margin: 0; }
.comment-form .comment-reply-title { display: none; }

/* Author / rating / related widgets */
.author-profile { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.author-av-lg { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--red)); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.author-full-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.author-works { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.btn-follow-author { background: var(--accent-dim); border: 1px solid var(--border-accent); color: var(--accent); border-radius: 50px; padding: 5px 14px; font-size: 0.75rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: var(--transition); display:inline-block; }
.btn-follow-author:hover { background: var(--accent); color: #000; }
.rating-widget { text-align: center; }
.big-score { font-family: 'Playfair Display', serif; font-size: 3.5rem; font-weight: 900; color: var(--accent); line-height: 1; }
.big-stars { color: var(--accent); font-size: 1.3rem; letter-spacing: 3px; margin: 8px 0; }
.total-reviews { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 16px; }
.user-rating { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.user-rating p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 8px; }
.star-select { display: flex; gap: 4px; justify-content: center; }
.star-select i { font-size: 1.3rem; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.star-select i:hover, .star-select i.selected { color: var(--accent); }
.related-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); transition: var(--transition); }
.related-item:last-child { border-bottom: none; }
.related-item:hover .related-title { color: var(--accent); }
.related-thumb { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-info { flex: 1; min-width: 0; }
.related-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-meta { font-size: 0.72rem; color: var(--text-muted); }
.related-rating { font-size: 0.72rem; color: var(--accent); font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .stories-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .stories-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .stories-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-slider { height: 320px; }
  .slide-content { padding: 24px 24px; }
  .slide-title { font-size: 1.3rem; }
  .cover-img { width: 160px; height: 224px; }
  .story-title { font-size: 1.5rem; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .stories-grid-5, .stories-grid-6, .stories-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .header-top .search-wrapper { display: none; }
  .nav-list { display: none; flex-direction: column; gap: 0; padding-bottom: 8px; }
  .main-nav.open .nav-list { display: flex; }
  .main-nav.open .nav-dropdown .dropdown-menu-custom { position: static; width: 100%; }
  .mobile-nav-toggle { display: block; }
  .hero-slider { height: 260px; }
  .slide-cover { display: none; }
  .slide-content { padding: 20px; }
  .promo-banner { flex-direction: column; gap: 16px; text-align: center; }
  .cover-img { width: 120px; height: 168px; }
  .story-stats { gap: 12px; }
  .info-table { grid-template-columns: 1fr; }
  .info-row:nth-child(even) { padding-left: 0; border-left: none; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
}
