@font-face {
  font-family: "Novel Songti";
  src:
    url("files/fonts/novel-songti-subset.woff2") format("woff2"),
    url("files/fonts/novel-songti-subset.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Novel Kaiti";
  src:
    url("files/fonts/novel-kaiti-subset.woff2") format("woff2"),
    url("files/fonts/novel-kaiti-subset.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.novels-page {
  --novel-bg: #fbfaf7;
  --novel-paper: #ffffff;
  --novel-text: #222222;
  --novel-muted: #6d645c;
  --novel-line: #ddd6cd;
  --novel-line-strong: #cfc6bc;
  --novel-accent: #3c3129;
  --novel-serif: "Novel Songti", "Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --novel-kaiti: "Novel Kaiti", "LXGW WenKai GB", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif;
  --novel-ui: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif;

  min-height: 100vh;
  background: var(--novel-bg);
  color: var(--novel-text);
  font-family: var(--novel-serif);
  font-synthesis: none;
}

body:has(.novels-page) {
  background: var(--novel-bg);
}

body:has(.novels-page) #quarto-content {
  padding-top: calc(var(--nav-height) + 0.05rem);
}

body:has(.novels-page) #title-block-header {
  display: none;
}

body:has(.novels-page) .page-layout-custom {
  width: 100%;
  max-width: none;
  padding: 0;
}

body:has(.novels-page) .navbar {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--novel-line) !important;
}

body:has(.novels-page) .navbar .navbar-brand {
  color: var(--novel-accent) !important;
}

body:has(.novels-page) .navbar .nav-link {
  color: var(--novel-muted) !important;
  background: transparent !important;
  border-radius: 0 !important;
}

body:has(.novels-page) .navbar .nav-link:hover {
  color: var(--novel-accent) !important;
  background: transparent !important;
  transform: none !important;
}

body:has(.novels-page) .navbar .nav-link[href*="novels.html"] {
  color: var(--novel-accent) !important;
}

body:has(.novels-page) .navbar .nav-link[href*="novels.html"].active {
  color: var(--novel-accent) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--novel-accent);
}

body:has(.novels-page) .nav-footer {
  background: transparent;
  border-top-color: var(--novel-line);
  color: var(--novel-muted);
}

body:has(.novels-page) .nav-footer a {
  color: var(--novel-accent);
}

.novels-page p,
.novels-page li,
.novels-page h1,
.novels-page h2,
.novels-page h3,
.novels-page h4 {
  font-family: var(--novel-serif);
}

.novels-header,
.novel-detail-hero {
  padding: 3rem 1.5rem 1.25rem;
}

.novels-header-inner,
.novel-detail-hero-inner {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--novel-line);
}

.novels-header-inner {
  max-width: 760px;
  text-align: center;
}

.novels-header .novels-label-en {
  display: none;
}

.novel-detail-hero-inner {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.novels-label-en {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.novels-header h1,
.novel-title,
.novel-detail-title,
.novel-part-title {
  font-family: var(--novel-serif) !important;
  color: var(--novel-text) !important;
  background: none !important;
  border: 0 !important;
  -webkit-text-fill-color: var(--novel-text) !important;
}

.novels-header h1 {
  margin: 0 0 0.55rem !important;
  font-size: 2.15rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
}

.novels-epigraph {
  display: block;
  color: var(--novel-muted);
  font-family: var(--novel-serif);
  font-size: 0.95rem;
  line-height: 1.8;
}

.novels-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem 3.5rem;
}

.novel-progress-note {
  max-width: 760px;
  margin: 0 auto 1.1rem;
  padding: 0.2rem 0 0.95rem;
  color: var(--novel-muted);
  font-family: var(--novel-kaiti);
  font-size: 0.94rem;
  line-height: 1.9;
  text-align: center;
  border-bottom: 1px solid rgba(221, 214, 205, 0.78);
}

.novel-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
  padding: 1.45rem 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.novel-cover,
.novel-detail-cover {
  align-self: start;
}

.cover-img {
  display: block;
  width: 100%;
  border-radius: 0;
  box-shadow: 0 2px 10px rgba(20, 16, 12, 0.08);
}

.novels-page .quarto-figure figcaption,
.novels-page figure figcaption {
  display: none;
}

.novel-badge {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.novel-title {
  margin: 0.2rem 0 0.3rem !important;
  font-size: 1.45rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
}

.novel-title a {
  color: inherit !important;
  text-decoration: none !important;
}

.novel-title a:hover {
  color: inherit !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(34, 34, 34, 0.25);
}

.novel-subtitle,
.novel-detail-subtitle {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--novel-muted);
  font-family: var(--novel-serif);
  font-size: 0.94rem;
  font-weight: 400;
  letter-spacing: 0;
}

.novel-synopsis,
.novel-detail-synopsis {
  color: var(--novel-text);
  font-family: var(--novel-serif);
  font-size: 0.99rem;
  line-height: 1.95;
}

.novel-synopsis p,
.novel-detail-synopsis p {
  margin-bottom: 0.7rem;
}

.novel-synopsis p + p {
  text-indent: 2em;
}

.novel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 0.65rem;
}

.meta-tag {
  position: relative;
  padding: 0 0.65rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.meta-tag:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: 0;
  color: var(--novel-line-strong);
}

.novel-quote {
  margin-top: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--novel-muted);
  font-family: var(--novel-serif);
  font-size: 0.92rem;
  line-height: 1.8;
}

.novel-read-link,
.novel-back-link {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(34, 34, 34, 0.2);
  border-radius: 0;
  background: transparent;
  color: var(--novel-accent) !important;
  font-family: var(--novel-ui);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  text-transform: none;
  box-shadow: none;
  transition: border-color 160ms ease, color 160ms ease;
}

.novel-read-link:hover,
.novel-back-link:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--novel-accent);
  color: var(--novel-accent) !important;
}

.novel-divider,
.novel-part-divider {
  height: 1px;
  max-width: none;
  margin: 0;
  background: var(--novel-line);
}

.novels-footer {
  padding: 2rem 1.5rem 3rem;
}

.novels-footer-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: var(--novel-muted);
  font-family: var(--novel-serif);
  font-size: 0.92rem;
  line-height: 1.8;
}

.novel-detail-title {
  margin: 0.15rem 0 0.3rem !important;
  font-size: 1.85rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
}

.novel-detail-synopsis {
  color: var(--novel-muted);
  font-size: 0.95rem;
}

.novel-toc-section {
  max-width: 760px;
  margin: 0 auto;
}

.novel-part {
  margin-bottom: 1.3rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.novel-part-header {
  padding: 0.95rem 0 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--novel-line);
  background: transparent;
}

.novel-part-number {
  margin-bottom: 0.25rem;
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.novel-part-title {
  margin: 0 !important;
  font-size: 1.2rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
}

.novel-chapter-list {
  display: flex;
  flex-direction: column;
}

.novel-chapter {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(221, 214, 205, 0.7);
}

.novel-chapter:last-child {
  border-bottom: none;
}

.novel-chapter:hover {
  background: transparent;
}

.chapter-number {
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.chapter-title {
  color: var(--novel-text);
  font-family: var(--novel-serif);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.chapter-entry {
  min-width: 0;
}

.chapter-title a {
  color: inherit !important;
  text-decoration: none !important;
}

.chapter-title a:hover {
  color: inherit !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(34, 34, 34, 0.28);
}

.chapter-teaser {
  margin-top: 0.18rem;
  color: var(--novel-muted);
  font-family: var(--novel-serif);
  font-size: 0.9rem;
  line-height: 1.78;
}

.novel-chapter.chapter-available {
  padding-bottom: 0.92rem;
  cursor: pointer;
}

.novel-chapter.chapter-available:hover {
  background: rgba(255, 255, 255, 0.5);
}

.novel-chapter.chapter-available:hover .chapter-title a {
  text-decoration: underline !important;
  text-decoration-color: rgba(34, 34, 34, 0.28);
}

.novel-chapter.chapter-available:hover .chapter-teaser {
  color: var(--novel-text);
}

.chapter-page-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3.4rem;
}

.chapter-header {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  padding: 1.1rem 0 1.35rem;
  text-align: center;
  border-bottom: 1px solid var(--novel-line);
}

.chapter-running-title {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--novel-muted);
  font-family: var(--novel-ui);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.chapter-page-title {
  margin: 0 !important;
  font-size: 2rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
}

.chapter-lead-quote {
  display: block;
  max-width: 32rem;
  margin: 0.85rem auto 0;
  color: var(--novel-muted);
  font-family: var(--novel-kaiti);
  font-size: 1rem;
  line-height: 1.9;
}

.chapter-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.4rem clamp(1.25rem, 4vw, 3rem) 2.8rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(221, 214, 205, 0.86);
  box-shadow: 0 12px 28px rgba(40, 31, 22, 0.05);
}

.chapter-body p {
  margin: 0;
  color: var(--novel-text);
  font-family: var(--novel-serif);
  font-size: 1.05rem;
  line-height: 2.04;
  text-indent: 2em;
  text-align: justify;
  text-justify: inter-ideograph;
}

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

.chapter-body p + p {
  margin-top: 0.08rem;
}

.chapter-body em {
  font-style: normal;
}

.chapter-body blockquote {
  max-width: 29rem;
  margin: 1.25rem auto 1.35rem;
  padding: 0.2rem 1rem;
  color: #584c44;
  font-family: var(--novel-kaiti);
  font-size: 1rem;
  line-height: 1.95;
  text-align: center;
  background: transparent;
  border-left: none;
}

.chapter-body blockquote p,
.chapter-kaiti p {
  text-indent: 0;
  font-family: inherit;
}

.chapter-body blockquote p + p,
.chapter-kaiti p + p {
  margin-top: 0.12rem;
}

.chapter-kaiti:not(.chapter-message) {
  max-width: 24rem;
  margin: 1.45rem auto;
  padding: 0.2rem 1rem;
  color: #584c44;
  font-family: var(--novel-kaiti);
  font-size: 1rem;
  line-height: 1.95;
  text-align: center;
  border-left: none;
  background: transparent;
}

.chapter-message {
  width: fit-content;
  max-width: min(24rem, calc(100% - 2rem));
  margin: 0.8rem 0 0.9rem 1.35rem;
  padding: 0.1rem 0 0.1rem 0.95rem;
  color: #584c44;
  font-family: var(--novel-kaiti);
  font-size: 0.98rem;
  line-height: 1.95;
  text-align: left;
  border-left: 1px solid rgba(207, 198, 188, 0.92);
  background: transparent;
}

.chapter-message.is-reply {
  margin-left: 3.35rem;
}

.chapter-body > p + .chapter-message,
.chapter-body > p + blockquote,
.chapter-body > p + .chapter-kaiti:not(.chapter-message) {
  margin-top: 0.95rem;
}

.chapter-body > .chapter-message + p,
.chapter-body > blockquote + p,
.chapter-body > .chapter-kaiti:not(.chapter-message) + p {
  margin-top: 0.75rem;
}

.chapter-nav {
  max-width: 760px;
  margin: 1.2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--novel-line);
}

.chapter-nav p {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  margin: 0;
}

.chapter-nav p a:last-child {
  margin-left: auto;
  text-align: right;
}

.chapter-nav-link {
  color: var(--novel-accent) !important;
  font-family: var(--novel-ui);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(60, 49, 41, 0.22);
}

.chapter-nav-link:hover {
  color: var(--novel-accent) !important;
  border-bottom-color: var(--novel-accent);
}

@media (max-width: 900px) {
  .novel-card,
  .novel-detail-hero-inner {
    grid-template-columns: 1fr;
  }

  .novel-cover,
  .novel-detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }

  .novel-detail-header {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .novels-header,
  .novel-detail-hero {
    padding: 2.4rem 1.15rem 1rem;
  }

  .novels-content,
  .novels-footer,
  .chapter-page-shell {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .novels-header h1 {
    font-size: 1.85rem !important;
  }

  .novel-title {
    font-size: 1.3rem !important;
  }

  .novel-detail-title {
    font-size: 1.6rem !important;
  }

  .chapter-page-title {
    font-size: 1.72rem !important;
  }

  .chapter-body {
    padding: 1.75rem 1.05rem 2rem;
  }

  .chapter-body p {
    font-size: 1rem;
    line-height: 1.96;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .chapter-nav p {
    flex-direction: column;
  }

  .chapter-nav p a:last-child {
    margin-left: 0;
    text-align: left;
  }

  .chapter-message,
  .chapter-message.is-reply {
    max-width: calc(100% - 1rem);
    margin-left: 0.9rem;
  }
}

@media (max-width: 520px) {
  .novel-chapter {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}
