/* ==========================================================================
   PORTAL NOVELS ZONGHENG BRASIL - ESTILOS PRINCIPAIS
   Inspirado no visual nobre/dark de Zongheng (纵横中文网)
   Leve, sem frameworks, 100% responsivo e otimizado para SEO & Core Web Vitals
   ========================================================================== */

:root {
  --bg-deep: #0a0c12;
  --bg-card: #121622;
  --bg-card-hover: #171d2c;
  --bg-secondary: #1a2030;
  --bg-tertiary: #222a3d;
  
  --border-subtle: #242c40;
  --border-focus: #e5a93b;
  
  --text-main: #f0f3fa;
  --text-secondary: #9aa4bf;
  --text-muted: #677494;
  
  --accent-gold: #e5a93b;
  --accent-gold-hover: #ffc259;
  --accent-red: #d32f2f;
  --accent-red-hover: #f44336;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  
  --badge-xianxia: rgba(229, 169, 59, 0.15);
  --badge-wuxia: rgba(211, 47, 47, 0.15);
  --badge-xuanhuan: rgba(56, 189, 248, 0.15);
  --badge-system: rgba(16, 185, 129, 0.15);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 30px rgba(229, 169, 59, 0.15);
  
  --font-serif: 'Noto Serif', serif, Georgia;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cinzel', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-gold);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   TOP BAR & HEADER
   ========================================================================== */

.topbar {
  background: #07080d;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar a:hover {
  color: var(--accent-gold);
}

.zh-main-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 24px;
}

/* Logo Zongheng */
.zh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zh-brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1c2333, #0f131d);
  color: var(--accent-gold);
  font-size: 19px;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 4px 15px rgba(229, 169, 59, 0.25);
  transition: all 0.2s ease;
}

.zh-brand:hover .zh-brand-icon {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 169, 59, 0.4);
}

.zh-text-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.zh-text-title span {
  font-size: 11px;
  color: var(--accent-gold);
  letter-spacing: 3px;
  font-weight: 600;
  font-family: var(--font-sans);
}

/* Search Bar SEO */
.zh-search-form {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(229, 169, 59, 0.2);
}

.search-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.search-input-wrap button {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-input-wrap button:hover {
  background: var(--accent-red-hover);
}

.quick-search-tags {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.quick-search-tags a {
  color: var(--text-secondary);
}

.quick-search-tags a:hover {
  color: var(--accent-gold);
}

/* User Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-library {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Primary Nav */
.zh-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-item a {
  display: block;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item a:hover,
.nav-item.active a {
  color: #ffffff;
  background: rgba(229, 169, 59, 0.1);
}

.nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gold);
}

/* ==========================================================================
   HERO / PORTAL SPOTLIGHT (ESTILO ZONGHENG)
   ========================================================================== */

.hero-section {
  padding: 28px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 220px 1fr 320px;
  gap: 20px;
}

/* Coluna 1: Categorias & Cultivo */
.category-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.genre-list {
  list-style: none;
}

.genre-item {
  margin-bottom: 6px;
}

.genre-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s ease;
}

.genre-item a:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
  transform: translateX(4px);
}

.genre-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Coluna 2: Destaque Principal do Editor */
.hero-spotlight {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spotlight-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(229, 169, 59, 0.04) 0%, rgba(18, 22, 34, 1) 100%);
}

.spotlight-cover-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  aspect-ratio: 3 / 4;
}

.spotlight-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-rank-editor {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spotlight-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spotlight-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tag-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.tag-xianxia {
  background: var(--badge-xianxia);
  color: var(--accent-gold);
  border-color: rgba(229, 169, 59, 0.3);
}

.tag-status {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.spotlight-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 8px;
}

.spotlight-author {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.spotlight-author a {
  color: var(--accent-gold);
  font-weight: 600;
}

.spotlight-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.stat-box {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

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

.spotlight-actions {
  display: flex;
  gap: 12px;
}

.btn-read-now {
  background: linear-gradient(135deg, var(--accent-gold), #b87b1e);
  color: #0b0d13;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(229, 169, 59, 0.3);
  transition: all 0.2s ease;
}

.btn-read-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 169, 59, 0.4);
  color: #000;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s ease;
}

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

/* Coluna 3: Tábua de Mestres (Ranking Zongheng) */
.ranking-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.ranking-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-tabs {
  display: flex;
  gap: 4px;
}

.rank-tab-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.rank-tab-btn.active, .rank-tab-btn:hover {
  color: var(--accent-gold);
  font-weight: 700;
}

.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 12px;
}

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

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

.rank-1 .rank-num {
  background: #d32f2f;
  color: #fff;
  box-shadow: 0 0 8px rgba(211, 47, 47, 0.5);
}

.rank-2 .rank-num {
  background: var(--accent-gold);
  color: #0b0d13;
}

.rank-3 .rank-num {
  background: #78909c;
  color: #fff;
}

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

.rank-novel-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.rank-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

/* ==========================================================================
   FEED DE CAPÍTULOS RECENTES EM TEMPO REAL (REAL-TIME CHAPTER FEED)
   ========================================================================== */

.section-block {
  padding: 28px 0;
}

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

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(229, 169, 59, 0.15);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-display);
}

.view-all-link {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all-link:hover {
  color: var(--accent-gold);
}

/* Tabela de Lançamentos */
.releases-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.releases-table {
  width: 100%;
  border-collapse: collapse;
}

.releases-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.releases-table td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.releases-table tr:hover td {
  background: rgba(229, 169, 59, 0.03);
}

.col-genre {
  width: 120px;
}

.col-novel {
  font-weight: 700;
  color: var(--text-main);
}

.col-chapter a {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.badge-new {
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.col-translator {
  color: var(--text-muted);
  font-size: 13px;
}

.col-time {
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

/* ==========================================================================
   VITRINE DE OBRAS POR GÊNERO (CARDS GRID)
   ========================================================================== */

.novel-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.novel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.novel-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-hover);
}

.card-cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-genre-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 19, 0.85);
  backdrop-filter: blur(4px);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 169, 59, 0.3);
}

.card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-synopsis {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-footer-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   ESTATÍSTICAS & BANNER DA COMUNIDADE
   ========================================================================== */

.stats-banner {
  background: linear-gradient(135deg, #171d2c 0%, #10141f 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
  margin: 32px 0;
}

.stat-metric-box h3 {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-gold);
  font-family: var(--font-display);
  margin-bottom: 4px;
}

.stat-metric-box p {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   FOOTER SEMÂNTICO COM TOTAL SEO
   ========================================================================== */

.zh-footer {
  background: #06070a;
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 24px 0;
  margin-top: 48px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 12px;
  max-width: 360px;
}

.footer-col h4 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 13.5px;
  color: var(--text-muted);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 300px;
  }
  .category-sidebar {
    display: none;
  }
  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .spotlight-main {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .spotlight-cover-wrap {
    max-width: 200px;
    margin: 0 auto;
  }
  .spotlight-stats {
    justify-content: center;
  }
  .spotlight-actions {
    justify-content: center;
  }
  .releases-table .col-translator,
  .releases-table .col-time {
    display: none;
  }
  .stats-banner {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
