/* =========================================================
   LELE XIA — SHELF PAGE
   ========================================================= */

/* ---------- hero ---------- */
.sh-hero { padding-top: clamp(120px, 14vw, 168px); padding-bottom: clamp(14px, 2vw, 26px); }
.sh-hero__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
}
.sh-title {
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.sh-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  color: var(--coral);
}
.sh-title span {
  display: block;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: 0.08em;
  color: var(--cream-2);
}
.sh-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-bottom: 8px;
  text-align: right;
}
.sh-count b {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--coral-deep);
}
.sh-count span { margin-top: 8px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--muted); }
.sh-count i { margin-top: 4px; font-family: var(--font-mono); font-style: normal; font-size: 9px; letter-spacing: 0.12em; color: var(--cream-2); }

/* ---------- shelf ---------- */
.shelf {
  position: relative;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 3vw, 34px) 26px;
  border-radius: 22px;
  border: 1px solid rgba(43, 34, 51, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 30%),
    linear-gradient(165deg, #F6E3CB, #EFD3B4 60%, #E7C8A5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 30px 60px -46px rgba(43, 34, 51, 0.55);
}
.shelf::before {
  content: "";
  position: absolute;
  inset: 10px 10px 8px;
  border: 1px dashed rgba(120, 80, 50, 0.2);
  border-radius: 16px;
  pointer-events: none;
}
.shelf__row {
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 8px;
}
.shelf__row:last-of-type { margin-bottom: 0; }
.shelf__row::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; bottom: 0;
  height: 15px;
  border-radius: 4px;
  background: linear-gradient(180deg, #DDAE83, #C18D61 70%, #AC774C);
  box-shadow: 0 10px 16px -12px rgba(80, 50, 30, 0.6);
}
.shelf__label {
  display: block;
  padding: 4px 2px 12px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(80, 55, 40, 0.65);
}
.books {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 0.8vw, 10px);
  padding: 18px clamp(6px, 1.6vw, 20px) 4px;
  perspective: 900px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}
.book {
  position: relative;
  flex-shrink: 0;
  width: clamp(42px, 5vw, 60px);
  height: var(--h, 220px);
  border-radius: 4px 7px 7px 4px;
  background: linear-gradient(100deg, var(--c1), var(--c2));
  box-shadow:
    inset 5px 0 0 rgba(43, 34, 51, 0.12),
    inset -2px 0 0 rgba(255, 255, 255, 0.25),
    0 12px 20px -14px rgba(80, 50, 30, 0.55);
  color: var(--cream);
  transform-origin: bottom center;
  transform: rotate(0) translateY(0);
  transition: transform 0.55s var(--ease), box-shadow 0.45s, filter 0.4s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  cursor: pointer;
}
.book:hover,
.book:focus-visible {
  transform: rotate(-3deg) translateY(-22px) translateZ(18px);
  box-shadow:
    inset 5px 0 0 rgba(43, 34, 51, 0.12),
    inset -2px 0 0 rgba(255, 255, 255, 0.3),
    0 26px 34px -20px rgba(80, 50, 30, 0.7);
  filter: saturate(1.06);
}
.book__no { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; opacity: 0.7; }
.book__name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(11px, 1.25vw, 14px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
}
.book__meta {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  opacity: 0.6;
}
.book--gap {
  opacity: 0.55;
  cursor: default;
  background: linear-gradient(100deg, var(--c1), var(--c2));
  color: rgba(80, 55, 40, 0.5);
}
.book--gap:hover { transform: none; box-shadow: inset 5px 0 0 rgba(43, 34, 51, 0.1), 0 12px 20px -14px rgba(80, 50, 30, 0.4); }
.shelf__base {
  height: 18px;
  margin: 6px -10px 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #C18D61, #9E6B43);
  box-shadow: 0 14px 24px -14px rgba(80, 50, 30, 0.7);
}
.sh-hint { margin-top: 18px; text-align: center; font-size: 8.5px; }

/* ---------- panel ---------- */
.sh-panel {
  position: fixed;
  inset: 0;
  z-index: 5000;
  visibility: hidden;
  pointer-events: none;
}
.sh-panel.is-open { visibility: visible; pointer-events: auto; }
.sh-panel__bg {
  position: absolute;
  inset: 0;
  background: rgba(250, 244, 234, 0.9);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.5s;
}
.sh-panel.is-open .sh-panel__bg { opacity: 1; }
.sh-panel__body {
  position: absolute;
  right: 0; top: 0;
  width: min(440px, 100%);
  height: 100%;
  padding: clamp(26px, 4vw, 44px);
  overflow-y: auto;
  background: linear-gradient(165deg, #FFF9EF, var(--ink-3));
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -40px rgba(43, 34, 51, 0.5);
  transform: translateX(104%);
  transition: transform 0.65s var(--ease);
}
.sh-panel.is-open .sh-panel__body { transform: none; }
.sh-panel__close {
  position: absolute;
  right: 18px; top: 18px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: background 0.3s, color 0.3s;
}
.sh-panel__close svg { width: 15px; height: 15px; }
.sh-panel__close:hover { background: var(--pink); color: var(--ink); }
.sh-panel__no { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--muted); }
.sh-panel__img {
  margin: 16px 0 22px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.sh-panel__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sh-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sh-panel__meta { margin: 6px 0 14px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--coral-deep); }
.sh-panel__desc { font-size: 13px; line-height: 1.85; color: var(--cream-2); }
.sh-panel__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 22px; }
.sh-panel__tags span {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--cream-2);
}
.sh-panel__acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- cta ---------- */
.sh-cta {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  flex-wrap: wrap;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 24px;
  border: 1px solid rgba(255, 107, 95, 0.26);
  background: linear-gradient(135deg, #FFF6E4, #FFE4DA 60%, #FFD9E8);
}
.sh-cta .h2 { margin: 10px 0 12px; }
.sh-cta p { font-size: 12.5px; color: var(--cream-2); }
.sh-cta__acts { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .sh-hero__inner { grid-template-columns: 1fr; }
  .sh-count { align-items: flex-start; text-align: left; }
}
@media (max-width: 760px) {
  .sh-hero { padding-top: 108px; }
  .shelf { padding: 14px 10px 18px; }
  .book { width: 40px; }
  .book__name { font-size: 11px; }
  .books { padding-left: 4px; padding-right: 4px; }
  .sh-cta { flex-direction: column; align-items: flex-start; }
}
