/* ============================================
   NOVEL DETAIL PAGE - Premium Redesign
   Inspired by Qidian / Fanqie / Zongheng
   ============================================ */

/* ── Novel Detail Hero ── */
.novel-hero {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  overflow: hidden;
  padding: 0;
}

.novel-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,.1) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.novel-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg-0) 0%, transparent 100%);
}

.novel-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 40px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 50px var(--gap) 80px;
}

/* ── Novel Cover ── */
.novel-cover-wrap {
  flex-shrink: 0;
  width: 220px;
  position: relative;
}

.novel-cover-wrap img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: 
    0 20px 60px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.1);
  transition: transform var(--t-normal) var(--ease);
}

.novel-cover-wrap:hover img {
  transform: scale(1.02);
}

.novel-cover-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--r-full);
  box-shadow: 0 4px 12px rgba(239,68,68,.4);
  letter-spacing: .5px;
}

.novel-cover-status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  text-align: center;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: var(--r-sm);
}

/* ── Novel Info ── */
.novel-info {
  flex: 1;
  min-width: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.novel-info .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  opacity: .6;
}

.novel-info .breadcrumb a {
  color: rgba(255,255,255,.7);
  transition: color var(--t-fast);
}

.novel-info .breadcrumb a:hover {
  color: #fff;
}

.novel-info .breadcrumb span.sep {
  opacity: .4;
}

.novel-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.novel-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.novel-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  opacity: .85;
}

.novel-meta-item .icon {
  font-size: 16px;
}

.novel-meta-item a {
  color: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(255,255,255,.3);
  transition: all var(--t-fast);
}

.novel-meta-item a:hover {
  color: #fff;
  border-color: #fff;
}

/* ── Stats Grid ── */
.novel-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
  transition: all var(--t-normal) var(--ease);
}

.stat-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-2px);
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Tags ── */
.novel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.novel-tags .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.1);
  transition: all var(--t-fast);
}

.novel-tags .tag:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.novel-tags .tag-primary {
  background: rgba(99,102,241,.3);
  border-color: rgba(99,102,241,.4);
  color: #a5b4fc;
}

/* ── Description ── */
.novel-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,.7);
  margin-bottom: 24px;
  max-width: 600px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all var(--t-normal);
}

.novel-desc.expanded {
  -webkit-line-clamp: unset;
}

.novel-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  margin-bottom: 24px;
  transition: color var(--t-fast);
}

.novel-desc-toggle:hover {
  color: #fff;
}

/* ── Action Buttons ── */
.novel-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.novel-actions .btn {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r-full);
  transition: all var(--t-normal) var(--ease);
}

.novel-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,.4);
}

.novel-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,.5);
}

.novel-actions .btn-ghost {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}

.novel-actions .btn-ghost:hover {
  background: rgba(255,255,255,.2);
}

.novel-actions .btn-outline {
  background: transparent;
  color: rgba(255,255,255,.8);
  border: 1.5px solid rgba(255,255,255,.3);
}

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

/* ── Content Section ── */
.novel-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap) 60px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}

/* ── Chapter List ── */
.chapter-section {
  background: var(--bg-1);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.chapter-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-header h3 .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-4);
  background: var(--bg-3);
  padding: 2px 10px;
  border-radius: var(--r-full);
}

.chapter-sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-1);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--t-fast);
}

.chapter-sort-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-50);
}

/* ── Volume Tabs ── */
.volume-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.volume-tabs::-webkit-scrollbar {
  display: none;
}

.volume-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.volume-tab:hover {
  color: var(--text-1);
  background: var(--bg-3);
}

.volume-tab.active {
  color: var(--primary);
  background: var(--primary-50);
  border-color: var(--primary-200);
  font-weight: 600;
}

/* ── Chapter Grid ── */
.chapter-grid {
  padding: 16px 24px;
  display: none;
}

.chapter-grid.active {
  display: block;
}

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

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  text-decoration: none;
  color: var(--text-2);
  font-size: 14px;
}

.chapter-item:hover {
  background: var(--bg-2);
  color: var(--primary);
}

.chapter-item .ch-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-item .ch-wc {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-4);
  margin-left: 12px;
}

/* ── Sidebar ── */
.novel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-1);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.sidebar-card-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card-body {
  padding: 16px 18px;
}

/* ── Author Card ── */
.author-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 2px;
}

.author-label {
  font-size: 12px;
  color: var(--text-4);
}

/* ── Related Novels ── */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}

.related-item:hover {
  background: var(--bg-2);
}

.related-cover {
  width: 60px;
  height: 80px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-3);
}

.related-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

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

/* ── Reading Progress ── */
.reading-progress {
  padding: 16px 18px;
}

.progress-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease);
}

.progress-text {
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
}

/* ── Bottom Related Section ── */
.related-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap) 60px;
}

.related-section .section-head {
  margin-bottom: 20px;
}

.related-section .section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .novel-content {
    grid-template-columns: 1fr;
  }
  
  .novel-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .novel-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px var(--gap) 60px;
    gap: 24px;
  }
  
  .novel-cover-wrap {
    width: 180px;
  }
  
  .novel-info {
    align-items: center;
  }
  
  .novel-meta-row {
    justify-content: center;
  }
  
  .novel-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .novel-tags {
    justify-content: center;
  }
  
  .novel-desc {
    text-align: center;
    max-width: 100%;
  }
  
  .novel-actions {
    justify-content: center;
  }
  
  .novel-title {
    font-size: 24px;
  }
  
  .chapter-list {
    grid-template-columns: 1fr;
  }
  
  .novel-sidebar {
    grid-template-columns: 1fr;
  }
  
  .volume-tabs {
    padding: 10px 16px;
  }
  
  .chapter-grid {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .novel-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .stat-card {
    padding: 10px 12px;
  }
  
  .stat-card .stat-value {
    font-size: 18px;
  }
  
  .novel-actions .btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}
