/* 册集 — public virtual bookshelf */

.shelf-page {
  --room-a: #211c16;
  --room-b: #120f0b;
  --room-glow: rgba(202, 157, 102, 0.14);
  --text: #f3eadc;
  --text-soft: rgba(243, 234, 220, 0.6);
  --text-muted: rgba(243, 234, 220, 0.38);
  --hairline: rgba(243, 234, 220, 0.14);
  --cab-a: #80603f;
  --cab-b: #5b402b;
  --cab-c: #4a3323;
  --topbar-bg: rgba(37, 24, 14, 0.18);
  --rail-a: #9d7751;
  --rail-b: #593d27;
  --rail-dark: #3b2718;
  --plaque: #27190f;
  --plaque-text: #eadcc7;
  --tint: #d6b083;
  --btn-cream-bg: #f2e8d8;
  --btn-cream-fg: #2b2118;
  min-height: 100dvh;
  background: var(--room-b);
  color: var(--text);
}

.shelf-page[data-theme="paper"] {
  --room-a: #e7ddcd;
  --room-b: #ddd1bf;
  --room-glow: rgba(92, 68, 39, 0.1);
  --text: #29231b;
  --text-soft: rgba(41, 35, 27, 0.62);
  --text-muted: rgba(41, 35, 27, 0.4);
  --hairline: rgba(41, 35, 27, 0.16);
  --cab-a: #d7c4a7;
  --cab-b: #c6b08e;
  --cab-c: #b49c78;
  --topbar-bg: rgba(255, 250, 241, 0.18);
  --rail-a: #c5ad8c;
  --rail-b: #a48863;
  --rail-dark: #8a6f4d;
  --plaque: #3b2c1d;
  --plaque-text: #f1e6d4;
  --tint: #9a5c35;
  --btn-cream-bg: #2b2118;
  --btn-cream-fg: #f3eadc;
}

.shelf-page[data-theme="ink"] {
  --room-a: #191b1a;
  --room-b: #0c0d0c;
  --room-glow: rgba(183, 176, 148, 0.09);
  --cab-a: #3c3b35;
  --cab-b: #2a2924;
  --cab-c: #20201b;
  --topbar-bg: rgba(255, 255, 255, 0.025);
  --rail-a: #626059;
  --rail-b: #36352f;
  --rail-dark: #24231f;
  --plaque: #1a1a17;
  --plaque-text: #e9e1d3;
  --tint: #c7b48e;
}

.shelf-page .page-grain {
  opacity: 0.07;
}

.shelf-room {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(70% 36% at 50% -5%, var(--room-glow), transparent 68%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, var(--room-a) 0%, var(--room-b) 68%);
}

.shelf-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(100% 75% at 50% 30%, transparent 40%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}

[data-theme="paper"] .shelf-room::before {
  background: radial-gradient(100% 75% at 50% 30%, transparent 45%, rgba(92, 68, 39, 0.09) 100%);
}

.room-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Nav -------------------------------------------------------------- */

.shelf-nav {
  position: relative;
  z-index: 10;
  max-width: 1240px;
  height: 76px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--text);
}

.shelf-brand .brand-mark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--hairline);
}

[data-theme="paper"] .shelf-brand .brand-mark {
  background: rgba(41, 35, 27, 0.08);
}

.shelf-brand .brand-word {
  color: var(--text);
}

.shelf-brand .brand-latin {
  color: var(--text-muted);
}

.shelf-nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.shelf-nav-center i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tint);
  opacity: 0.8;
}

.shelf-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shelf-nav-link {
  font-size: 10px;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.shelf-nav-link:hover {
  color: var(--text);
}

.shelf-page .btn-cream {
  --btn-bg: var(--btn-cream-bg);
  --btn-fg: var(--btn-cream-fg);
}

[data-theme="paper"] .btn-outline-cream {
  --btn-fg: var(--text);
  --btn-border: var(--hairline);
}

[data-theme="paper"] .btn-outline-cream:hover {
  --btn-bg: rgba(41, 35, 27, 0.06);
}

/* Hero ------------------------------------------------------------- */

.shelf-root {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px var(--gutter) 0;
}

.shelf-hero {
  padding: 0 2px 30px;
}

.shelf-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.shelf-company {
  display: flex;
  align-items: center;
  gap: 11px;
}

.shelf-company-logo {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text);
}

[data-theme="paper"] .shelf-company-logo {
  background: rgba(41, 35, 27, 0.045);
}

.shelf-company-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shelf-company-copy strong {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text);
}

.shelf-company-copy span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}

.shelf-hero-side {
  display: flex;
  align-items: center;
  gap: 18px;
}

.shelf-page-index {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.shelf-page-index em {
  font-family: var(--serif);
  font-size: 22px;
  font-style: normal;
  line-height: 1;
  color: var(--text);
}

.shelf-page-index i {
  font-style: normal;
  opacity: 0.45;
}

.shelf-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 10px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.shelf-share:hover {
  color: var(--text);
  border-color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="paper"] .shelf-share:hover {
  background: rgba(41, 35, 27, 0.05);
}

.shelf-share svg {
  width: 13px;
  height: 13px;
}

.shelf-hero-main {
  margin-top: 30px;
  max-width: 820px;
}

.shelf-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--tint);
  text-transform: uppercase;
}

.shelf-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.shelf-hero h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(40px, 4.9vw, 64px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
}

.shelf-intro {
  max-width: 660px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-soft);
}

.shelf-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.shelf-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shelf-hero-meta span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 14px;
  opacity: 0.6;
}

.shelf-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(217, 177, 132, 0.34);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0;
  color: var(--tint);
}

[data-theme="paper"] .shelf-preview-badge {
  color: #7f4c2b;
}

/* Cabinet ---------------------------------------------------------- */

.shelf-cabinet {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, var(--cab-a), var(--cab-b) 56%, var(--cab-c));
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 0 0 8px rgba(35, 21, 12, 0.36),
    0 60px 110px -45px rgba(0, 0, 0, 0.76);
  color: var(--text);
}

[data-theme="paper"] .shelf-cabinet {
  border-color: rgba(86, 61, 36, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 0 0 8px rgba(111, 85, 54, 0.18),
    0 50px 80px -50px rgba(74, 53, 30, 0.42);
}

.shelf-cabinet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cabinet-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 10px 22px;
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.shelf-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shelf-tabs::-webkit-scrollbar {
  display: none;
}

.shelf-tabs button {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 9.5px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.shelf-tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="paper"] .shelf-tabs button:hover {
  background: rgba(41, 35, 27, 0.06);
}

.shelf-tabs button.is-active {
  background: var(--btn-cream-bg);
  color: var(--btn-cream-fg);
}

.shelf-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.shelf-tools span {
  margin-right: 5px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.shelf-tools button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 8.5px;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.shelf-tools button:hover {
  color: var(--text);
}

.shelf-tools button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

[data-theme="paper"] .shelf-tools button.is-active {
  background: rgba(41, 35, 27, 0.08);
}

.shelf-tools svg {
  width: 11px;
  height: 11px;
}

.shelf-inner {
  position: relative;
  z-index: 2;
  padding: 30px clamp(22px, 4vw, 52px) 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 14%, transparent 86%, rgba(0, 0, 0, 0.08)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0 2px, transparent 2px 9px);
}

.shelf-row {
  position: relative;
  margin-bottom: 20px;
}

.shelf-row:last-child {
  margin-bottom: 0;
}

.shelf-books {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(24px, 4.2vw, 64px);
  padding: 8px 12px 0;
  min-height: 232px;
}

.shelf-book {
  position: relative;
  width: clamp(112px, 13.2vw, 172px);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  opacity: 0;
  transform: translateY(12px);
  animation: bookIn 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 0.055s);
}

@keyframes bookIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shelf-book-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 794 / 1123;
  border-radius: 2px 4px 4px 2px;
  overflow: hidden;
  background: var(--cab-c);
  box-shadow:
    10px 18px 28px -14px rgba(0, 0, 0, 0.72),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
  transform: perspective(1000px) rotateY(-2.5deg);
  transform-origin: center bottom;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}

.shelf-book:nth-child(even) .shelf-book-cover {
  transform: perspective(1000px) rotateY(2.5deg);
}

.shelf-book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  z-index: 3;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(255, 255, 255, 0.08));
}

.shelf-book-cover::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 0;
  width: 3px;
  z-index: 3;
  background: repeating-linear-gradient(180deg, rgba(255, 249, 238, 0.32) 0 1px, rgba(0, 0, 0, 0.1) 1px 2px);
  opacity: 0.7;
}

.shelf-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.shelf-book:hover .shelf-book-cover {
  transform: perspective(1000px) rotateY(0deg) translateY(-10px);
  box-shadow:
    12px 30px 40px -16px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.shelf-book:hover .shelf-book-cover img {
  transform: scale(1.015);
}

.shelf-book-label {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 7px 3px 0;
  padding: 5px 7px;
  border-top: 1px solid rgba(225, 193, 146, 0.3);
  border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--plaque);
  color: var(--plaque-text);
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: 0 5px 10px -6px rgba(0, 0, 0, 0.6);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.shelf-book-label span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-book:hover .shelf-book-label {
  border-top-color: var(--tint);
}

.shelf-book-badge {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(23, 18, 12, 0.72);
  color: #f1e0c8;
  font-size: 6.5px;
  letter-spacing: 0.03em;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.shelf-rail {
  position: relative;
  height: 15px;
  margin-top: -1px;
  border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 26%),
    linear-gradient(180deg, var(--rail-a), var(--rail-b) 48%, var(--rail-dark));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 16px -5px rgba(0, 0, 0, 0.52);
}

.shelf-rail::before {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  top: -7px;
  height: 9px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
  filter: blur(2px);
}

.shelf-rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 7px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent);
}

.shelf-row:last-child .shelf-rail::after {
  display: none;
}

.shelf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 50px 24px;
  text-align: center;
  color: var(--text-soft);
}

.shelf-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.shelf-empty h3 {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
}

.shelf-empty p {
  margin-top: 8px;
  max-width: 360px;
  font-size: 10px;
  line-height: 1.8;
  color: var(--text-muted);
}

.cabinet-footer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  min-height: 58px;
  padding: 8px 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
  background: var(--topbar-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.shelf-count {
  justify-self: start;
  padding: 5px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.shelf-pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shelf-pager > button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--text-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.shelf-pager > button:hover {
  color: var(--text);
  border-color: var(--text-soft);
}

.shelf-pager > button:disabled {
  opacity: 0.22;
  pointer-events: none;
}

.shelf-pager > button svg {
  width: 12px;
  height: 12px;
}

.shelf-dots {
  display: flex;
  align-items: center;
  gap: 2px;
}

.shelf-dots button {
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.shelf-dots button:hover {
  color: var(--text);
}

.shelf-dots button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

[data-theme="paper"] .shelf-dots button.is-active {
  background: rgba(41, 35, 27, 0.08);
}

.shelf-top {
  justify-self: end;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--text-soft);
  transition: color 0.2s ease, transform 0.2s ease;
}

.shelf-top:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.shelf-top svg {
  width: 12px;
  height: 12px;
  transform: rotate(-90deg);
}

/* Contact ---------------------------------------------------------- */

.shelf-contact {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 34px;
  align-items: center;
  margin: 26px 0 0;
  padding: 28px 30px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

[data-theme="paper"] .shelf-contact {
  background: rgba(255, 250, 241, 0.3);
}

.shelf-contact-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.shelf-contact-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  color: var(--text);
  font-family: var(--serif);
  font-size: 13px;
}

.shelf-contact-copy {
  min-width: 0;
}

.shelf-contact-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
}

.shelf-contact-copy p {
  max-width: 390px;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shelf-contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--text-muted);
}

.shelf-contact-info a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shelf-contact-info a:hover {
  color: var(--text);
}

.shelf-contact-cta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.shelf-contact-cta .btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: 9.5px;
  white-space: nowrap;
}

.shelf-contact-cta .btn svg {
  width: 12px;
  height: 12px;
}

.shelf-page-footer {
  position: relative;
  z-index: 5;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px var(--gutter) 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.shelf-page-footer a:hover {
  color: var(--text);
}

.shelf-footer-center {
  opacity: 0.65;
}

/* Share modal ------------------------------------------------------ */

.shelf-share-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shelf-share-qr {
  width: 186px;
  height: 186px;
  padding: 9px;
  border: 1px solid rgba(33, 30, 24, 0.14);
  border-radius: 12px;
  background: #fff;
}

.shelf-share-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shelf-share-url {
  max-width: 100%;
  margin: 12px 0 14px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
  word-break: break-all;
  color: var(--muted);
}

.shelf-share-actions {
  display: flex;
  gap: 7px;
  width: 100%;
}

.shelf-share-actions .btn {
  flex: 1;
  min-height: 35px;
  font-size: 9px;
}

/* Loading / error -------------------------------------------------- */

.shelf-loading {
  padding: 20px 0 260px;
}

.shelf-loading-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 26px 0 36px;
}

.shelf-loading-head span:nth-child(1) {
  width: 320px;
  height: 48px;
}

.shelf-loading-head span:nth-child(2) {
  width: 420px;
  height: 14px;
}

.shelf-loading-head span:nth-child(3) {
  width: 250px;
  height: 10px;
}

.shelf-loading-board {
  padding: 36px 50px;
  border-radius: 12px;
  background: #3a291c;
  box-shadow: 0 40px 80px -40px #000;
}

.shelf-loading-books {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 50px;
  min-height: 200px;
}

.shelf-loading-books span {
  width: 116px;
  height: 160px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  animation: shelfPulse 1.8s ease-in-out infinite;
}

.shelf-loading-books span:nth-child(2) { animation-delay: 0.15s; }
.shelf-loading-books span:nth-child(3) { animation-delay: 0.3s; }
.shelf-loading-books span:nth-child(4) { animation-delay: 0.45s; }

@keyframes shelfPulse {
  50% { opacity: 0.45; }
}

.shelf-loading-rail {
  height: 13px;
  margin-top: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.shelf-error {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.shelf-error-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--text-muted);
}

.shelf-error-icon svg {
  width: 24px;
  height: 24px;
}

.shelf-error h1 {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
}

.shelf-error p {
  max-width: 400px;
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-soft);
}

.shelf-error-actions {
  display: flex;
  gap: 9px;
  margin-top: 24px;
}

/* Responsive ------------------------------------------------------- */

@media (max-width: 980px) {
  .shelf-nav {
    height: 66px;
  }

  .shelf-nav-center {
    display: none;
  }

  .shelf-nav-actions {
    margin-left: auto;
  }

  .shelf-root {
    padding-top: 26px;
  }

  .shelf-hero {
    padding-bottom: 24px;
  }

  .shelf-hero h1 {
    font-size: clamp(34px, 7vw, 48px);
  }

  .shelf-inner {
    padding-top: 24px;
  }

  .shelf-books {
    min-height: 200px;
    gap: 28px;
  }

  .shelf-contact {
    grid-template-columns: 1fr auto;
  }

  .shelf-contact-info {
    grid-column: span 2;
    order: 3;
  }

  .shelf-contact-cta {
    justify-self: end;
  }
}

@media (max-width: 720px) {
  .shelf-page .page-grain {
    display: none;
  }

  .shelf-nav {
    height: 58px;
    padding: 0 var(--gutter);
  }

  .shelf-nav .brand-latin,
  .shelf-nav-link {
    display: none;
  }

  .shelf-nav-actions .btn {
    min-height: 32px;
    padding: 0 11px;
    font-size: 9px;
  }

  .shelf-hero {
    padding-top: 12px;
  }

  .shelf-hero-top {
    align-items: flex-start;
  }

  .shelf-company-logo {
    width: 31px;
    height: 31px;
    font-size: 10px;
    border-radius: 8px;
  }

  .shelf-company-copy strong {
    font-size: 10px;
  }

  .shelf-company-copy span {
    font-size: 6px;
  }

  .shelf-hero-side {
    gap: 10px;
  }

  .shelf-page-index {
    display: none;
  }

  .shelf-share {
    height: 31px;
    padding: 0 10px;
    font-size: 8.5px;
  }

  .shelf-hero-main {
    margin-top: 23px;
  }

  .shelf-hero h1 {
    margin-top: 10px;
    font-size: clamp(28px, 8.2vw, 34px);
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  .shelf-intro {
    margin-top: 11px;
    font-size: 10.5px;
    line-height: 1.8;
  }

  .shelf-hero-meta {
    margin-top: 13px;
    font-size: 6.5px;
    gap: 6px 12px;
  }

  .shelf-hero-meta span + span::before {
    margin-right: 7px;
  }

  .shelf-cabinet {
    border-radius: 9px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.12) inset,
      0 0 0 5px rgba(35, 21, 12, 0.35),
      0 40px 70px -40px rgba(0, 0, 0, 0.7);
  }

  .cabinet-topbar {
    display: block;
    padding: 9px 12px 10px;
    min-height: 0;
  }

  .shelf-tabs {
    gap: 1px;
    margin: 0 -3px;
  }

  .shelf-tabs button {
    height: 27px;
    padding: 0 9px;
    font-size: 8.5px;
  }

  .shelf-tools {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    justify-content: flex-end;
  }

  [data-theme="paper"] .shelf-tools {
    border-top-color: rgba(41, 35, 27, 0.08);
  }

  .shelf-tools span {
    margin-right: auto;
    font-size: 6px;
  }

  .shelf-tools button {
    height: 24px;
    font-size: 8px;
  }

  .shelf-inner {
    padding: 18px 10px 6px;
  }

  .shelf-row {
    margin-bottom: 12px;
  }

  .shelf-books {
    gap: 18px;
    padding: 8px 6px 0;
    min-height: 0;
    flex-wrap: wrap;
    justify-content: center;
  }

  .shelf-book {
    width: clamp(104px, 36vw, 138px);
    margin-bottom: 17px;
  }

  .shelf-book-label {
    margin: 6px 2px 0;
    font-size: 7px;
    min-height: 27px;
    padding: 4px 5px;
  }

  .shelf-rail {
    height: 12px;
  }

  .cabinet-footer {
    min-height: 50px;
    padding: 7px 12px;
    gap: 7px;
  }

  .shelf-count {
    font-size: 6px;
    padding: 4px 8px;
  }

  .shelf-dots button {
    min-width: 20px;
    height: 21px;
    font-size: 7px;
  }

  .shelf-pager {
    gap: 6px;
  }

  .shelf-pager > button {
    width: 22px;
    height: 22px;
  }

  .shelf-top {
    width: 24px;
    height: 24px;
  }

  .shelf-empty {
    min-height: 340px;
  }

  .shelf-contact {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
    margin-top: 18px;
  }

  .shelf-contact-info {
    grid-column: auto;
    order: 0;
    font-size: 7px;
  }

  .shelf-contact-copy p {
    font-size: 8px;
  }

  .shelf-contact-cta {
    justify-self: start;
  }

  .shelf-contact-cta .btn {
    height: 33px;
    font-size: 8.5px;
  }

  .shelf-page-footer {
    padding: 20px var(--gutter) 24px;
    font-size: 6px;
    flex-wrap: wrap;
    gap: 5px 14px;
  }

  .shelf-footer-center {
    display: none;
  }

  .shelf-share-qr {
    width: 158px;
    height: 158px;
  }

  .shelf-loading {
    padding-bottom: 100px;
  }

  .shelf-loading-head span:nth-child(1) {
    width: 220px;
    height: 36px;
  }

  .shelf-loading-head span:nth-child(2) {
    width: 280px;
  }

  .shelf-loading-board {
    padding: 24px 14px;
  }

  .shelf-loading-books {
    gap: 15px;
  }

  .shelf-loading-books span {
    width: 72px;
    height: 102px;
  }

  .shelf-loading-books span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 380px) {
  .shelf-book {
    width: 108px;
  }

  .shelf-share span {
    display: none;
  }

  .shelf-share {
    width: 31px;
    justify-content: center;
    padding: 0;
  }
}
