body.subsite-body {
  background: #fafaf7;
}

.books-page {
  --shelf-ink: #173c31;
  --shelf-secondary: #52675e;
  --shelf-rule: #d9dfd9;
  --shelf-serif: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif;
  max-width: 1120px;
  padding-block: clamp(20px, 4vw, 54px) clamp(32px, 6vw, 68px);
  color: var(--shelf-ink);
}

.shelf-masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  border-bottom: 2px solid var(--shelf-ink);
  padding-bottom: 18px;
}

.books-page h1 {
  margin: 0;
  font: 650 clamp(1.9rem, 3.4vw, 2.75rem)/1.21 var(--shelf-serif);
  letter-spacing: .012em;
}

.shelf-masthead p, .shelf-byline {
  margin-top: 8px;
  font-size: .875rem;
  color: var(--shelf-secondary);
}

.shelf-masthead p span, .shelf-byline span {
  margin-inline-start: .85em;
  padding-inline-start: .85em;
  border-inline-start: 1px solid #bdc9bf;
}

.shelf-sections { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.shelf-sections a, .shelf-back a, .shelf-figure figcaption a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #a1b4a6;
  text-underline-offset: 5px;
}
.shelf-sections a:hover, .shelf-back a:hover, .shelf-figure figcaption a:hover {
  text-decoration-color: currentColor;
}

.shelf-section { margin-top: clamp(22px, 3vw, 38px); }
.shelf-section + .shelf-section { border-top: 1px solid var(--shelf-rule); padding-top: 18px; }
.books-page .shelf-section h2 {
  margin: 0 0 12px;
  font: 650 clamp(1.125rem, 2vw, 1.45rem)/1.35 var(--shelf-serif);
}
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 22px clamp(14px, 2.5vw, 28px);
}
.shelf-book { min-width: 0; }
.shelf-book-link { display: block; }
.shelf-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.08;
  overflow: hidden;
  border-radius: 6px;
  background: #f0f0eb;
}
.shelf-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.shelf-book h3 {
  margin: 10px 0 0;
  font: 650 clamp(.97rem, 1.4vw, 1.125rem)/1.45 var(--shelf-serif);
  overflow-wrap: anywhere;
}
.shelf-edition { margin: 3px 0 0; font-size: .8rem; line-height: 1.4; color: var(--shelf-secondary); }
.shelf-book:target .shelf-art { outline: 2px solid #95afa0; outline-offset: 2px; }
.shelf-book-link:is(:hover, :focus-visible) h3 { text-decoration: underline; text-underline-offset: .22em; }

.shelf-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
  margin-top: 32px;
  padding-block: 20px;
  border-block: 1px solid var(--shelf-rule);
}
.books-page .shelf-notes h2 { margin: 0 0 5px; font: 650 1rem/1.5 var(--shelf-serif); }
.shelf-notes p, .shelf-notes ul { margin: 0; font-size: .875rem; color: var(--shelf-secondary); }

.shelf-back { margin-bottom: 12px; }
.shelf-reader {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: clamp(24px, 5vw, 76px);
  border-top: 2px solid var(--shelf-ink);
  padding-top: clamp(16px, 3vw, 38px);
}
.shelf-figure { margin: 0; }
.shelf-reader .shelf-art { aspect-ratio: 4 / 4.7; cursor: zoom-in; }
.shelf-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
}
.shelf-view-picker {
  display: inline-flex;
  min-width: 0;
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--shelf-rule);
  border-radius: 7px;
}
.shelf-view-picker label { position: relative; cursor: pointer; }
.shelf-view-picker label input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  clip-path: inset(50%);
}
.shelf-view-picker span {
  display: grid;
  min-height: 34px;
  padding-inline: .7rem;
  place-items: center;
  border-radius: 4px;
  color: var(--shelf-secondary);
  font-size: .8125rem;
}
.shelf-view-picker input:checked + span { background: var(--shelf-ink); color: white; }
.shelf-view-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.shelf-figure:not(:has(input[value="studio"]:checked)) .shelf-view-studio,
.shelf-figure:has(input[value="studio"]:checked) .shelf-view-cover { display: none; }
.shelf-reader-copy { min-width: 0; }
.shelf-category {
  margin-bottom: .65rem;
  color: var(--shelf-secondary);
  font-size: .8125rem;
  font-weight: 600;
}
.shelf-synopsis {
  margin-top: 22px;
  color: #253d33;
  line-height: 1.8;
}
.shelf-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px 16px;
  padding-top: 18px;
  margin: 20px 0 0;
  border-top: 1px solid var(--shelf-rule);
  font-size: .9375rem;
  line-height: 1.65;
}
.shelf-facts dt { font-weight: 650; }
.shelf-facts dd { margin: 0; color: var(--shelf-secondary); }

@media (max-width: 820px) {
  .shelf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shelf-reader { gap: 24px; }
}
@media (max-width: 600px) {
  .books-page { padding-top: 18px; }
  .shelf-masthead { display: block; padding-bottom: 3px; }
  .shelf-sections { margin-top: 9px; gap: 0 1.15rem; }
  .shelf-sections a { min-height: 40px; }
  .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .shelf-book h3 { margin-top: 7px; }
  .shelf-section { margin-top: 18px; }
  .shelf-notes { grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
  .shelf-reader { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .shelf-reader .shelf-art { aspect-ratio: 1.35; }
  .shelf-reader h1 { font-size: 1.7rem; }
  .shelf-back { margin-bottom: 6px; }
  .shelf-synopsis { margin-top: 16px; font-size: .9375rem; }
  .shelf-facts { margin-top: 15px; padding-top: 14px; gap: 10px 12px; font-size: .875rem; }
}
