:root {
  color-scheme: light;
  --ink: #17394a;
  --muted: #5e7b89;
  --sky: #dff4ff;
  --sky-deep: #b9e5f7;
  --mint: #dff4e8;
  --peach: #ffdcca;
  --butter: #fff1bb;
  --lilac: #e9e1f8;
  --rose: #f6c8d4;
  --paper: rgba(255, 255, 255, 0.93);
  --shadow: 0 20px 46px rgba(43, 97, 121, 0.14);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #f8fcff;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 220, 202, 0.58), transparent 30rem),
    radial-gradient(circle at 88% 21%, rgba(233, 225, 248, 0.72), transparent 28rem),
    radial-gradient(circle at 48% 84%, rgba(223, 244, 232, 0.58), transparent 32rem),
    linear-gradient(165deg, #fafdff 0%, var(--sky) 51%, #f7fcff 100%);
}

a { color: inherit; }

.recommendations {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem 0 1rem;
}

.orbit-stage {
  position: relative;
  width: calc(100% - 0.8rem);
  max-width: 560px;
  height: clamp(560px, 82svh, 720px);
  margin: 0 auto;
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.orbit-stage.is-spinning,
.orbit-stage.is-card-dragging {
  cursor: grabbing;
}

.book-orbit {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.book-node {
  position: absolute;
  top: 0;
  left: 0;
  width: min(39vw, 148px);
  pointer-events: auto;
  will-change: transform;
  transform: translate3d(-200vw, -200vh, 0) translate(-50%, -50%);
}

.book-shell {
  --card-scale: 1;
  --card-tilt: 0deg;
  width: 100%;
  transform: rotate(var(--card-tilt)) scale(var(--card-scale));
  transform-origin: center;
  transition:
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 220ms ease;
  will-change: transform;
}

.book-node.is-inspecting .book-shell {
  --card-scale: 1.2;
  filter: saturate(1.035) brightness(1.015);
}

.book-node.is-dragging .book-shell {
  --card-scale: 1.055;
  filter: saturate(1.04) brightness(1.02);
  transition-duration: 120ms;
}

.book-card {
  position: relative;
  width: 100%;
  height: calc(min(39vw, 148px) * 1.4 + 4.1rem);
  margin: 0;
  outline: none;
  perspective: 1200px;
  cursor: pointer;
}

.book-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotateY(0deg);
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.18, 0.76, 0.2, 1);
  will-change: transform;
}

.book-node.is-inspecting .book-card-inner {
  transform: rotateY(180deg);
}

.book-node.is-dragging .book-card-inner {
  transform: rotateY(0deg) !important;
}

.book-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(55, 116, 145, 0.15);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.book-face--front {
  display: flex;
  flex-direction: column;
  padding: 0.52rem;
  transform: rotateY(0deg) translateZ(0.5px);
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.book-face--back {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.95rem 0.9rem;
  transform: rotateY(180deg) translateZ(0.5px);
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 241, 187, 0.88), transparent 45%),
    radial-gradient(circle at 88% 88%, rgba(233, 225, 248, 0.9), transparent 50%),
    rgba(250, 254, 255, 0.98);
}

.book-card:focus-visible .book-face {
  outline: 3px solid rgba(39, 113, 149, 0.5);
  outline-offset: 5px;
}

.book-cover {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 5 / 7;
  border-radius: 16px;
  background: var(--sky-deep);
}

.book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.book-meta {
  display: grid;
  gap: 0.24rem;
  padding: 0.68rem 0.28rem 0.22rem;
}

.book-title {
  font-size: clamp(0.88rem, 3.5vw, 0.98rem);
  font-weight: 690;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.book-author {
  color: var(--muted);
  font-size: clamp(0.72rem, 2.8vw, 0.82rem);
  line-height: 1.3;
}

.review-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.54rem;
  border-radius: 999px;
  background: rgba(185, 229, 247, 0.62);
  color: #426979;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.review-kicker::before {
  content: "✦";
  color: #d68070;
  font-size: 0.62rem;
}

.book-review {
  margin: 0.7rem 0;
  color: #244a5a;
  font-size: clamp(0.74rem, 3vw, 0.84rem);
  line-height: 1.72;
}

.open-cue {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  overflow: hidden;
  padding: 0.52rem 0.7rem;
  border: 1px solid rgba(55, 116, 145, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #315d6f;
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-decoration: none;
  pointer-events: none;
  transition: transform 160ms ease, background 160ms ease;
}

.book-node.is-inspecting .open-cue {
  pointer-events: auto;
}

.open-cue:hover,
.open-cue:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
}

.open-cue::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -70%;
  width: 48%;
  transform: skewX(-16deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.84), transparent);
  animation: cue-shimmer 3.5s ease-in-out infinite;
}

.orbit-ring,
.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
}

.orbit-ring {
  border-radius: 50%;
  will-change: transform, border-radius;
}

.orbit-ring--outer {
  width: 69%;
  height: 55%;
  border: 1px dashed rgba(55, 121, 151, 0.18);
  animation: ring-outer 68s linear infinite;
}

.orbit-ring--middle {
  width: 58%;
  height: 45%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: ring-middle 58s ease-in-out infinite alternate;
}

.orbit-ring--inner {
  width: 43%;
  height: 34%;
  border: 1px dotted rgba(76, 136, 161, 0.18);
  animation: ring-inner 82s linear infinite reverse;
}

.orbit-center {
  display: grid;
  width: 3.7rem;
  height: 3.7rem;
  place-items: center;
  border: 1px solid rgba(172, 142, 77, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 31%, #fffdf1 0%, #fff2ae 38%, #f5cf72 72%, #e8b85d 100%);
  box-shadow:
    0 0 0 8px rgba(255, 241, 187, 0.13),
    0 0 36px rgba(245, 207, 114, 0.34),
    0 12px 35px rgba(74, 114, 131, 0.12);
  transform: translate(-50%, -50%);
  animation: sun-pulse 4.3s ease-in-out infinite;
}

.orbit-center::before,
.orbit-center::after {
  content: "";
  position: absolute;
  inset: -17px;
  border: 1px solid rgba(246, 200, 116, 0.2);
  border-radius: 50%;
  animation: sun-halo 5.2s ease-in-out infinite;
}

.orbit-center::after {
  inset: -29px;
  border-color: rgba(255, 255, 255, 0.34);
  animation-delay: -2.4s;
}

.orbit-center span {
  position: relative;
  z-index: 1;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.orbit-hint {
  width: fit-content;
  max-width: calc(100vw - 2rem);
  margin: -0.1rem auto 0;
  padding: 0.48rem 0.76rem;
  border: 1px solid rgba(50, 111, 140, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ambient-shape {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
  filter: blur(2px);
  will-change: transform, border-radius, opacity;
}

.ambient-shape--one {
  top: 7%;
  left: -5rem;
  width: 11rem;
  height: 11rem;
  background: var(--mint);
  animation: ambient-one 48s ease-in-out infinite alternate;
}

.ambient-shape--two {
  right: -5.3rem;
  bottom: 5%;
  width: 12.5rem;
  height: 12.5rem;
  background: var(--peach);
  animation: ambient-two 56s ease-in-out infinite alternate;
}

.ambient-shape--three {
  top: 39%;
  right: 6%;
  width: 5.2rem;
  height: 5.2rem;
  background: var(--lilac);
  opacity: 0.38;
  filter: blur(6px);
  animation: ambient-three 42s ease-in-out infinite alternate;
}

.ambient-shape--four {
  bottom: 16%;
  left: 8%;
  width: 5.7rem;
  height: 5.7rem;
  background: var(--rose);
  opacity: 0.25;
  filter: blur(9px);
  animation: ambient-four 51s ease-in-out infinite alternate;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.no-js .recommendations { min-height: auto; }
.no-js .orbit-stage { height: auto; padding: 2rem 0; cursor: default; }
.no-js .orbit-ring,
.no-js .orbit-center { display: none; }
.no-js .book-orbit {
  position: static;
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  pointer-events: auto;
}
.no-js .book-node {
  position: static;
  width: min(78vw, 230px);
  transform: none !important;
}
.no-js .book-card { height: calc(min(78vw, 230px) * 1.4 + 4.1rem); }

@media (min-width: 720px) {
  .recommendations { padding-block: 1rem; }
  .orbit-stage {
    width: min(96vw, 1160px);
    max-width: 1160px;
    height: clamp(650px, 88vh, 820px);
  }
  .book-node { width: clamp(185px, 18vw, 214px); }
  .book-card { height: calc(clamp(185px, 18vw, 214px) * 1.4 + 4.5rem); }
  .book-title { font-size: 1.02rem; }
  .book-author { font-size: 0.82rem; }
  .book-review { font-size: 0.84rem; }
  .orbit-ring--outer { width: 74%; height: 59%; }
  .orbit-ring--middle { width: 61%; height: 47%; }
  .orbit-ring--inner { width: 46%; height: 36%; }
}

@keyframes cue-shimmer {
  0%, 45% { left: -70%; }
  78%, 100% { left: 135%; }
}

@keyframes ring-outer {
  0% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); border-radius: 50%; }
  35% { transform: translate(-50%, -50%) rotate(116deg) scale(1.07, 0.95); border-radius: 46% 54% 52% 48%; }
  70% { transform: translate(-50%, -50%) rotate(242deg) scale(0.96, 1.065); border-radius: 54% 46% 47% 53%; }
  100% { transform: translate(-50%, -50%) rotate(350deg) scale(1); border-radius: 50%; }
}

@keyframes ring-middle {
  from { transform: translate(-50%, -50%) rotate(11deg) scale(0.94, 1.06); border-radius: 47% 53% 55% 45%; }
  to { transform: translate(-50%, -50%) rotate(-9deg) scale(1.07, 0.93); border-radius: 55% 45% 47% 53%; }
}

@keyframes ring-inner {
  0% { transform: translate(-50%, -50%) rotate(18deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(198deg) scale(0.93, 1.08); }
  100% { transform: translate(-50%, -50%) rotate(378deg) scale(1); }
}

@keyframes sun-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.97);
    box-shadow: 0 0 0 8px rgba(255, 241, 187, 0.11), 0 0 30px rgba(245, 207, 114, 0.28), 0 12px 35px rgba(74, 114, 131, 0.12);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.07);
    box-shadow: 0 0 0 14px rgba(255, 241, 187, 0.16), 0 0 50px rgba(245, 207, 114, 0.42), 0 14px 38px rgba(74, 114, 131, 0.13);
  }
}

@keyframes sun-halo {
  0%, 100% { transform: scale(0.92); opacity: 0.36; }
  50% { transform: scale(1.11); opacity: 0.84; }
}

@keyframes ambient-one {
  0% { transform: translate3d(0, 0, 0) scale(0.88, 1.06); border-radius: 50%; opacity: 0.48; }
  45% { transform: translate3d(5.8rem, 6.6rem, 0) scale(1.28, 0.82); border-radius: 40% 60% 56% 44%; opacity: 0.61; }
  100% { transform: translate3d(2.2rem, 13rem, 0) scale(0.8, 1.24); border-radius: 60% 40% 44% 56%; opacity: 0.5; }
}

@keyframes ambient-two {
  0% { transform: translate3d(0, 0, 0) scale(1.04, 0.9); border-radius: 50%; opacity: 0.5; }
  50% { transform: translate3d(-7rem, -6.3rem, 0) scale(1.22, 0.78); border-radius: 58% 42% 61% 39%; opacity: 0.61; }
  100% { transform: translate3d(-2.7rem, -12rem, 0) scale(0.82, 1.23); border-radius: 43% 57% 41% 59%; opacity: 0.47; }
}

@keyframes ambient-three {
  from { transform: translate3d(1rem, -2rem, 0) scale(0.72, 1.12); opacity: 0.28; }
  to { transform: translate3d(-7rem, 6.2rem, 0) scale(1.42, 0.72); opacity: 0.44; }
}

@keyframes ambient-four {
  from { transform: translate3d(-2rem, 1rem, 0) scale(0.75, 1.22); opacity: 0.18; }
  to { transform: translate3d(7rem, -6.6rem, 0) scale(1.36, 0.78); opacity: 0.3; }
}

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