/* Journey to the West - Novel Reading Theme */
:root {
  --bg-color: #faf8f5;
  --text-color: #2c2c2c;
  --header-bg: #1a1a2e;
  --header-text: #faf8f5;
  --accent: #8b4513;
  --link: #8b4513;
  --link-hover: #a0522d;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Helvetica Neue', Arial, sans-serif;
  --max-width: 960px;
  --line-height: 1.85;
  --font-size: 18px;
}

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

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

.site-header {
  background: var(--header-bg);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 2rem;
}

.site-header nav a {
  color: var(--header-text);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.site-header nav a:hover { text-decoration: underline; }

.novel-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Chapter list / TOC */
.chapter-list h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--header-bg);
}

.chapter-list .subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 3rem;
  font-style: italic;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.toc-item {
  background: white;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.toc-item:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.toc-item a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc-item a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Single chapter */
.chapter-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
}

.chapter-num {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chapter-header h1 {
  font-size: 2rem;
  margin-top: 0.5rem;
  line-height: 1.3;
  color: var(--header-bg);
}

.chapter-content {
  text-align: justify;
  hyphens: auto;
}

.chapter-content p {
  margin-bottom: 1.5em;
  text-indent: 2em;
}

.chapter-content p:first-of-type {
  text-indent: 0;
}

/* Chapter navigation */
.chapter-nav {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-sans);
}

.nav-prev, .nav-next {
  color: var(--link);
  text-decoration: none;
  font-size: 0.95rem;
  max-width: 45%;
}

.nav-prev:hover, .nav-next:hover {
  text-decoration: underline;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 101;
  transition: width 0.1s;
}

/* Site footer */
.site-footer {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: #888;
  border-top: 1px solid #ddd;
  margin-top: 4rem;
}

@media (max-width: 600px) {
  :root { --font-size: 16px; }
  .toc { grid-template-columns: 1fr; }
  .chapter-header h1 { font-size: 1.5rem; }
}
