@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap");

/* Final editorial typography layer: literary reading, restrained navigation. */
:root {
  --paper: #fffdfa;
  --paper-raised: #ffffff;
  --ink: #292525;
  --muted: #706967;
  --line: #e5dfda;
  --seal: #ae4955;
  --seal-dark: #873641;
  --max: 1160px;
  --read: 690px;
  --serif: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:lang(en) {
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", Arial, sans-serif;
}

html { scroll-padding-top: 1rem; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
}

h1, h2, h3,
.catalog-book-card strong,
.catalog-paths strong,
.serial-latest-item a,
.book-latest a,
.chapter-range a,
.article,
.article table {
  font-family: var(--serif);
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: 0;
}

h1,
.page-title h1,
.article h1 {
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  line-height: 1.2;
}

h2,
.chapter-book-head h2,
.serial-current-book h2 {
  font-size: clamp(1.28rem, 2vw, 1.55rem);
  line-height: 1.3;
}

h3,
.chapter-book .content-item h3,
.content-item h2,
.work-entry h2 {
  font-size: 1.06rem;
  line-height: 1.4;
}

.eyebrow,
.meta,
.nav,
.button,
.text-button,
.content-item time,
.content-item .label,
.chapter-meta,
.serial-latest-item time,
.book-latest time {
  letter-spacing: 0;
}

.eyebrow,
.meta {
  font-size: 0.72rem;
  line-height: 1.4;
}

.lead {
  max-width: 42rem;
  font-size: 1.04rem;
  line-height: 1.75;
}

.site-header {
  justify-content: flex-start;
  gap: 0.8rem;
  width: min(var(--max), calc(100% - 3.5rem));
  padding: 1.7rem 0 0;
}

.brand {
  flex: 0 0 13.2rem;
  width: 13.2rem;
  align-self: flex-start;
  margin: 0;
}

.brand-wordmark,
.brand img.brand-wordmark {
  width: 12.9rem;
}

.site-header .nav {
  margin-left: auto;
}

.nav {
  min-height: 0;
  padding: 0.66rem 0;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.35;
}

.nav a {
  padding: 0.18rem 0.72rem;
}

.language-link {
  margin-left: 0.25rem;
  padding-left: 0.75rem;
}

.wrap,
.site-footer {
  width: min(var(--max), calc(100% - 3.5rem));
}

.page-title,
.catalog-page-title {
  padding: 3.15rem 0 1.75rem;
}

.section {
  padding: 2.4rem 0;
}

.section::before,
.site-footer::before {
  display: none;
}

.section:not(.serial-current-book) {
  border-top: 1px solid var(--line);
}

.section-head {
  gap: 1.25rem;
  margin: 0 0 1.25rem;
}

.catalog-intro {
  grid-template-columns: minmax(0, 1fr) 14rem;
  gap: clamp(2rem, 5vw, 4rem);
  padding: 3.05rem 0 3.25rem;
}

.catalog-intro-copy h1 {
  font-size: clamp(2.5rem, 4vw, 3rem);
}

.catalog-intro-mark {
  width: 14rem;
  justify-self: end;
  padding: 0.35rem;
  border: 0;
  background: transparent;
}

.catalog-shelf,
.catalog-paths {
  padding-top: 2.35rem;
  padding-bottom: 2.35rem;
  border-color: var(--line);
}

.catalog-section-heading { margin-bottom: 1.25rem; }

.catalog-book-grid { gap: 1.15rem; }

.catalog-book-card--cover {
  padding: 0.55rem;
  background: #faf9f7;
}

.catalog-book-card--cover:hover {
  box-shadow: 0 8px 18px rgba(42, 31, 28, 0.09);
  transform: translateY(-2px);
}

.catalog-paths {
  gap: 1px;
  background: var(--line);
}

.catalog-paths a {
  min-height: 4.65rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
}

.catalog-paths strong { font-size: 1rem; }

.catalog-feature-book {
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3rem);
  padding: 2.35rem 0;
}

.catalog-feature-art {
  width: 12rem;
  justify-self: start;
  padding: 1rem;
  background: transparent;
}

.catalog-feature-book .button,
.catalog-feature-book .text-button {
  min-inline-size: 8.8rem;
  min-block-size: 2.6rem;
}

.page-title--yulongji {
  grid-template-columns: minmax(0, 1fr) 8.75rem;
  gap: 1.5rem;
}

.yulongji-title-mark {
  width: 8.75rem;
  height: 8.75rem;
}

.article {
  max-width: var(--read);
  font-size: var(--reader-font, 19px);
  line-height: 1.9;
}

.article h1 { margin-bottom: 0.8rem; }
.article h2 { font-size: 1.4rem; margin-top: 2.8rem; }
.article p { margin-bottom: 1.35rem; }
.article table { font-size: 0.92rem; line-height: 1.65; }

.serial-index > .section { padding: 1.65rem 0; }
.serial-current-book { padding: 1.5rem 1.65rem !important; }
.serial-latest-item { padding: 0.72rem 0; }
.serial-latest-item a { font-size: 1.08rem; }

.content-item { padding: 1.05rem 0; }
.content-list--two-column .content-item { padding: 0.8rem 0; }

.media-release--audio {
  grid-template-columns: minmax(6.75rem, 10rem) minmax(0, 1fr);
  gap: 1.35rem;
  padding: 1rem;
}

.media-release-cover { max-width: 10rem; }

.social-links { gap: 0.45rem; }
.social-link { width: 2rem; height: 2rem; }
.social-link svg { width: 0.92rem; height: 0.92rem; }

@media (max-width: 860px) {
  .site-header {
    gap: 0.25rem;
  }

  .site-header .nav {
    margin-left: 0;
    padding-top: 0;
    line-height: 1.25;
  }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .site-header,
  .wrap,
  .site-footer { width: min(100% - 2rem, var(--max)); }

  .site-header { padding-top: 1.25rem; }
  .brand {
    flex-basis: 11.4rem;
    width: 11.4rem;
  }
  .brand-wordmark,
  .brand img.brand-wordmark { width: 10.9rem; }
  .site-header .nav { margin-left: 0; }

  .nav {
    justify-content: flex-start;
    padding: 0.58rem 0;
    font-size: 0.73rem;
  }

  .nav a { padding-inline: 0.52rem; }

  .catalog-intro {
    grid-template-columns: minmax(0, 1fr) 8rem;
    gap: 1.25rem;
    padding: 2.15rem 0 2.15rem;
  }

  .catalog-intro-mark {
    width: 8rem;
    align-self: end;
  }

  .catalog-intro-copy h1 { font-size: 2.15rem; }
  .catalog-intro .lead { font-size: 0.96rem; }

  .catalog-shelf,
  .catalog-paths { padding-top: 1.65rem; padding-bottom: 1.65rem; }

  .catalog-book-grid { gap: 0.75rem; }
  .catalog-book-card--cover { padding: 0.38rem; }

  .page-title,
  .catalog-page-title { padding: 2.35rem 0 1.35rem; }

  .page-title--yulongji {
    grid-template-columns: minmax(0, 1fr) 5.75rem;
    gap: 0.85rem;
  }

  .yulongji-title-mark { width: 5.75rem; height: 5.75rem; }

  .catalog-feature-book {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.7rem 0;
  }

  .catalog-feature-art { width: 8.5rem; padding: 0.6rem; }

  .article { font-size: var(--reader-font, 18px); line-height: 1.85; }
  .article h1 { font-size: 1.95rem; }

  .media-release--audio { grid-template-columns: 7.25rem minmax(0, 1fr); }
  .media-release-cover { max-width: 7.25rem; }
}

@media (max-width: 460px) {
  .catalog-intro { grid-template-columns: 1fr; }
  .catalog-intro-mark { width: 7.5rem; justify-self: start; }
  .catalog-paths a { min-height: 0; }
  .catalog-feature-book { grid-template-columns: 1fr; }
  .catalog-feature-art { width: 8rem; }
  .media-release--audio { grid-template-columns: 1fr; }
  .media-release-cover { max-width: 9rem; }
}

/* Quiet alternating bands distinguish editorial sections without turning them into cards. */
:root {
  --band-rose: #fbf6f4;
  --band-sage: #f4f7f2;
}

.catalog-shelf,
main.wrap > .section:nth-of-type(even),
.serial-index > .serial-volumes {
  background: var(--band-rose);
}

.catalog-paths,
main.wrap > .section:nth-of-type(odd),
.serial-index > .serial-current-book {
  background: var(--band-sage);
}

.catalog-paths {
  border-color: color-mix(in srgb, var(--line) 82%, var(--band-sage));
}

.catalog-paths a {
  background: transparent;
}

.catalog-paths a:hover,
.work-entry:hover {
  background: color-mix(in srgb, #fff 52%, transparent);
}

.serial-current-book {
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
}

.article-shell,
.article-standalone,
.book-directory,
.article--audio {
  background: var(--paper);
}

/* Apply the two paper tones to every public page template, within the content column only. */
.catalog-shelf,
.catalog-paths,
main.wrap > .page-title,
main.wrap > .section,
main > .section.wrap,
main > .work-hero.wrap,
main > .hero.wrap,
main.wrap > .article-standalone:not(.article--map),
main.wrap > .article--map > :is(.eyebrow, h1, .chapter-meta) {
  padding-inline: clamp(1rem, 2vw, 1.5rem);
}

/* Begin every subpage as the homepage does: neutral introduction, then color. */
main.wrap > .page-title,
main > .work-hero.wrap,
main > .hero.wrap,
main.wrap > .article-standalone:not(.article--map) {
  background: var(--paper);
}

/* After the neutral title, rose is the first editorial band and sage follows it. */
main.wrap > .section:nth-of-type(even),
main > .section.wrap:nth-of-type(even),
.catalog-shelf,
.catalog-work-index .catalog-feature-book,
main.wrap > .article--map > :is(.eyebrow, h1, .chapter-meta) {
  background: var(--band-rose);
}

main.wrap > .section:nth-of-type(odd),
main > .section.wrap:nth-of-type(odd) {
  background: var(--band-sage);
}

.catalog-work-index .catalog-feature-book {
  box-sizing: border-box;
  padding-inline: clamp(1rem, 2vw, 1.5rem);
}

/* The map itself and the protected reading text remain clear and neutral. */
.article--map .article-image,
.article-shell .article {
  background: var(--paper);
}

.article-shell .reader-tools,
.article-shell .toc {
  padding: 1rem;
  background: var(--band-sage);
}

.article-shell .toc { background: var(--band-rose); }

@media (max-width: 860px) {
  .site-header {
    gap: 0.25rem;
  }

  .site-header .nav {
    margin-left: 0;
    padding-top: 0;
    line-height: 1.25;
  }
}

@media (max-width: 760px) {
  .catalog-shelf,
  .catalog-paths,
  main.wrap > .page-title,
  main.wrap > .section,
  main > .section.wrap,
  main > .work-hero.wrap,
  main > .hero.wrap,
  main.wrap > .article-standalone:not(.article--map),
  main.wrap > .article--map > :is(.eyebrow, h1, .chapter-meta) {
    padding-inline: 1rem;
  }

  .article-shell .reader-tools,
  .article-shell .toc {
    padding: 0.75rem;
  }
}



/* Keep reader controls calm and legible when the chapter switches to dark mode. */
body.theme-dark {
  --band-rose: #282221;
  --band-sage: #202724;
}

/* Keep the wordmark and its following navigation visually connected. */
@media (max-width: 860px) {
  .site-header {
    gap: 0.1rem;
  }

  .site-header .nav {
    padding-top: 0;
  }
}

/* Reserve one stable date column across both languages in the desktop archive index. */
@media (min-width: 861px) {
  .archive-index .content-list--two-column .content-item {
    grid-template-columns: minmax(12.25rem, 0.36fr) minmax(0, 1fr);
  }

  .archive-index .content-list--two-column .content-item time {
    white-space: nowrap;
    font-size: 0.7rem;
  }
}

/* Touch targets for repeated navigation controls, without changing inline prose links. */
.nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
}

.recent-updates a,
.toc a {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.75rem;
}

/* The reading-index work breadcrumb is a navigation target too. */
.serial-index .eyebrow a {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.75rem;
}

/* Media type is a quiet editorial annotation, not part of the release title. */
.content-kind {
  display: inline-block;
  margin-left: 0.55rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

/* A short chapter list needs no extra disclosure control. */
.chapter-range-list {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.chapter-range-list li a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0;
  color: var(--ink);
  text-decoration: none;
}

.chapter-range-list time {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
}

.chapter-range-list li a:hover {
  color: var(--seal-dark);
}

@media (max-width: 650px) {
  .chapter-range-list li a {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}
