:root {
  --bg: #101417;
  --paper: #f4efe6;
  --paper-soft: #fbf7ef;
  --ink: #182126;
  --muted: #65706d;
  --line: rgba(24, 33, 38, 0.14);
  --mist: #dce8e4;
  --jade: #557a73;
  --blue: #1f3944;
  --gold: #b89156;
  --red: #8c3f32;
  --shadow: 0 28px 90px rgba(8, 15, 18, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(184, 145, 86, 0.24), transparent 28%),
    linear-gradient(180deg, #101417 0%, #1c2b31 42%, #e8ded0 100%);
  background-size: 42px 42px, 42px 42px, auto, auto;
  min-height: 100vh;
}

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

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

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.topbar,
.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #f8f2e8;
  padding: 12px 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 242, 232, 0.42);
  background: linear-gradient(135deg, rgba(85, 122, 115, 0.94), rgba(24, 33, 38, 0.94));
  color: #fffaf0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 700;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  border-color: var(--gold);
}

.novel-hero {
  min-height: min(760px, calc(100vh - 90px));
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border: 1px solid rgba(244, 239, 230, 0.22);
  background:
    linear-gradient(90deg, rgba(16, 20, 23, 0.78), rgba(16, 20, 23, 0.2)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    url("/assets/novels/yuan-cover.svg") center / cover no-repeat;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.novel-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 190px;
  background: linear-gradient(180deg, transparent, rgba(16, 20, 23, 0.88));
  pointer-events: none;
}

.book-cover-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.book-cover-link {
  width: min(330px, 82vw);
  aspect-ratio: 9 / 13;
  display: block;
  transform: rotate(-2deg);
  transition: transform 180ms ease, filter 180ms ease;
}

.book-cover-link:hover {
  transform: rotate(0deg) translateY(-4px);
  filter: brightness(1.04);
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 10px solid rgba(250, 246, 238, 0.86);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.novel-intro {
  position: relative;
  z-index: 1;
  color: #fff7eb;
  padding: 24px;
  max-width: 650px;
  background: rgba(11, 17, 20, 0.46);
  border-left: 4px solid var(--gold);
  backdrop-filter: blur(10px);
}

.eyebrow,
.kicker,
.card-meta {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.novel-intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.88;
}

.tagline {
  margin: 20px 0 0;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: #f5e0c0;
  font-weight: 800;
}

.intro-copy {
  max-width: 58ch;
  margin: 18px 0 0;
  color: rgba(255, 247, 235, 0.86);
  line-height: 1.9;
}

.novel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.novel-meta span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 247, 235, 0.24);
  background: rgba(255, 247, 235, 0.1);
  font-weight: 700;
}

.hero-actions,
.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(24, 33, 38, 0.78);
  font-weight: 900;
}

.button.primary {
  background: var(--red);
  color: #fff8ee;
}

.button.secondary {
  background: rgba(255, 250, 242, 0.9);
  color: var(--ink);
}

.button.small {
  min-height: 38px;
  padding-inline: 14px;
}

.chapter-panel,
.content-section,
.contact-section {
  margin-top: 28px;
  padding: 30px;
  background: rgba(251, 247, 239, 0.96);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.section-head p {
  color: var(--muted);
  line-height: 1.8;
}

.chapter-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.chapter-card,
.feature-card {
  min-height: 138px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 228, 214, 0.72));
  border: 1px solid var(--line);
  transition: transform 160ms ease, border-color 160ms ease;
}

.chapter-card:hover,
.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 145, 86, 0.56);
}

.chapter-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--jade);
  font-weight: 800;
}

.chapter-card strong {
  font-size: 1.08rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card h3 {
  margin: 0 0 10px;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.8;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.contact-form .full {
  grid-column: 1 / -1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(24, 33, 38, 0.4);
  padding: 14px;
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.notice {
  margin-bottom: 16px;
  padding: 14px;
  border-left: 4px solid var(--red);
  background: rgba(184, 145, 86, 0.16);
  font-weight: 800;
}

.reader-body {
  background:
    radial-gradient(circle at 70% 0%, rgba(184, 145, 86, 0.16), transparent 30%),
    linear-gradient(180deg, #101417 0%, #1b282e 100%);
}

.reader-topbar {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.reader-layout {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 70px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.reader-sidebar,
.reader-article {
  background: var(--paper-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.reader-sidebar {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.reader-cover {
  width: 100%;
  aspect-ratio: 9 / 13;
  object-fit: cover;
  border: 8px solid #fffaf2;
}

.reader-sidebar h1 {
  margin: 18px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
}

.reader-sidebar p {
  color: var(--muted);
  line-height: 1.8;
}

.reader-chapters {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  max-height: 380px;
  overflow: auto;
}

.reader-chapters a {
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
}

.reader-chapters a.active {
  background: var(--blue);
  color: #fff8ee;
}

.reader-article {
  padding: clamp(24px, 5vw, 58px);
}

.chapter-title {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.chapter-title h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
}

.chapter-content {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 1.08rem;
  line-height: 2.18;
}

.chapter-content h1,
.chapter-content h2,
.chapter-content h3 {
  margin: 0 0 1.2em;
  line-height: 1.3;
}

.chapter-content p {
  margin: 0 0 1.05em;
  text-indent: 2em;
}

.chapter-nav {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

@media (max-width: 980px) {
  .novel-hero,
  .reader-layout,
  .chapter-grid,
  .feature-grid,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .reader-sidebar {
    position: static;
  }

  .reader-chapters {
    max-height: none;
  }

  .topbar,
  .reader-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-shell,
  .reader-topbar,
  .reader-layout {
    width: min(100% - 20px, 1180px);
  }

  .novel-hero,
  .chapter-panel,
  .content-section,
  .contact-section,
  .reader-article {
    padding: 20px;
  }

  .novel-intro {
    padding: 18px;
  }

  .novel-intro h1 {
    font-size: 4rem;
  }

  .hero-actions .button,
  .chapter-nav .button,
  .contact-form .button {
    width: 100%;
  }
}
