@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,400;1,500&family=EB+Garamond:wght@400;500&family=Fraunces:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;600&family=Noto+Serif+TC:wght@400;500;600&display=swap");
:root {
  --bg: #302113;
  --ink: #24333a;
  --muted: #697b84;
  --gold: #34727c;
  --paper-ink: #29231c;
  --paper-muted: #74695b;
  --mono: "IBM Plex Mono", monospace;
  --display: "Noto Sans TC", "Helvetica Neue", sans-serif;
  --body: "Noto Sans TC", "Helvetica Neue", sans-serif;
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  overscroll-behavior: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.3;
  cursor: default;
}
button:hover {
  color: var(--gold);
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
#room {
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}
#bookcase {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
body[data-cover-pending=true] #bookcase { cursor: progress !important; }
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 25%,
    #08060535 65%,
    #070503a6 100%
  );
}
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  padding: 32px 4.4% 22px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 45px;
  transition: opacity 0.6s;
  background: linear-gradient(#f4f6f7f5, #f4f6f78a, transparent);
}
.eyebrow,
.mono {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  font-weight: 400;
  line-height: 1.8;
}
.eyebrow {
  color: var(--gold);
}
.identity {
  flex-shrink: 0;
}
.identity > .eyebrow i {
  font-style: normal;
  letter-spacing: 0.13em;
  font-size: 8px;
  margin-left: 16px;
  color: var(--muted);
}
h1 {
  font: 500 clamp(27px, 2.4vw, 40px) / 1.5 var(--display);
  margin: 13px 0 2px;
  letter-spacing: -0.7px;
}
h1 > span {
  display: inline-block;
  font: italic 23px var(--body);
  color: var(--muted);
  margin-left: 18px;
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.identity > p {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 7px 0 0;
}
.header-right {
  width: min(51%, 660px);
  padding-top: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 22px;
  margin-bottom: 26px;
}
.top-actions > button {
  font-size: 10px;
  white-space: nowrap;
  padding: 5px 0;
  letter-spacing: 0.05em;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #b0a69638;
  padding-bottom: 5px;
  flex: 1;
  max-width: 230px;
}
.search > span {
  font-size: 21px;
  line-height: 16px;
}
.search input {
  width: 100%;
  background: none;
  border: 0;
  font: 10px var(--mono);
  outline-offset: 4px;
  min-width: 0;
}
.search input::placeholder {
  color: #788992;
}
.search kbd {
  font: 9px var(--mono);
  opacity: 0.45;
}
#shelf-tabs {
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: 13px 22px;
}
#shelf-tabs button {
  position: relative;
  padding: 0 0 8px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}
#shelf-tabs sup {
  font: 8px var(--mono);
  margin-left: 4px;
  vertical-align: super;
  opacity: 0.6;
}
#shelf-tabs button:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--gold);
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease-out;
}
#shelf-tabs button[aria-selected="true"] {
  color: var(--ink);
}
#shelf-tabs button[aria-selected="true"]:after {
  transform: scaleX(1);
}
#caption {
  position: absolute;
  z-index: 5;
  left: 8%;
  top: 42%;
  width: 29%;
  max-width: 390px;
  transform: translateY(-25%);
}
#caption > .eyebrow {
  font-size: 9px;
  letter-spacing: 0.15em;
  line-height: 2;
}
#caption h2 {
  font: 400 clamp(22px, 2.4vw, 38px) / 1.65 var(--display);
  letter-spacing: -0.5px;
  margin: 17px 0 12px;
}
#caption .author {
  font:
    italic 18px/1.6 "Cormorant Garamond",
    "Noto Serif TC",
    serif;
  color: var(--muted);
  margin: 0;
}
.caption-hint {
  color: #75858d;
  font-size: 11px;
  line-height: 1.9;
  margin: 25px 0;
}
.caption-actions {
  display: flex;
  align-items: center;
  gap: 23px;
}
.text-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  font-size: 13px;
  border-bottom: 1px solid var(--gold);
  padding: 10px 0;
  color: var(--ink);
}
.caption-actions > button:last-child {
  font-size: 10px;
  color: var(--muted);
  padding: 10px 0;
}
.turn-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 19px;
}
.turn-controls button {
  width: 27px;
  height: 27px;
  border: 1px solid #a99e8833;
  border-radius: 50%;
  font-size: 16px;
}
.turn-controls span {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
#book-nav {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #ffffffd9;
  border: 1px solid #afc2ca66;
  backdrop-filter: blur(18px);
  border-radius: 50px;
  white-space: nowrap;
  gap: 5px;
}
#book-nav button {
  font-size: 11px;
  padding: 9px 15px;
}
#book-nav button:nth-child(2) {
  border-right: 1px solid #b6c5cc66;
  border-left: 1px solid #b6c5cc66;
  padding-left: 24px;
  padding-right: 24px;
}
#book-nav button:last-child {
  font-size: 9px;
  color: var(--muted);
}
#shelf-hint {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
  white-space: nowrap;
  transition: opacity 0.5s;
}
#shelf-hint > .mono {
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 0.25em;
  display: block;
}
#shelf-hint > span:nth-child(2) {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin: 6px 0 10px;
}
#shelf-hint > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#shelf-hint button {
  font: 18px Georgia;
  padding: 0 8px;
}
#shelf-position {
  font: 9px var(--mono);
  letter-spacing: 0.12em;
  color: var(--muted);
}
#fine-print {
  position: absolute;
  bottom: 20px;
  left: 4.4%;
  right: 4.4%;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 25px;
  z-index: 4;
  transition: opacity 0.5s;
}
#fine-print > p {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: #637680;
  margin: 0;
}
#fine-print > div {
  display: flex;
  gap: 20px;
}
#fine-print button {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  padding: 5px 0;
}
body[data-phase="present"] #fine-print,
body[data-phase="pulling"] #fine-print,
body[data-phase="opening"] #fine-print,
body[data-phase="open"] #fine-print,
body[data-phase="closing"] #fine-print,
body[data-phase="returning"] #fine-print {
  opacity: 0;
  pointer-events: none;
}
body:not([data-phase="shelf"]) #shelf-hint {
  opacity: 0;
  pointer-events: none;
}

#loader {
  position: absolute;
  inset: 0;
  background: #f4f6f7;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 25px;
  transition: opacity 0.7s;
}
#loader p {
  font: 400 24px var(--display);
  letter-spacing: 0.1em;
  margin: 0;
}
.loading-line {
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: pulse 1.4s ease-in-out infinite;
}
#loader.done {
  opacity: 0;
  pointer-events: none;
}
@keyframes pulse {
  50% {
    transform: scaleX(0.4);
    opacity: 0.3;
  }
}
#printed-note {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  width: 1000px;
  container-type: size;
  color: var(--paper-ink);
  mix-blend-mode: multiply;
  overflow: hidden;
  pointer-events: auto;
}
.page-content {
  position: absolute;
  inset: 0;
  padding: 11cqw 10cqw 7cqw;
  display: flex;
  flex-direction: column;
}
.page-meta {
  font: 2.2cqw/1.9 var(--mono);
  letter-spacing: 0.12em;
  color: var(--paper-muted);
  padding-bottom: 4cqw;
  border-bottom: 0.15cqw solid #9d8d6c60;
}
.page-content > h3 {
  font: 500 8cqw/1.2 var(--display);
  letter-spacing: -0.2cqw;
  margin: 8cqw 0 4cqw;
}
.page-rule {
  width: 11cqw;
  border-top: 0.25cqw solid #8b3e30;
  margin-bottom: 5cqw;
}
.page-note {
  font: 3.65cqw/1.85 var(--body);
  text-align: justify;
  margin: 0;
  max-height: 37cqw;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #8f7a5f55 transparent;
  white-space: pre-wrap;
}
.page-content h4 {
  font: 2.2cqw/1.8 var(--mono);
  letter-spacing: 0.15em;
  margin: 7cqw 0 3cqw;
  font-weight: 400;
}
.page-content h4 span {
  font-size: 2cqw;
  letter-spacing: 0.02em;
  color: var(--paper-muted);
  display: block;
  margin-top: 1cqw;
}
.page-content ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: takeaway;
}
.page-content li {
  display: flex;
  gap: 4cqw;
  padding: 3cqw 0;
  border-top: 0.12cqw solid #a6977c66;
  font: 3cqw/1.7 var(--body);
}
.page-content li:before {
  counter-increment: takeaway;
  content: counter(takeaway, lower-roman);
  font:
    italic 4cqw "Cormorant Garamond",
    serif;
  color: #7b372b;
  min-width: 5cqw;
}
.page-foot {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6cqw;
  font: 2cqw var(--mono);
  letter-spacing: 0.12em;
  color: var(--paper-muted);
}
.mobile-title {
  display: none;
}
.skip {
  position: fixed;
  left: 15px;
  top: -100px;
  background: var(--paper-ink);
  padding: 12px;
  z-index: 100;
  font-size: 13px;
}
.skip:focus {
  top: 15px;
}
dialog {
  background: #ffffff;
  color: var(--paper-ink);
  border: 1px solid #b6c7d055;
  padding: 40px;
  max-height: 90dvh;
  overflow: auto;
  width: min(1080px, 94vw);
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #c7d5dd80;
  backdrop-filter: blur(8px);
}
dialog .eyebrow {
  color: #34727c;
}
dialog h2 {
  font: 400 30px/1.7 var(--display);
  margin: 16px 45px 18px 0;
}
dialog p {
  font-size: 13px;
  line-height: 2;
  color: #647780;
}
.dialog-close {
  position: sticky;
  float: right;
  top: 0;
  width: 32px;
  height: 32px;
  margin: -15px -15px 0 0;
  background: #f3f7f8;
  border: 1px solid #cbd9df;
  border-radius: 50%;
  font: 24px Georgia;
  z-index: 8;
  line-height: 1;
}
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid #c7d4da88;
  border-bottom: 1px solid #c7d4da88;
}
.catalog-toolbar label,
.status-fields label {
  display: grid;
  gap: 7px;
  font: 10px var(--mono);
  letter-spacing: 0.05em;
  color: var(--paper-muted);
}
select {
  font: 12px var(--body);
  padding: 7px 15px 7px 0;
  border: 0;
  border-bottom: 1px solid #c1d0d7;
  background: transparent;
  border-radius: 0;
  max-width: 200px;
}
.view-switch {
  display: flex;
  gap: 6px;
}
.view-switch button {
  font-size: 11px;
  padding: 10px;
  border-bottom: 1px solid #aabfc9;
}
.view-switch button.active {
  background: #2b505a;
  color: #ffffff;
}
.catalog-toolbar > button {
  font-size: 10px;
  padding: 10px;
}
#catalog-count {
  font-size: 9px;
  color: var(--paper-muted);
  margin: 20px 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 27px 20px;
}
.catalog-card {
  padding: 0;
  text-align: left;
  min-width: 0;
}
.catalog-card .thumbnail {
  aspect-ratio: 0.67;
  background: #e6ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.catalog-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: scale 0.4s;
}
.catalog-card:hover img {
  scale: 1.04;
}
.missing-cover {
  font: 10px/2 var(--mono);
  letter-spacing: 0.1em;
  color: #6d7f88;
  text-align: center;
}
.missing-cover small {
  display: block;
  font-size: 8px;
  margin-top: 8px;
}
.catalog-card > small {
  display: block;
  font: 8px var(--mono);
  color: var(--paper-muted);
  margin: 12px 0 6px;
  line-height: 1.7;
}
.catalog-card h3 {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.9;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card > p {
  font-size: 9px;
  line-height: 1.7;
  margin: 5px 0;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 730px;
  text-align: left;
}
th {
  font: 10px var(--mono);
  color: var(--paper-muted);
  font-weight: 400;
  padding: 13px 10px;
  border-bottom: 1px solid #c7d4da88;
}
td {
  font-size: 12px;
  padding: 18px 10px;
  border-bottom: 1px solid #c7d4da88;
}
td button {
  padding: 0;
  text-align: left;
  font-size: 13px;
}
td small {
  display: block;
  color: var(--paper-muted);
  font-size: 10px;
  line-height: 1.8;
  margin-top: 5px;
}
td:first-child {
  font: 10px var(--mono);
  color: var(--paper-muted);
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  margin-top: 30px;
  font: 11px var(--mono);
}
.pagination button {
  font-size: 11px;
}
#editor-dialog {
  width: min(650px, 94vw);
}
#editor-dialog .author {
  font-size: 14px;
  color: var(--paper-muted);
}
#book-metadata dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
  margin: 20px 0;
}
#book-metadata dl > div {
  border-top: 1px solid #c7d4da88;
  padding: 12px 0;
  display: flex;
  gap: 18px;
  font-size: 11px;
  line-height: 1.8;
}
dt {
  color: var(--paper-muted);
  min-width: 55px;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
details {
  font-size: 12px;
  line-height: 1.9;
  padding: 16px 0;
  border-top: 1px solid #c7d4da88;
}
summary {
  cursor: pointer;
  font-size: 12px;
}
#source-content p {
  font-size: 11px;
}
#source-content img {
  max-width: 160px;
  max-height: 230px;
  object-fit: contain;
  display: block;
}
#source-content a {
  display: block;
  font-size: 11px;
  color: #34727c;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.status-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.status-fields select {
  max-width: none;
}
#personal-form > label {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  font-size: 12px;
}
#personal-form small {
  font-size: 10px;
  color: var(--paper-muted);
}
textarea,
input {
  background: none;
  border: 1px solid #c7d4da88;
  border-radius: 0;
  padding: 12px;
  min-width: 0;
}
textarea {
  resize: vertical;
  font: 13px/1.9 var(--body);
}
#personal-form input {
  font-size: 12px;
  padding: 10px;
}
#personal-form .save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 20px;
}
.save-row span {
  font-size: 10px;
  color: var(--paper-muted);
}
.save-row button,
.read-selected {
  font-size: 12px;
  border-bottom: 1px solid #7298a4;
  padding: 10px 0;
}
#bibliography-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 20px 0;
}
#bibliography-fields label {
  display: grid;
  gap: 7px;
  font-size: 11px;
}
#bibliography-fields input {
  width: 100%;
  font-size: 12px;
}
#bibliography-form > button {
  background: #245765;
  color: #ffffff;
  font-size: 11px;
  padding: 10px 15px;
}
.read-selected {
  margin-top: 20px;
}
#about-dialog {
  width: min(650px, 94vw);
}
#about-dialog p {
  font-size: 12px;
  line-height: 2.1;
}
#cover-stats {
  font: 10px/2 var(--mono);
  color: #34727c;
  margin: 20px 0;
}
#measure {
  font-size: 11px;
  padding: 12px 0;
  border-bottom: 1px solid #c5d4da;
}
#performance-output {
  font: 10px/1.9 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  z-index: 60;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 20px);
  max-width: 90vw;
  padding: 13px 20px;
  background: #ffffff;
  color: #24333a;
  font-size: 11px;
  line-height: 1.8;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#fallback {
  padding: 45px 5%;
  min-height: 100dvh;
  background: var(--bg);
  overflow: auto;
}
body.fallback {
  overflow: auto;
}
body.fallback #room {
  display: none;
}
#fallback h1 {
  font-size: 32px;
}
#fallback > p {
  font-size: 13px;
  line-height: 2;
  color: var(--muted);
}
#fallback-books {
  display: grid;
  gap: 0;
  margin: 35px 0;
}
#fallback-books > button {
  padding: 17px 0;
  text-align: left;
  border-top: 1px solid #b6c7cf66;
  font-size: 15px;
  line-height: 1.8;
}
#fallback-books small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
#fallback .fallback-fine {
  font: 9px/2 var(--mono);
}
noscript {
  position: fixed;
  bottom: 10px;
  left: 5%;
  font-size: 12px;
  z-index: 100;
}
@media (max-width: 1100px) {
  header {
    gap: 20px;
    padding-top: 26px;
  }
  .header-right {
    width: 52%;
  }
  .top-actions {
    gap: 15px;
  }
  h1 > span {
    display: block;
    margin: 1px 0 0;
    font-size: 21px;
  }
  .identity > .eyebrow i {
    display: none;
  }
  #shelf-tabs {
    gap: 13px 18px;
  }
  .top-actions > button {
    font-size: 9px;
  }
  .search {
    max-width: 190px;
  }
  #caption {
    left: 6%;
    width: 32%;
  }
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 759px) {
  header {
    display: block;
    padding: 24px 6% 20px;
    background: linear-gradient(#f4f6f7f5, #f4f6f7ab, transparent);
  }
  .identity > .eyebrow {
    font-size: 9px;
  }
  .identity > .eyebrow i {
    display: inline;
    font-size: 7px;
    margin-left: 12px;
  }
  .identity h1 {
    font-size: 29px;
    margin: 9px 0 2px;
    line-height: 1.5;
  }
  .identity h1 > span {
    display: inline-block;
    font-size: 20px;
    margin-left: 13px;
  }
  .identity > p {
    display: none;
  }
  .header-right {
    width: 100%;
    margin-top: 16px;
  }
  .top-actions {
    justify-content: start;
    gap: 18px;
    margin-bottom: 18px;
  }
  .search {
    max-width: none;
  }
  .top-actions > button {
    font-size: 9px;
  }
  .search input {
    font-size: 9px;
  }
  .search > span {
    font-size: 18px;
  }
  #shelf-tabs {
    justify-content: start;
    gap: 11px 18px;
  }
  #shelf-tabs button {
    font-size: 10px;
    padding-bottom: 6px;
  }
  #shelf-tabs sup {
    font-size: 7px;
  }
  #fine-print {
    left: 6%;
    right: 6%;
    bottom: 16px;
    display: block;
  }
  #fine-print > p {
    font-size: 7px;
    line-height: 1.9;
  }
  #fine-print > div {
    gap: 18px;
    margin-top: 8px;
  }
  #fine-print button {
    font-size: 8px;
  }
  #shelf-hint {
    bottom: 107px;
  }
  #shelf-hint > span:nth-child(2) {
    font-size: 9px;
  }
  #shelf-hint > .mono {
    font-size: 7px;
  }
  #shelf-hint > div {
    gap: 16px;
    margin-top: 8px;
  }
  #shelf-position {
    font-size: 8px;
  }
  #caption {
    left: 6%;
    right: 6%;
    top: auto;
    bottom: 108px;
    max-width: none;
    width: auto;
    transform: none;
    text-align: center;
  }
  #caption > .eyebrow {
    font-size: 8px;
    letter-spacing: 0.1em;
  }
  #caption h2 {
    font-size: 23px;
    line-height: 1.6;
    margin: 10px 0 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #caption .author {
    font-size: 13px;
  }
  .caption-hint {
    display: none;
  }
  .caption-actions {
    justify-content: center;
    gap: 23px;
    margin-top: 14px;
  }
  .text-button {
    font-size: 12px;
    padding: 8px 0;
    gap: 25px;
  }
  .caption-actions > button:last-child {
    font-size: 9px;
  }
  .turn-controls {
    justify-content: center;
    margin-top: 12px;
  }
  .turn-controls span {
    font-size: 8px;
  }
  .turn-controls button {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  #book-nav {
    bottom: 27px;
    padding: 5px 8px;
    max-width: 95vw;
    gap: 0;
  }
  #book-nav button {
    font-size: 10px;
    padding: 9px 11px;
  }
  #book-nav button:nth-child(2) {
    padding-left: 15px;
    padding-right: 15px;
  }
  #book-nav button:last-child {
    font-size: 8px;
    padding-left: 12px;
  }
  body[data-phase="present"] #book-nav button:nth-child(2) {
    display: none;
  }
  .page-content {
    padding: 9cqw 9cqw 6cqw;
  }
  .page-meta {
    font-size: 2.2cqw;
  }
  .mobile-title {
    display: block;
  }
  .mobile-title h2 {
    font: 500 5.5cqw/1.65 var(--display);
    margin: 5cqw 0 1cqw;
  }
  .mobile-title p {
    font: italic 3.3cqw/1.6 var(--body);
    margin: 0;
    color: var(--paper-muted);
  }
  .page-content > h3 {
    font-size: 7cqw;
    margin-top: 5cqw;
  }
  .page-note {
    font-size: 3.8cqw;
    max-height: 31cqw;
  }
  .page-content h4 {
    font-size: 2.3cqw;
    margin-top: 5cqw;
  }
  .page-content li {
    font-size: 3cqw;
    padding: 2.5cqw 0;
  }
  .page-foot {
    font-size: 2cqw;
    padding-top: 4cqw;
  }
  dialog {
    padding: 27px 22px;
    max-height: 93dvh;
  }
  dialog h2 {
    font-size: 24px;
    margin-top: 16px;
  }
  .dialog-close {
    margin: -12px -8px 0 0;
  }
  .catalog-toolbar {
    gap: 15px;
  }
  .catalog-toolbar label {
    width: calc(50% - 8px);
    font-size: 9px;
  }
  .catalog-toolbar select {
    max-width: none;
    width: 100%;
    font-size: 11px;
  }
  .view-switch {
    width: 100%;
  }
  .view-switch button {
    flex: 1;
    font-size: 10px;
  }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px 18px;
  }
  .catalog-card > small {
    font-size: 7px;
  }
  .catalog-card h3 {
    font-size: 12px;
  }
  .catalog-card > p {
    font-size: 10px;
  }
  #book-metadata dl {
    display: block;
  }
  #book-metadata dl > div {
    font-size: 11px;
    padding: 10px 0;
  }
  #editor-dialog .author {
    font-size: 12px;
  }
  #bibliography-fields {
    grid-template-columns: 1fr;
  }
  #fallback {
    padding: 30px 6%;
  }
  #fallback h1 {
    font-size: 27px;
  }
  .pagination {
    gap: 20px;
    font-size: 9px;
  }
  .pagination button {
    font-size: 10px;
  }
}
@media (max-width: 370px) {
  .identity h1 {
    font-size: 26px;
  }
  .identity h1 > span {
    font-size: 17px;
    margin-left: 10px;
  }
  #shelf-tabs {
    gap: 10px 15px;
  }
  .top-actions {
    gap: 12px;
  }
  #book-nav button {
    padding: 8px 9px;
  }
  #caption h2 {
    font-size: 21px;
  }
  .identity > .eyebrow i {
    font-size: 6px;
  }
}
#shelf-hint {
  bottom: 20px;
}
#shelf-hint > span {
  display: none !important;
}
#shelf-hint > div {
  margin: 0;
}
#room .page-content > h3 {
  font-size: 7.2cqw;
}
#printed-note.landscape .page-content {
  padding: 5cqw 8cqw;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#printed-note.landscape .page-content > h3 {
  font-size: 5cqw;
  margin: 3cqw 0 2cqw;
}
#printed-note.landscape .page-rule {
  margin-bottom: 2cqw;
}
#printed-note.landscape .page-note {
  font-size: 2.7cqw;
  max-height: none;
  min-height: 5cqw;
}
#printed-note.landscape .page-content h4 {
  margin: 2cqw 0 1cqw;
  font-size: 1.8cqw;
}
#printed-note.landscape .page-content li {
  font-size: 2.2cqw;
  padding: 1cqw 0;
}
#printed-note.landscape .page-content li:before {
  font-size: 2.5cqw;
}
#printed-note.landscape .page-foot {
  font-size: 1.8cqw;
  padding-top: 2cqw;
}
@media (max-width: 759px) {
  #shelf-hint {
    bottom: 105px;
  }
}
.page-content {
  padding: 9cqw 9cqw 7cqw;
}
.page-meta {
  font-size: 2.1cqw;
  line-height: 1.7;
  padding-bottom: 3cqw;
}
#room .page-content > h3 {
  font-size: 6.8cqw;
  margin: 5cqw 0 3cqw;
}
.page-rule {
  margin-bottom: 3cqw;
}
.page-note {
  font-size: 3.2cqw;
  line-height: 1.75;
  max-height: 44cqw;
}
.page-content h4 {
  font-size: 2cqw;
  margin: 5cqw 0 2cqw;
}
.page-content h4 span {
  font-size: 1.8cqw;
  line-height: 1.6;
}
.page-content li {
  font-size: 2.8cqw;
  line-height: 1.6;
  padding: 2cqw 0;
}
.page-content li:before {
  font-size: 3.3cqw;
}
.page-foot {
  font-size: 1.9cqw;
  padding-top: 4cqw;
}
.portrait .mobile-title {
  display: block;
}
.portrait .page-content {
  padding: 6cqw 8cqw 5cqw;
}
.portrait .page-meta {
  font-size: 2cqw;
  padding-bottom: 2cqw;
}
.portrait .mobile-title h2 {
  font: 500 5cqw/1.5 var(--display);
  margin: 3cqw 0 1cqw;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.portrait .mobile-title p {
  font: italic 2.8cqw/1.5 var(--body);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portrait #printed-note .page-content > h3 {
  font-size: 5.5cqw;
  margin: 3cqw 0 2cqw;
}
.portrait .page-note {
  font-size: 3.4cqw;
  line-height: 1.7;
  max-height: 33cqw;
}
.portrait .page-content h4 {
  margin: 3cqw 0 1cqw;
  font-size: 2cqw;
}
.portrait .page-content li {
  font-size: 2.8cqw;
  padding: 1.7cqw 0;
}
.portrait .page-foot {
  font-size: 1.8cqw;
  padding-top: 2cqw;
}
@media(max-width:759px){#shelf-hint{bottom:76px}}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Modern white architectural display: neutral material, hidden linear light. */
:root{color-scheme:light}
.appearance-option{display:block;margin:25px 0;font-size:12px;color:#647780}
.appearance-option select{display:block;width:100%;margin-top:9px;padding:12px;border:1px solid #c5d5dc;border-radius:3px;background:#f5f8fa;color:#24333a;font:12px var(--body)}
.vignette{background:radial-gradient(ellipse at 50% 45%,transparent 45%,#e3edf322 100%)}
header{background:linear-gradient(#f4f6f7f5,#f4f6f780,transparent)}
h1{font-weight:500;letter-spacing:-1.5px}
h1>span{font:400 13px var(--mono);letter-spacing:.04em;margin-left:20px}
.identity>p{font-size:10px;letter-spacing:.13em}
#caption h2{font-weight:500;line-height:1.5}
#caption .author{font:400 13px/1.8 var(--body);color:#617680}
#caption .caption-hint{color:#70858e}
#book-nav{border-radius:6px;box-shadow:0 8px 32px #456b7b0a;background:#fffffff0}
#book-nav button{font-family:var(--body)}
#fine-print{color:#617680}
#loader{background:#f4f6f7}
dialog{border-radius:5px;background:#ffffff;color:#24333a;box-shadow:0 24px 100px #456b7b24}
dialog::backdrop{background:#bdcdd880;backdrop-filter:blur(12px)}
.catalog-card h3{font-family:var(--body);font-weight:500}
.missing-cover{background:#edf2f4;border-color:#d5dfe4;color:#7b8e96}
.page-content{font-family:'EB Garamond','Noto Serif TC',serif}
@media(max-width:759px){h1>span{font-size:10px;margin-left:12px}header{background:linear-gradient(#f4f6f7fc,#f4f6f7ad,transparent)}}



/* Bright, continuous architectural shelf. */
:root{--bg:#302113;--ink:#222c30;--muted:#657176;--gold:#395d64;--display:'Manrope','Noto Sans TC',sans-serif;--paper-ink:#283036;--paper-muted:#758087}
.vignette{background:radial-gradient(ellipse at 50% 55%,transparent 45%,#d1cfc315 100%)}
#header{padding:28px 4.2% 0;display:block;background:none;pointer-events:none}#header>*{pointer-events:auto}
.topline{display:flex;justify-content:space-between;align-items:center;gap:24px}.wordmark{font:700 14px/.95 'Manrope',sans-serif;letter-spacing:-.05em;width:110px}.wordmark>span{display:none}
.top-actions{margin:0;gap:30px;align-items:center}.top-actions>button{font:400 14px var(--body);letter-spacing:0;padding:5px 0}
.collection-header{display:grid;grid-template-columns:1fr 240px;column-gap:35px;margin-top:25px;align-items:center;transition:opacity .3s}
.collection-intro{display:flex;align-items:baseline;gap:24px}#header h1{font:500 36px/1.3 var(--body);letter-spacing:.035em;white-space:nowrap;margin:0}
.collection-summary{font:14px/1.7 var(--body);color:#637177;margin:0}.collection-summary>span{margin-left:20px;white-space:nowrap}
.search{max-width:none;width:100%;border-bottom:1px solid #b5bdbb;padding-bottom:8px;gap:10px;margin:0}.search svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.5;fill:none;flex:none}.search input{font:14px var(--body)}.search input::placeholder{color:#6d797c}
#category-caption{display:none}#shelf-tabs{grid-column:1/-1;display:flex;gap:30px;justify-content:flex-start;flex-wrap:nowrap;overflow:auto;scrollbar-width:none;margin-top:24px;padding:0 0 15px;border-bottom:1px solid #d9dedb}
#shelf-tabs button{font:400 14px/1.5 var(--body);padding:0 0 5px;color:#66777a;flex:none;white-space:nowrap}#shelf-tabs button[aria-selected=true]{color:#26383d;font-weight:600}#shelf-tabs sup{display:none}
body:not([data-phase=shelf]):not([data-phase=transition]) .collection-header{opacity:0;pointer-events:none}
#caption{top:40%;transform:translateY(-10%);left:6%;width:30%;max-width:410px}#caption h2{font:500 clamp(27px,3vw,44px)/1.45 var(--body);letter-spacing:-.035em;margin:18px 0}#caption>.eyebrow{font:13px var(--mono);letter-spacing:.04em}#caption .author{font:15px/1.7 var(--body);color:#5c707a}#caption .caption-hint{font:12px/1.7 var(--body);color:#68777d;margin-top:22px}.caption-actions button{font:15px var(--body)}
#book-nav{background:#fffffff0;border:1px solid #bcc8cb;border-radius:4px;box-shadow:0 12px 30px #253c4b0a}#book-nav button{font-size:13px;padding:12px 18px}
#fine-print{display:flex;align-items:center;justify-content:space-between;left:4.2%;right:4.2%;bottom:22px;color:#536871;font-family:var(--body)}#fine-print p{font:14px/1.4 var(--body);letter-spacing:0;margin:0;color:inherit}#fine-print button{font:14px var(--body);letter-spacing:0;padding:10px 0;color:inherit}
#shelf-hint{left:50%;bottom:22px;transform:translateX(-50%)}#shelf-hint>div{gap:22px;align-items:center}#shelf-hint button{width:36px;height:36px;border:1px solid #9aa9ac66;border-radius:50%;font:18px var(--body)}#shelf-position{font:12px var(--mono);letter-spacing:.06em;min-width:85px}
.collection-tools{display:flex;gap:20px;flex-wrap:wrap;margin:25px 0;font:13px var(--body)}dialog{background:#fffefa;color:#26343c;border:1px solid #c5cfce;border-radius:4px}dialog::backdrop{background:#9ba9ad55;backdrop-filter:blur(12px)}dialog h2{font-family:var(--body);font-weight:500;letter-spacing:-.035em}dialog p{font-size:15px;line-height:1.85}.catalog-toolbar label,.catalog-toolbar select,.catalog-toolbar input{font-size:13px}table td{font-size:13px}.catalog-card h3{font-size:16px}.catalog-card>p{font-size:13px}
#loader{background:#f6f4ef}.page-rule{border-color:#84959d}.page-content li:before{color:#527275}
@media(max-width:1100px){.collection-summary{font-size:13px}.collection-summary>span{display:none}#shelf-tabs{gap:27px}.collection-header{grid-template-columns:1fr 210px}}
@media(max-width:759px), (max-aspect-ratio:4/5){
 #header{padding:21px 6% 0}.wordmark{font-size:13px;width:90px}.top-actions{gap:20px;justify-content:flex-end}.top-actions>button{font-size:13px;padding:0}
 .collection-header{display:flex;flex-wrap:wrap;gap:0;margin-top:25px}.collection-intro{width:100%;justify-content:space-between;gap:10px;align-items:center}#header h1{font-size:29px;line-height:1.3;letter-spacing:.025em}.collection-summary{font-size:11px;line-height:1.5;max-width:110px;text-align:right}.collection-summary>span{display:block;margin:3px 0 0}
 .search{margin-top:20px;padding-bottom:8px}.search input{font-size:14px}#shelf-tabs{width:100%;gap:22px;margin-top:18px;padding-bottom:12px}#shelf-tabs button{font-size:14px;padding-bottom:3px}
 #caption{top:auto;bottom:126px;transform:none;left:7%;width:86%;max-width:none}#caption h2{font-size:25px;line-height:1.4;margin:10px 0}#caption .author{font-size:13px}#caption .caption-hint{font-size:11px;margin-top:10px}
 #fine-print{left:6%;right:6%;bottom:19px;align-items:center}#fine-print p{font-size:11px;max-width:55%;line-height:1.6}#fine-print button{font-size:12px;white-space:nowrap}#shelf-hint{bottom:74px}#shelf-hint button{width:34px;height:34px}
 #book-nav{bottom:28px;padding:5px;max-width:96vw}#book-nav button{font-size:11px;padding:9px 10px}#book-nav button:last-child{font-size:10px}
}

/* Restrained controls and a photographic, frontal view of the collection. */
#header{display:flex;align-items:flex-start;justify-content:space-between;gap:45px;padding-top:30px}
.brand-block{flex:none}.wordmark{font:500 11px/1.4 var(--mono);letter-spacing:.2em;width:auto;margin:0 0 14px;color:#667476}#header h1{font-size:42px;line-height:1.3;font-weight:400;letter-spacing:.065em}
.header-right{padding-top:34px;max-width:73%;display:flex;flex-direction:column;align-items:flex-end;gap:20px}#shelf-tabs{margin:0;padding:0;border:0;gap:25px;max-width:100%;overflow:auto}#shelf-tabs button{font-size:14px;padding-bottom:7px}.utility-actions{display:flex;gap:23px}.utility-actions button{font:12px var(--body);color:#68797c;padding:0}
.search[hidden]{display:none}.search{position:absolute;right:4.2%;top:151px;width:300px;padding:16px 0 13px;background:#f6f4efee;z-index:5;border-bottom:1px solid #a9b7b7}.search input{font-size:14px}
#room #header{transition:opacity .24s ease}
body:is([data-phase=pulling],[data-phase=present],[data-phase=opening],[data-phase=open],[data-phase=closing],[data-phase=returning]) #room #header{opacity:.58;pointer-events:none}
#room #header[inert] *{pointer-events:none}
@media(prefers-reduced-motion:reduce){#room #header{transition:none}}
#shelf-hint button{border:0;width:28px;height:28px;font-size:19px}#shelf-hint>div{gap:12px}#fine-print p,#fine-print button{font-size:12px}
@media(max-width:1100px){#header{gap:25px}#header h1{font-size:34px}.header-right{max-width:74%}#shelf-tabs{gap:18px}#shelf-tabs button{font-size:13px}}
@media(max-width:759px), (max-aspect-ratio:4/5){#header{display:block;padding:23px 6% 0}.wordmark{font-size:10px;margin-bottom:11px}#header h1{font-size:31px}.header-right{padding-top:23px;max-width:100%;gap:15px;align-items:flex-start}#shelf-tabs{width:100%;gap:23px;padding-bottom:3px}.utility-actions{position:absolute;right:6%;top:30px;gap:18px}.utility-actions button{font-size:12px}.search{top:175px;right:6%;left:6%;width:auto;padding:15px 0;background:#f6f4effa}#fine-print p{font-size:11px}}

/* Keep controls above the uninterrupted shelf. */
#header h1{font-family:"Songti TC","PMingLiU","Noto Serif TC",serif;font-weight:600;letter-spacing:.055em}
.header-right{flex-direction:row;align-items:baseline;gap:28px;min-width:0}
.utility-actions{flex:none}
#search-panel{top:100%;margin-top:8px;padding:12px 14px;background:#fffef9;border:1px solid #c2c4bf}
#empty-shelf{position:absolute;top:52%;left:50%;transform:translateX(-50%);color:#2d3737}
#caption,#caption .eyebrow,#caption .text-button,#caption .turn-controls button{color:#fffdf8}
#caption .caption-hint,#caption .author,#caption .turn-controls span,#caption #metadata{color:#eff0e9}
#caption .text-button{border-color:#ccd1c9}
#caption .turn-controls button{border-color:#bcc4bc88}
body[data-phase=present] #header .wordmark,body[data-phase=pulling] #header .wordmark{color:#f1f2ec}
body[data-phase=present] #book-nav #close-book,body[data-phase=present] #book-nav #edit-open{display:none}
@media(max-width:759px),(max-aspect-ratio:4/5){
 .header-right{display:block}
 #search-panel{top:100%}
}
@media(min-width:1101px) and (min-aspect-ratio:1/1){
  #header{align-items:center;padding-top:19px}
  body:is([data-phase=shelf],[data-phase=transition]) #header{background:transparent}
  .brand-block{display:flex;flex-direction:row-reverse;align-items:baseline;gap:17px}
  #header h1{font-size:39px}
  .brand-block .wordmark{margin:0;font-size:10px;letter-spacing:.15em}
  .header-right{padding-top:4px}
}

#caption #flip-jacket { width: auto; padding: 0 10px; border-radius: 14px; white-space: nowrap; font-size: 12px; }

/* Fit the controls on the upper painted panel even on a short landscape screen. */
@media(min-width:760px) and (min-aspect-ratio:1/1){
  #header{align-items:center;gap:20px;padding:clamp(8px,1.6vh,17px) 3vw 0}
  #header h1{font-size:clamp(22px,3.65vh,36px);line-height:1.18}
  .brand-block{display:flex;flex-direction:row-reverse;gap:12px;align-items:baseline}
  .brand-block .wordmark{font-size:9px;margin:0;letter-spacing:.12em}
  .header-right{padding:0;width:auto;max-width:72%;gap:18px}
  #shelf-tabs{gap:clamp(9px,1.25vw,22px)}
  #shelf-tabs button,.utility-actions button{font-size:clamp(11px,1.08vw,14px)}
  #shelf-tabs button{padding-bottom:3px}
}

@media(min-width:760px) and (min-aspect-ratio:1/1){
  #header .header-right button{color:#fff9eb;text-shadow:0 1px 2px #362e26}
  #header .header-right button[aria-selected=true]{border-color:#fff9eb}
}
@media(max-width:759px),(max-aspect-ratio:4/5){
  body[data-phase=shelf] #header{background:linear-gradient(180deg,#27160988,transparent)}
}

.engraving-defs{position:absolute;pointer-events:none}
#room #header h1{
  color:#ffdc9f;
  background:linear-gradient(177deg,#cda36be8 4%,#ffe7b9ef 44%,#ffe2a6ef 68%,#d5a066e8 100%);
  background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;
  filter:url(#lit-intaglio)
}
#room #header .wordmark,#room #header .header-right button{
  color:#f4d7a7;
  text-shadow:0 -.65px .4px #432510,0 .55px .45px #ae7846,0 0 1.5px #ffc07945
}
#room #header .wordmark{color:#e8c995}
#room #header .header-right button:is(:hover,:focus-visible,[aria-selected=true]){
  color:#ffebca;text-shadow:0 -.55px .4px #542d14,0 0 2.5px #ffb76480
}
@media(forced-colors:active){
  #room #header h1{background:none;-webkit-text-fill-color:CanvasText;filter:none}
  #room #header .header-right button,#room #header .wordmark{text-shadow:none}
}
#room #shelf-tabs button[aria-selected=true]::after{background:#edc18c}
#room.mouse-cursor-active,#room.mouse-cursor-active *{cursor:none!important}
#room-cursor{position:fixed;top:0;left:0;z-index:10000;pointer-events:none;opacity:1;will-change:transform;transition:none}
#room-cursor[hidden]{display:none}
#room-cursor.idle{opacity:0;transition:opacity 700ms ease-out}
#room-cursor .cursor-hand,#room-cursor.hand .cursor-arrow{display:none}
#room-cursor.hand .cursor-hand{display:block}
@media(prefers-reduced-motion:reduce){#room-cursor.idle{transition:none}}
/* A keyboard focus marker at the shelf title instead of a viewport border. */

#caption .caption-actions{display:flex;flex-wrap:wrap;align-items:baseline;gap:.8rem 1.4rem}
#return-caption,#flip-jacket{color:inherit;background:transparent;border:0;padding:.25rem 0;font:inherit;cursor:pointer}
#return-caption{font-size:.85em}
#flip-jacket{font-size:.78em;margin-top:.6rem}
#printed-note .page-note{font-size:4.5cqw;line-height:1.8;max-height:none;white-space:pre-line;overflow:visible}
#flip-jacket[hidden]{display:none}
#printed-note.landscape .page-note{font-size:3.7cqw}

/* Reading spread: leave space around actual edition details and keep controls outside the paper. */
#printed-note .page-content{padding:12cqw 10cqw 9cqw;font-family:var(--body);justify-content:flex-start;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#printed-note .page-note{font-family:var(--body);font-size:4.65cqw;line-height:1.86;text-align:start;letter-spacing:.018em;color:#28302e}
#printed-note .edition-details{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:4.7cqw;row-gap:1.5cqw;margin:0 0 6cqw;padding:0 0 4cqw;border-bottom:1px solid #606a642f;font-size:3.4cqw;line-height:1.55;align-items:baseline}
.edition-details dt{color:#59605b;font-size:.83em;font-weight:450}.edition-details dd{margin:0;color:#333a36}
.portrait #printed-note .mobile-title h2{font:500 6.1cqw/1.43 var(--body);display:block;overflow:visible;margin:0 0 2cqw}
.portrait #printed-note .mobile-title p{font:400 3.7cqw/1.5 var(--body);white-space:normal}
.portrait #printed-note .mobile-title{margin:0 0 6cqw}
#printed-note.landscape .page-content{padding:5cqw 8cqw}
#printed-note.landscape .page-note{font-size:3.6cqw;line-height:1.6}
#printed-note.landscape .edition-details{margin:0 0 2cqw;padding:0 0 2cqw;row-gap:.4cqw;font-size:2.85cqw}
#room #book-nav{bottom:calc(env(safe-area-inset-bottom,0px) + clamp(12px,2.5vh,30px));gap:1px;padding:1px 5px;border-radius:999px;border:1px solid #fff7e83d;background:linear-gradient(165deg,#514a3e63,#18181369);box-shadow:inset 0 1px 0 #fff7dc21,0 2px 8px #0002;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
#room #book-nav button{position:relative;display:grid;place-items:center;min-width:54px;height:44px;padding:0 12px;border:0;background:transparent;color:#fffaf1;font:400 13px/1.3 var(--body);letter-spacing:.045em;border-radius:999px;cursor:pointer}
#room #book-nav button:disabled{opacity:.30;cursor:default}
#room #book-nav button:is(:hover,:focus-visible):enabled{background:#ffffff16}
#room #book-nav button:focus-visible{outline:2px solid #eeddbd;outline-offset:-3px}
.brand-home{display:inline-flex;align-items:baseline;gap:16px;pointer-events:auto}
.brand-home,.brand-home:is(:hover,:active,:visited){text-decoration:none;border:0;box-shadow:none}
#room #header .brand-home .wordmark{font:400 11px/1.4 var(--body);letter-spacing:.10em;margin:0;white-space:nowrap;text-decoration:none;border:0;box-shadow:none;text-shadow:none;color:#dbc6a5}
.brand-home:focus-visible{outline:1px solid #f0d5ac;outline-offset:5px}
#room #loader{gap:0;background:radial-gradient(ellipse at 46% 39%,#443528,#201d18 70%);color:#f5ebdb;transition:opacity .36s ease-out}
#room #loader p{font:400 clamp(30px,4.2vw,46px)/1.45 var(--display);letter-spacing:.10em}
.loader-name{margin-top:5px;font:400 12px/1.6 var(--body);letter-spacing:.09em;color:#ccbca6}
#loader .loading-line{width:110px;height:2px;margin-top:24px;animation:none;background:#ffffff21;overflow:hidden}
#loader .loading-line::before{content:"";display:block;width:100%;height:100%;background:#edd2ab;transform:scaleX(var(--ready,.08));transform-origin:left;transition:transform .24s ease-out}
@media(min-width:760px) and (min-aspect-ratio:1/1){#room #header{padding-top:clamp(17px,3.4vh,32px)}}
@media(max-width:759px),(max-aspect-ratio:4/5){#room .brand-block{justify-content:flex-end}.brand-home{gap:10px}#room #header .brand-home .wordmark{font-size:9px;max-width:10em}}
@media(prefers-reduced-motion:reduce){#room #loader,#loader .loading-line::before{transition:none}}

/* Both printed leaves use the same screen-pixel type, inset and baseline. */
#printed-note.book-spread {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  container-type:normal;
  mix-blend-mode:normal;
  transform:none;
  font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
  color:#30332f;
  line-break:strict;
  word-break:normal;
  overflow-wrap:break-word;
  pointer-events:none;
}
#printed-note.book-spread[hidden]{display:none}
#search-panel[inert]{visibility:hidden}
.reading-leaf {
  container-type:inline-size;
  min-width:0;
  min-height:0;
  /* Keep the paper's lower margin outside the scrolling text area. */
  margin-block-end:clamp(36px,8vh,76px);
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#645f503d transparent;
  pointer-events:auto;
}
.book-spread[inert] .reading-leaf{pointer-events:none}
.reading-copy{padding:11cqw 9cqw 4cqw}
.reading-copy .title-qualifier{display:inline-block;white-space:nowrap;max-width:100%}
.reading-copy h2,.reading-copy p,.reading-copy dl,.reading-copy ul{margin:0}
#page-title{font-family:inherit;font-size:clamp(19px,7cqw,39px);font-weight:550;line-height:1.37;letter-spacing:.012em;text-wrap:balance}
#page-subtitle{margin-top:2.2cqw;font-size:clamp(14px,4.7cqw,26px);line-height:1.52;color:#434640;text-wrap:balance}
#edition-details{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:1.7cqw 4cqw;margin-top:7cqw;padding-top:4.5cqw;border-top:1px solid #665f491f;font-size:clamp(12px,3.65cqw,21px);line-height:1.58;font-variant-numeric:tabular-nums}
#edition-details[hidden]{display:none}
#edition-details dt{color:#5c6058}
#edition-details dd{margin:0;min-width:0}
#edition-details .credit-person{display:block}
#page-note{font:inherit;font-size:clamp(15px,3.65cqw,22px);line-height:1.78;letter-spacing:.012em;white-space:pre-line}
#page-note{position:relative}
.ink-reveal-layer,.ink-reveal-line{position:absolute;inset:0;display:block;pointer-events:none;user-select:none;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:inherit}
#page-tags{list-style:none;display:flex;flex-wrap:wrap;gap:.45em .9em;padding:0;margin-top:5cqw;color:#565d53;font-size:clamp(12px,3.15cqw,18px);line-height:1.5}
#page-tags li{max-width:100%}
.book-spread.landscape .reading-copy{padding:5cqw 8cqw}
.book-spread.landscape #page-note{font-size:clamp(15px,2.85cqw,18px);line-height:1.7}
.book-spread.landscape #page-title{font-size:clamp(19px,5.5cqw,32px)}
.book-spread.landscape #edition-details{font-size:clamp(12px,2.9cqw,17px);gap:1.2cqw 4cqw;margin-top:4cqw;padding-top:3cqw}
.book-spread.landscape #page-tags{font-size:clamp(12px,2.5cqw,15px);margin-top:3cqw}
.book-spread.landscape #edition-details{margin-top:3.3cqw;padding-top:2.5cqw}

@media(min-width:760px) and (min-aspect-ratio:4/5){
  body[data-cover-side="left"] #room #caption{left:64%;right:6%;width:auto;max-width:410px}
}

/* Keep browser safe areas continuous with the walnut room. */
#room #header{margin-top:env(safe-area-inset-top,0px)}

/* Real padding at both scroll limits keeps the last glyph and underline inside. */
#room #shelf-tabs{box-sizing:border-box;padding:4px 8px 9px;scroll-padding-inline:8px;overflow-x:auto;overflow-y:hidden;align-items:center;min-width:0}
#room #shelf-tabs button{flex:0 0 auto;line-height:1.65}
.reading-leaf.paged-copy{overflow:hidden;touch-action:pan-y}
.copy-pages{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;color:#62645c;font-size:12px;font-variant-numeric:tabular-nums}
.copy-pages[hidden]{display:none}
.copy-pages button{font:inherit;color:inherit;background:none;border:0;padding:8px 0;min-height:36px}
.copy-pages button:disabled{opacity:.26}
.copy-pages span{font-size:11px;letter-spacing:.08em}
#page-tags[hidden]{display:none}

.reading-leaf.paged-copy{position:relative;perspective:1000px}
@media(min-width:760px) and (min-aspect-ratio:4/5){
  #room #header{align-items:baseline}
  #room #header .header-right{padding-top:0;align-self:baseline}
  #room #shelf-tabs{align-items:baseline}
}
.reading-page-turn{position:absolute;inset:0;z-index:2;background:linear-gradient(90deg,#d1ccc2,#e1ddd4 12%,#dedad1 90%,#c3bdb2);backface-visibility:hidden;pointer-events:none;box-shadow:2px 0 10px #40382c28;overflow:hidden}
