/* ── NovelNest shared styles ── */
:root {
  --bg: #0e0d0b;
  --surface: #1a1814;
  --surface-2: #252219;
  --text: #e6dfd5;
  --text-muted: #7c736a;
  --accent: #c9a055;
  --accent-dim: rgba(201,160,85,0.15);
  --border: rgba(255,255,255,0.07);
  --radius: 8px;
  --max: 1200px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(14,13,11,0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.logo span { color: var(--text); }

/* ── Search ── */
.search-wrap { flex: 1; max-width: 400px; }
.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-muted); }

/* ── Filters ── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 28px 0 24px;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Novel Grid (Homepage) ── */
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}
.novel-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.novel-card:hover { transform: translateY(-3px); border-color: rgba(201,160,85,0.3); }

/* Cover art */
.cover {
  aspect-ratio: 2/3;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-initial {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.4;
  font-family: Georgia, serif;
}
.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.status-badge.completed { background: rgba(100,200,120,0.2); color: #6dc87e; }
.status-badge.ongoing { background: rgba(201,160,85,0.2); color: var(--accent); }

.card-info { padding: 12px; }
.novel-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; line-height: 1.3; }
.novel-author { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.genre-tag {
  font-size: 11px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text-muted);
}

/* ── Novel Detail Page ── */
.novel-hero {
  display: flex;
  gap: 32px;
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}
.novel-cover-large {
  width: 180px;
  min-width: 180px;
  aspect-ratio: 2/3;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.novel-cover-large .cover-initial { font-size: 64px; }
.novel-meta h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.novel-meta .author { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }
.novel-meta .genre-tag { margin-bottom: 16px; display: inline-block; }
.novel-desc { font-size: 14px; line-height: 1.75; color: var(--text-muted); max-width: 600px; }

.chapter-list { padding: 32px 0 60px; }
.chapter-list h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.chapter-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--surface);
  transition: all 0.15s;
}
.chapter-item:hover { border-color: var(--accent); background: var(--surface-2); }
.chapter-num { font-size: 12px; color: var(--text-muted); min-width: 80px; }
.chapter-title { font-size: 14px; flex: 1; }
.chapter-arrow { color: var(--text-muted); font-size: 16px; }

/* ── Reader Page ── */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.reader-toolbar a { font-size: 13px; color: var(--text-muted); transition: color 0.15s; }
.reader-toolbar a:hover { color: var(--text); }
.reader-toolbar .sep { color: var(--border); }
.reader-toolbar .chapter-name { font-size: 13px; flex: 1; }

.reader-settings {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.size-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.size-btn:hover { border-color: var(--accent); color: var(--text); }

.reader-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.reader-body h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.chapter-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.chapter-content {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.85;
  color: #d8d1c8;
}
.chapter-content p { margin-bottom: 1.4em; }

.reader-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.nav-btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-btn:hover { border-color: var(--accent); color: var(--text); }
.nav-btn:disabled, .nav-btn.disabled { opacity: 0.3; pointer-events: none; }

/* ── States ── */
.loading, .empty, .error {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1/-1;
}
.error { color: #e07070; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

@media (max-width: 600px) {
  .novel-hero { flex-direction: column; }
  .novel-cover-large { width: 140px; }
}
