:root {
  color-scheme: light;
  --paper: #f3ecdc;
  --paper-light: #fbf7ee;
  --paper-deep: #e8ddc8;
  --ink: #211d17;
  --muted: #746b5c;
  --faint: #9b907c;
  --line: rgba(58, 48, 33, 0.16);
  --honey: #a87a13;
  --honey-light: #d5b66b;
  --sage: #748268;
  --wood: #76543a;
  --wood-dark: #4d3526;
  --wood-light: #a47b52;
  --font-latin: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-cjk: "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif CJK TC", STSong, serif;
  --font-hand: "Segoe Print", "Bradley Hand", "Kaiti SC", "STKaiti", KaiTi, "Kaiti TC", cursive;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 24px 70px rgba(64, 48, 27, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 84% 8%, rgba(213, 182, 107, 0.16), transparent 30rem),
    radial-gradient(circle at 4% 28%, rgba(116, 130, 104, 0.1), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-cjk);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(87, 67, 40, 0.025) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(87, 67, 40, 0.018) 5px 6px);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--honey) 55%, transparent);
  text-underline-offset: 0.24em;
}

a:hover {
  color: var(--honey);
}

img,
svg {
  max-width: 100%;
}

::selection {
  color: var(--ink);
  background: rgba(213, 182, 107, 0.42);
}

:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  color: var(--paper-light);
  background: var(--wood-dark);
  border-radius: 4px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 236, 220, 0.82);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: min(1240px, calc(100% - 3rem));
  min-height: 78px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(168, 122, 19, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(168, 122, 19, 0.08);
}

.brand-copy {
  display: grid;
  line-height: 1.25;
}

.brand-copy strong {
  font-family: var(--font-latin);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-copy span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-family: var(--font-latin);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  gap: 1.8rem;
  margin-left: auto;
  font-size: 0.9rem;
}

.main-nav a {
  position: relative;
  padding: 0.35rem 0;
  text-decoration: none;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--honey);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.admin-link:hover {
  border-color: rgba(168, 122, 19, 0.45);
  background: rgba(168, 122, 19, 0.07);
}

.admin-link svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.hero {
  width: min(1100px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 4.2rem 0 2.5rem;
  text-align: center;
}

.plaque {
  position: relative;
  display: inline-grid;
  min-width: min(660px, 100%);
  padding: 1.65rem 3.4rem 1.45rem;
  overflow: hidden;
  color: #f8e9c7;
  border: 1px solid #c3a266;
  border-radius: 5px;
  background:
    repeating-linear-gradient(92deg, transparent 0 11px, rgba(255, 244, 211, 0.035) 11px 12px),
    linear-gradient(135deg, #9a7745, #6f4f2d 46%, #8a6538);
  box-shadow:
    inset 0 0 0 4px rgba(61, 39, 19, 0.28),
    inset 0 0 0 5px rgba(242, 216, 161, 0.22),
    0 15px 32px rgba(74, 51, 25, 0.2);
  text-shadow: 0 1px 0 rgba(48, 30, 14, 0.7);
}

.plaque::before,
.plaque::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e2c78f, #80643e 68%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
}

.plaque::before {
  left: 18px;
}

.plaque::after {
  right: 18px;
}

.plaque-line-one {
  font-family: var(--font-latin);
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.plaque-line-two {
  margin-top: 0.55rem;
  color: #e6d3a9;
  font-family: var(--font-latin);
  font-size: clamp(0.76rem, 1.7vw, 0.98rem);
  letter-spacing: 0.16em;
}

.hero-note {
  max-width: 620px;
  margin: 1.7rem auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: min(330px, 70%);
  margin: 1.5rem auto 0;
  color: var(--honey);
}

.hero-rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 122, 19, 0.5));
}

.hero-rule span:last-child {
  background: linear-gradient(90deg, rgba(168, 122, 19, 0.5), transparent);
}

.hero-rule i {
  font-size: 0.65rem;
  font-style: normal;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(760px, calc(100% - 3rem));
  margin: 0 auto 3.6rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  padding: 1rem 0.5rem;
}

.stats > div + div {
  border-left: 1px solid var(--line);
}

.stats strong {
  color: var(--honey);
  font-family: var(--font-latin);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 0.75rem;
}

.study-section {
  padding: 0 0 5rem;
  background: linear-gradient(180deg, transparent 0, #f1deae 12%, #eed7a4 72%, #d7b98a 100%);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto 1.5rem;
  padding-top: 0.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--honey);
  font-family: var(--font-latin);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-heading h2,
.about-card h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.section-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.study-stage {
  position: relative;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.study-stage::after {
  display: none;
}

.stage-scroll {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(118, 84, 58, 0.45) transparent;
}

.bookcase-wrap {
  position: relative;
  width: min(1440px, 100%);
  min-width: 820px;
  aspect-ratio: 1280 / 853;
  margin: 0 auto;
}

.bookcase-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: none;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, #000 2%, #000 98%, transparent 100%),
    linear-gradient(0deg, transparent 0, #000 1.5%, #000 98.5%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0, #000 2%, #000 98%, transparent 100%),
    linear-gradient(0deg, transparent 0, #000 1.5%, #000 98.5%, transparent 100%);
  mask-composite: intersect;
}

.bookcase-sunlight {
  display: none;
}

.bookshelf-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  height: 12.427%;
  pointer-events: none;
}

.top-ornament {
  position: absolute;
  bottom: 7%;
  height: 80%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}

.top-ornament:nth-child(1) {
  left: 4.8%;
  width: 11.8%;
}

.top-ornament:nth-child(2) {
  left: 35.2%;
  width: 11.6%;
}

.top-ornament:nth-child(3) {
  left: 71.6%;
  width: 10%;
}

.top-ornament.is-baked:hover,
.top-ornament.is-baked:focus-visible {
  background: radial-gradient(ellipse at 50% 80%, rgba(255, 240, 195, 0.2), transparent 65%);
}

.bookshelf {
  position: absolute;
  top: 12.427%;
  right: 2.03125%;
  bottom: 1.5234%;
  left: 5%;
  z-index: 3;
}

.shelf-grid {
  display: flex;
  gap: 0;
  width: 100%;
  height: 100%;
}

.shelf-grid.is-spanned {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.shelf-column {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.shelf-cell {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  margin: 5px 4px 7px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  isolation: isolate;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.shelf-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 241, 208, 0.16) 45%, transparent 64%);
  opacity: 0;
  transition: opacity 0.3s;
}

.shelf-cell:hover,
.shelf-cell:focus-visible {
  z-index: 2;
  background: rgba(255, 232, 186, 0.055);
  box-shadow: inset 0 0 0 2px rgba(213, 182, 107, 0.62);
}

.shelf-cell:hover::before,
.shelf-cell:focus-visible::before {
  opacity: 1;
}

.cell-caption {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 24px;
  padding: 0.15rem 0.55rem;
  color: #ead9b7;
  border: 1px solid rgba(225, 199, 151, 0.18);
  border-radius: 2px;
  background: rgba(38, 28, 20, 0.82);
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.2s, transform 0.2s;
}

.shelf-cell:hover .cell-caption,
.shelf-cell:focus-visible .cell-caption {
  opacity: 1;
  transform: translateY(0);
}

.cell-caption small {
  color: #bfae90;
  font-family: var(--font-latin);
  font-size: 0.62rem;
}

.mini-books {
  position: absolute;
  right: 7px;
  bottom: 5px;
  left: 7px;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 0;
  height: 66.67%;
  overflow: hidden;
  pointer-events: none;
}

.mini-book {
  flex: 1 1 var(--mini-width, 6px);
  width: auto;
  min-width: 2px;
  max-width: 12%;
  height: 100%;
  border: 0;
  border-right: 1px solid rgba(232, 225, 212, 0.24);
  border-radius: 1px 1px 0 0;
  background:
    linear-gradient(90deg, rgba(82, 52, 29, 0.07), transparent 16%, rgba(255, 249, 225, 0.14) 52%, transparent 88%, rgba(70, 43, 22, 0.06)),
    linear-gradient(180deg, rgba(255, 249, 226, 0.16), transparent 13%, transparent 90%, rgba(76, 47, 24, 0.06)),
    var(--book-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 226, 0.28),
    inset 0 -2px 0 rgba(67, 42, 22, 0.05),
    1px 0 1px rgba(76, 48, 25, 0.06),
    0 2px 3px rgba(72, 47, 25, 0.13);
  filter: saturate(0.9) contrast(0.93) sepia(0.04) brightness(1.05);
}

.mini-animals {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: end;
  max-width: calc(100% - 8px);
  pointer-events: none;
}

.mini-animal {
  width: clamp(22px, 23%, 44px);
  height: auto;
  aspect-ratio: 1;
  margin-left: -10px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.24));
}

.mini-animal:first-child {
  margin-left: 0;
}

.empty-cell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(234, 217, 183, 0.34);
  font-family: var(--font-latin);
  font-size: 1.6rem;
  pointer-events: none;
}

.loading-card {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.6rem;
  color: var(--muted);
  background: rgba(243, 236, 220, 0.86);
  backdrop-filter: blur(8px);
  transition: opacity 0.35s;
}

.loading-card p {
  margin: 0;
  font-size: 0.86rem;
}

.loading-mark {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(168, 122, 19, 0.25);
  border-top-color: var(--honey);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.placeholder-note {
  position: absolute;
  right: 1.2rem;
  bottom: 1rem;
  left: 1.2rem;
  z-index: 2;
  width: fit-content;
  max-width: calc(100% - 2.4rem);
  margin: auto;
  padding: 0.4rem 0.8rem;
  color: var(--muted);
  border: 1px solid rgba(168, 122, 19, 0.22);
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.85);
  font-size: 0.72rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.placeholder-note span {
  margin-right: 0.45rem;
  color: var(--honey);
  font-weight: 600;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 4rem;
  align-items: center;
  width: min(1100px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 0 0 5rem;
}

.about-card p:not(.eyebrow) {
  max-width: 620px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.78rem;
}

.about-links span {
  color: var(--faint);
}

.about-portrait {
  margin: 0;
  padding: 0.7rem 0.7rem 0.85rem;
  border: 1px solid rgba(118, 84, 58, 0.34);
  border-radius: 4px;
  background: #f8eed7;
  box-shadow:
    0 18px 45px rgba(51, 33, 16, 0.22),
    inset 0 0 0 1px rgba(255, 250, 233, 0.7);
  transform: rotate(1deg);
}

.about-portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  filter: saturate(1.05) contrast(1.02);
}

.about-portrait figcaption {
  padding-top: 0.65rem;
  color: var(--muted);
  font-family: var(--font-hand);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem 1.5rem;
  width: min(1240px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-family: var(--font-latin);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(244, 237, 222, 0.72);
  backdrop-filter: blur(20px) saturate(0.82);
  -webkit-backdrop-filter: blur(20px) saturate(0.82);
}

.shelf-overlay {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  pointer-events: none;
}

.shelf-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1320px, 96vw);
  height: min(820px, 90vh);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.shelf-panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.4rem 0.5rem 1.1rem;
  border-bottom: 1px solid rgba(97, 70, 42, 0.16);
}

.shelf-panel-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 500;
}

.shelf-panel-header p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.close-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.close-button:hover {
  color: var(--ink);
  border-color: var(--honey);
  transform: rotate(5deg);
}

.close-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.shelf-panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 1rem 0.5rem 0.4rem;
}

.shelf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-bottom: 0.9rem;
  color: var(--faint);
  font-size: 0.74rem;
}

.shelf-interaction-hint {
  margin: 0.85rem 0 0;
  color: var(--faint);
  font-size: 0.72rem;
  text-align: center;
}

.book-row-wrap {
  position: relative;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 250, 235, 0.48), transparent 64%);
  box-shadow: none;
}

.book-row-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
  border-top: 1px solid rgba(85, 58, 34, 0.2);
  background:
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(79, 52, 29, 0.045) 26px 28px),
    rgba(151, 112, 73, 0.52);
  box-shadow: 0 -5px 16px rgba(61, 41, 22, 0.08);
  backdrop-filter: blur(8px);
}

.book-row {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 100%;
  padding: 2.2rem 2rem 25px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(118, 84, 58, 0.4) transparent;
}

.book-row-wrap.has-animals .book-row {
  padding-right: clamp(360px, 44%, 600px);
}

.book-spine {
  position: relative;
  flex: 0 0 auto;
  width: clamp(52px, calc(var(--thickness, 40) * 1.56px), 124px);
  height: min(78%, 330px);
  min-height: 210px;
  padding: 16px 7px 11px;
  overflow: hidden;
  color: var(--text-color, #fffaf0);
  border: 1px solid rgba(228, 219, 203, 0.28);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 18%, rgba(255, 255, 255, 0.09) 52%, rgba(0, 0, 0, 0.05)),
    var(--book-color);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    inset 0 2px 0 rgba(255, 249, 232, 0.1),
    1px 2px 3px rgba(55, 37, 20, 0.1);
  cursor: pointer;
  transform-origin: bottom center;
  filter: saturate(0.94) contrast(0.97);
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease), filter 0.32s;
}

.book-spine::before,
.book-spine::after {
  content: "";
  position: absolute;
  right: 5px;
  left: 5px;
  height: 1px;
  background: currentColor;
  opacity: 0.12;
}

.book-spine::before {
  top: 8px;
}

.book-spine::after {
  bottom: 8px;
}

.book-spine:hover,
.book-spine:focus-visible {
  z-index: 3;
  filter: saturate(0.98) brightness(1.04);
  box-shadow: 0 12px 18px rgba(46, 30, 15, 0.16);
  transform: translateY(-8px);
}

.spine-title {
  display: block;
  width: 100%;
  height: 100%;
  font-family: var(--font-hand);
  font-size: clamp(0.76rem, 1.15vw, 0.95rem);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.spine-title.is-long {
  font-size: clamp(0.78rem, 1.05vw, 0.92rem);
  letter-spacing: 0.01em;
  line-height: 1.18;
}

.spine-title:lang(zh) {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Kaiti TC", "FZKai-Z03", "Segoe Print", cursive;
  font-size: clamp(0.96rem, 1.6vw, 1.22rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 1px 1px rgba(0, 0, 0, 0.14);
}

.spine-title:lang(zh).is-long {
  font-size: clamp(0.82rem, 1.1vw, 0.98rem);
}

.spine-title.is-very-long {
  font-size: clamp(0.66rem, 0.88vw, 0.8rem);
  letter-spacing: 0;
  line-height: 1.12;
}

.spine-title:lang(zh).is-very-long {
  font-size: clamp(0.7rem, 0.92vw, 0.84rem);
}

.spine-number {
  position: absolute;
  right: 0;
  bottom: 13px;
  left: 0;
  font-family: var(--font-latin);
  font-size: 0.55rem;
  text-align: center;
  opacity: 0.62;
}

.empty-books {
  display: grid;
  flex: 1;
  place-content: center;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.shelf-animals {
  position: absolute;
  right: clamp(0.5rem, 2vw, 1.5rem);
  bottom: 22px;
  z-index: 4;
  display: flex;
  align-items: end;
  gap: clamp(2px, 0.45vw, 7px);
  pointer-events: auto;
}

.shelf-resident {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  width: clamp(74px, 7.2vw, 104px);
  height: clamp(140px, 19vw, 225px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 7px rgba(61, 41, 22, 0.14));
  transition: filter 0.25s, transform 0.25s var(--ease);
}

.shelf-resident img,
.shelf-resident .animal-fallback {
  width: 100%;
  height: calc(100% - 24px);
  object-fit: contain;
  transform-origin: bottom center;
  transition: transform 0.3s var(--ease);
}

.shelf-resident:hover,
.shelf-resident:focus-visible {
  filter: drop-shadow(0 12px 9px rgba(61, 41, 22, 0.2));
  transform: translateY(-3px);
}

.shelf-resident:hover img,
.shelf-resident:focus-visible img {
  transform: translateY(-5px) rotate(-1deg);
}

.animal-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-hand);
  font-size: 0.68rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animal-fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  font-family: var(--font-hand);
  font-size: 2rem;
}

.citation-tooltip {
  position: fixed;
  z-index: 300;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  color: #eee6d6;
  border: 1px solid rgba(232, 213, 174, 0.22);
  border-radius: 5px;
  background: rgba(38, 31, 23, 0.86);
  box-shadow: 0 14px 34px rgba(20, 13, 7, 0.28);
  font-family: var(--font-latin);
  font-size: 0.78rem;
  line-height: 1.6;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.citation-tooltip cite {
  font-style: italic;
}

.book-flight {
  position: fixed;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
  color: var(--flight-text, #fffaf0);
  border: 1px solid rgba(33, 24, 15, 0.3);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.17), transparent 35%, rgba(255, 255, 255, 0.12)),
    var(--flight-color);
  box-shadow: 0 24px 50px rgba(25, 15, 8, 0.35);
  font-family: var(--font-hand);
  pointer-events: none;
}

.book-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(244, 237, 222, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.open-book {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(340px, 1.2fr);
  width: min(960px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 34px 90px rgba(46, 30, 15, 0.2);
  perspective: 1600px;
}

.book-cover-page {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 560px;
  padding: 2rem;
  overflow: hidden;
  color: var(--cover-text, #fffaf0);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 12%, rgba(255, 255, 255, 0.08) 52%, rgba(0, 0, 0, 0.16)),
    var(--cover-color);
}

.book-cover-page::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 18px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18));
}

.cover-kicker {
  font-family: var(--font-latin);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  opacity: 0.75;
  text-transform: uppercase;
}

.cover-title {
  margin: 1rem 0;
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  line-height: 1.35;
}

.cover-author {
  font-family: var(--font-latin);
  font-size: 0.86rem;
  opacity: 0.82;
}

.cover-seal {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: 1.4rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-cjk);
  font-size: 0.72rem;
  opacity: 0.7;
}

.book-data-page {
  position: relative;
  min-width: 0;
  max-height: 88vh;
  padding: 2rem 2.2rem;
  overflow-y: auto;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(91, 67, 38, 0.016) 5px 6px),
    rgba(251, 247, 238, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform-origin: left center;
}

.book-data-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 2.5rem;
}

.book-data-header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.8vw, 1.85rem);
  font-weight: 500;
}

.book-data-header .close-button {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
}

.citation-block {
  margin: 1rem 0 1.4rem;
  padding: 0.85rem 1rem;
  color: var(--muted);
  border-left: 2px solid var(--honey);
  background: rgba(168, 122, 19, 0.055);
  font-family: var(--font-latin);
  font-size: 0.8rem;
  line-height: 1.65;
}

.citation-block cite {
  font-style: italic;
}

.book-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.book-table th,
.book-table td {
  padding: 0.58rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.book-table th {
  width: 32%;
  color: var(--muted);
  font-weight: 500;
}

.book-table td {
  overflow-wrap: anywhere;
}

.book-table a {
  overflow-wrap: anywhere;
}

.status-pill,
.demo-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.66rem;
  line-height: 1.6;
}

.status-verified {
  color: #53644b;
  border-color: rgba(83, 100, 75, 0.3);
  background: rgba(83, 100, 75, 0.08);
}

.status-unverified,
.status-needs-review {
  color: #91661c;
  border-color: rgba(168, 122, 19, 0.28);
  background: rgba(168, 122, 19, 0.08);
}

.demo-pill {
  color: #8a4f43;
  border-color: rgba(138, 79, 67, 0.25);
  background: rgba(138, 79, 67, 0.07);
}

.book-notes {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.animal-pop {
  position: fixed;
  z-index: 320;
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  border: 1px solid rgba(168, 122, 19, 0.3);
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(40, 27, 14, 0.18);
  font-size: 0.78rem;
  pointer-events: none;
}

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 400;
  max-width: min(420px, calc(100vw - 2.4rem));
  padding: 0.75rem 1rem;
  color: #f4ecdc;
  border: 1px solid rgba(240, 220, 180, 0.2);
  border-radius: 5px;
  background: rgba(43, 34, 25, 0.96);
  box-shadow: 0 12px 30px rgba(25, 16, 9, 0.24);
  font-size: 0.8rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pageOpen {
  from { opacity: 0.25; transform: rotateY(-78deg); }
  to { opacity: 1; transform: rotateY(0deg); }
}

@keyframes animalBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-13px) rotate(-4deg); }
  65% { transform: translateY(2px) rotate(3deg); }
}

@keyframes animalWave {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  50% { transform: rotate(8deg); }
  75% { transform: rotate(-5deg); }
}

@keyframes animalNod {
  0%, 100% { transform: rotate(0) translateY(0); }
  40% { transform: rotate(6deg) translateY(4px); }
  70% { transform: rotate(-3deg) translateY(-2px); }
}

@keyframes animalSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(4deg); }
}

@keyframes animalSpin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(0.92); }
  100% { transform: rotate(360deg) scale(1); }
}

.animate-bounce { animation: animalBounce 0.75s var(--ease); }
.animate-wave { animation: animalWave 0.8s var(--ease); }
.animate-nod { animation: animalNod 0.9s var(--ease); }
.animate-sway { animation: animalSway 1s var(--ease); }
.animate-spin { animation: animalSpin 0.9s var(--ease); }

@media (max-width: 760px) {
  .header-inner {
    width: calc(100% - 2rem);
    min-height: 70px;
    gap: 1rem;
  }

  .brand-copy span,
  .main-nav a:not(.is-active),
  .admin-link span {
    display: none;
  }

  .main-nav {
    gap: 1rem;
  }

  .hero {
    width: calc(100% - 2rem);
    padding-top: 3rem;
  }

  .plaque {
    min-width: 0;
    width: 100%;
    padding: 1.4rem 2rem 1.25rem;
  }

  .plaque-line-two {
    letter-spacing: 0.08em;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 2.7rem;
  }

  .stats > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stats > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .section-heading {
    display: block;
  }

  .section-hint {
    margin-top: 0.5rem;
  }

  .study-section {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .study-stage {
    min-height: 560px;
    padding: 2rem 0.8rem 3rem;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: calc(100% - 2rem);
  }

  .about-portrait {
    max-width: 320px;
    margin: 0 auto;
    transform: none;
  }

  .site-footer {
    width: calc(100% - 2rem);
  }

  .shelf-overlay,
  .book-overlay {
    padding: 0.7rem;
  }

  .shelf-panel {
    width: 100%;
    height: 92vh;
  }

  .shelf-panel-header,
  .shelf-panel-body {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .book-row {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .book-row-wrap.has-animals .book-row {
    padding-right: min(82vw, 330px);
  }

  .shelf-animals {
    right: 0.35rem;
    gap: 0;
  }

  .shelf-resident {
    width: clamp(52px, 14.5vw, 74px);
    height: clamp(104px, 27vw, 150px);
  }

  .animal-name {
    display: none;
  }

  .shelf-resident img,
  .shelf-resident .animal-fallback {
    height: 100%;
  }

  .open-book {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
  }

  .book-cover-page {
    min-height: 220px;
  }

  .cover-seal {
    display: none;
  }

  .book-data-page {
    max-height: none;
    padding: 1.4rem 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
