/* Modern Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Lucide Icon helper */
.lucide {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Container */
.container {
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.reader-container {
  width: 100%;
  max-width: var(--reader-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.header-brand .lucide {
  color: var(--accent-color);
}

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

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-muted);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
  display: none;
}

.icon-btn .badge-dot.is-visible {
  display: block;
}

/* Reading Progress Bar */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  transition: width 0.1s ease-out;
}

/* Continue Reading Banner */
.continue-reading-card {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0 20px 0;
  box-shadow: var(--shadow-sm);
}

.continue-reading-card.is-visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.continue-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.continue-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-btn {
  background: var(--accent-color);
  color: #ffffff !important;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

/* Category Filter Bar */
.category-filter-bar {
  padding: 12px 0 16px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-filter-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  white-space: nowrap;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.category-pill .pill-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Search Bar (Mobile & Desktop) */
.story-search-form {
  margin-bottom: 16px;
  position: relative;
}

.story-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.story-search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.story-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Stories Grid & Cards (Homepage & Archives) */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.story-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color var(--transition);
}

.story-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.story-badge-icon {
  width: 48px;
  height: 64px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  color: var(--accent-color);
}

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

.story-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.story-category {
  color: var(--accent-color);
  font-weight: 600;
}

.story-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.story-title a {
  color: inherit;
}

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

.story-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.story-read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Numbered Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 24px 0 40px 0;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.page-numbers.current {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.page-numbers:hover:not(.current) {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.page-numbers.dots {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

/* ============================================================
   SINGLE STORY / NOVEL READER VIEW
   ============================================================ */
.reader-article {
  padding: 24px 0 80px 0;
}

.reader-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.reader-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.reader-story-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.reader-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.reader-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Reader Body Typography */
.reader-body {
  font-family: var(--reader-font-family);
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  text-align: var(--reader-text-align);
  color: var(--text-primary);
  word-break: break-word;
}

.reader-body p {
  margin-bottom: 1.4em;
  letter-spacing: -0.003em;
}

.reader-body h2, .reader-body h3, .reader-body h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  line-height: 1.3;
}

.reader-body blockquote {
  border-left: 3px solid var(--accent-color);
  padding-left: 16px;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.reader-body hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2em 0;
}

/* Floating Bottom Reader Navigation (Mobile-First) */
.reader-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--bottom-bar-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 99;
  box-shadow: 0 -2px 10px rgba(45, 38, 30, 0.08);
  transition: transform 0.25s ease, background-color var(--transition);
}

.reader-bottom-nav.is-hidden {
  transform: translateY(100%);
}

.bottom-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.bottom-nav-btn:hover, .bottom-nav-btn.active {
  color: var(--accent-color);
}

.bottom-nav-btn.is-bookmarked {
  color: var(--accent-color);
}

.bottom-nav-btn.is-bookmarked .lucide {
  fill: currentColor;
}

/* Chapter / Story End Navigation */
.story-chapter-nav {
  margin: 40px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chapter-nav-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.chapter-nav-card:hover {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
}

.nav-direction {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-target-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Settings Drawer (Popup) */
.reader-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.reader-drawer-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.reader-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 80vh;
  background: var(--bg-surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-top: 1px solid var(--border-color);
  z-index: 1002;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.reader-drawer.is-active {
  transform: translateY(0);
}

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

.drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-group {
  margin-bottom: 18px;
}

.drawer-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

/* Theme Options in Drawer */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.theme-opt-btn {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--opt-bg, #fff);
  color: var(--opt-color, #000);
  transition: var(--transition);
}

.theme-opt-btn.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* Font Size Control */
.font-size-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.size-btn {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-weight: 700;
  cursor: pointer;
}

.size-display {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

/* Line Height Selector */
.option-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.opt-pill-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.opt-pill-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

/* ============================================================
   MOBILE-FIRST NOVEL BOOKMARKS PAGE & CARDS (Vertical Buttons & Title First)
   ============================================================ */
.bookmarks-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  gap: 12px;
}

.bookmarks-page-title {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.bookmarks-page-title .lucide {
  color: var(--accent-color);
}

.clear-all-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.clear-all-btn:hover {
  background: #fde8e8;
  color: #c81e1e;
  border-color: #f8b4b4;
}

.bookmarks-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

/* Bookmark Card: Title on top, Category & Date below, Vertical Buttons */
.bookmark-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color var(--transition);
}

.bookmark-card:hover {
  border-color: var(--text-muted);
}

.bookmark-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
}

.bookmark-card-title a {
  color: inherit;
}

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

.bookmark-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bookmark-category {
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.bookmark-saved-date {
  color: var(--text-muted);
}

.bookmark-card-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.bookmark-btn-read-full {
  width: 100%;
  background: var(--accent-color);
  color: #ffffff !important;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: background-color var(--transition);
}

.bookmark-btn-read-full:hover {
  background: var(--accent-hover);
}

.bookmark-btn-remove-full {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.bookmark-btn-remove-full:hover {
  background: #fde8e8;
  color: #c81e1e;
  border-color: #f8b4b4;
}

.bookmarks-empty {
  text-align: center;
  padding: 50px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.bookmarks-empty-icon {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin: 0 auto 14px auto;
}

/* Toast Notifications */
.novel-toast {
  position: fixed;
  bottom: calc(var(--bottom-bar-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1005;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
}

.novel-toast.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toast-action {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
}

/* Zen Mode */
body.zen-mode .site-header,
body.zen-mode .site-footer,
body.zen-mode .reader-header,
body.zen-mode .story-chapter-nav,
body.zen-mode .reader-bottom-nav {
  display: none !important;
}

body.zen-mode .reader-article {
  padding-top: 40px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Desktop */
@media (min-width: 640px) {
  .stories-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .reader-story-title {
    font-size: 2.1rem;
  }
  
  .reader-drawer {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: var(--radius-lg);
    bottom: 20px;
  }
  
  .reader-drawer.is-active {
    transform: translateX(-50%) translateY(0);
  }
}


/* Archive Header Banner */
.archive-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 12px 0 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.archive-header-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  flex-shrink: 0;
}

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

.archive-header-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.archive-header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.archive-count-badge {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.archive-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}


/* SEO, AEO & FAQ Section */
.seo-content-section {
  margin: 30px 0 40px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.seo-about-card, .seo-faq-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.seo-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.seo-section-title .lucide {
  color: var(--accent-color);
}

.seo-about-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item[open] {
  border-color: var(--accent-color);
}

.faq-question {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent-color);
  transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 14px 12px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* Story Tags (Homepage / Archive Cards) */
.story-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.story-tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.story-tag-pill:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--bg-surface);
}

/* Reader Single Post Tags */
.reader-tags-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 0;
  margin: 20px 0 30px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.reader-tags-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.reader-tag-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.reader-tag-pill:hover {
  background: var(--accent-color);
  color: #fff !important;
  border-color: var(--accent-color);
}

/* ============================================================
   REDESIGNED COMMENTS SECTION
   ============================================================ */
.comments-area {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding-top: 28px;
}

.comments-header {
  margin-bottom: 20px;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-title .lucide {
  color: var(--accent-color);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.novel-comment-item {
  list-style: none;
}

.novel-comment-item .children {
  list-style: none;
  padding-left: 18px;
  margin-top: 12px;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.novel-comment-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.novel-comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.novel-comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.novel-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initial {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-color);
}

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

.novel-comment-author-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.novel-comment-author-name a {
  color: inherit;
}

.novel-comment-author-name a:hover {
  color: var(--accent-color);
}

.novel-comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.novel-comment-body {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.55;
  word-break: break-word;
}

.novel-comment-body p {
  margin-bottom: 0.5em;
}

.novel-comment-body p:last-child {
  margin-bottom: 0;
}

.novel-comment-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.novel-comment-actions a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  transition: var(--transition);
}

.novel-comment-actions a:hover {
  background: var(--accent-light);
}

.no-comments-box {
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Comment Form Styling */
.comment-respond {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.comment-reply-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-reply-title small a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.comment-reply-title small a:hover {
  color: #c81e1e;
  border-color: #f8b4b4;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-form-row {
  display: flex;
  gap: 12px;
}

@media (max-width: 600px) {
  .comment-form-row {
    flex-direction: column;
    gap: 14px;
  }
}

.comment-form-col, .comment-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.comment-form label .required {
  color: var(--accent-color);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.submit-comment-btn {
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--transition);
  align-self: flex-start;
}

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