:root {
  --bg-0: #080c17;
  --bg-1: #0e1628;
  --bg-2: #0a101f;
  --glass: rgba(16, 24, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --ink: #f6f8fc;
  --ink-2: #b9c4d8;
  --ink-3: #7f8ea8;
  --orange: #f05a1a;
  --orange-bright: #ff7a33;
  --orange-deep: #c93f08;
  --orange-glow: rgba(240, 90, 26, 0.42);
  --indigo-glow: rgba(78, 114, 255, 0.24);
  --cyan-glow: rgba(56, 189, 248, 0.18);
  --danger: #ff6b6b;
  --ok: #34d399;
  --book-w: clamp(206px, 21.5vw, 276px);
  --book-h: calc(var(--book-w) * 1.336);
  --book-depth: 28px;
  --tilt-x: 6deg;
  --tilt-y: -20deg;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse 90% 80% at 24% 48%, #161d34 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== 实时交互数学星轨画布 ===== */
.math-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== 氛围光晕与精细制图网格 ===== */
.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 178, 235, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 178, 235, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 78% 72% at 50% 48%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 48%, #000 30%, transparent 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: orbDrift 14s ease-in-out infinite alternate;
}

.orb-orange {
  width: 520px;
  height: 520px;
  left: 6%;
  top: 12%;
  background: radial-gradient(circle, rgba(240, 90, 26, 0.30) 0%, rgba(240, 90, 26, 0) 70%);
}

.orb-indigo {
  width: 580px;
  height: 580px;
  right: 2%;
  top: 4%;
  background: radial-gradient(circle, var(--indigo-glow) 0%, rgba(78, 114, 255, 0) 72%);
  animation-delay: -5s;
}

.orb-cyan {
  width: 440px;
  height: 440px;
  right: 18%;
  bottom: -14%;
  background: radial-gradient(circle, var(--cyan-glow) 0%, rgba(56, 189, 248, 0) 72%);
  animation-delay: -9s;
}

@keyframes orbDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(26px, -22px, 0) scale(1.08); }
}

/* 翻书进入时的全屏柔光过渡 */
.portal-flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 32% 48%, rgba(255, 244, 232, 0.96) 0%, rgba(240, 90, 26, 0.25) 45%, rgba(10, 15, 28, 0.92) 100%);
  transition: opacity 0.55s ease 0.42s;
}

body.opening .portal-flash {
  opacity: 1;
}

/* ===== 页面骨架 ===== */
.site {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1260px;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

/* ===== 顶部导航栏 ===== */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: fadeSlideDown 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-seal {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--orange-bright), var(--orange-deep));
  color: #fff;
  font-family: inherit;
  font-size: 21px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 26px rgba(240, 90, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.brand-text p {
  margin: 0;
  line-height: 1.25;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.brand-author {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange-bright);
  box-shadow: 0 0 0 0 rgba(255, 122, 51, 0.7);
  animation: pulseRing 2.2s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 51, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(255, 122, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 51, 0); }
}

/* ===== 主双栏布局 ===== */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4.2vw, 64px);
  padding: 6px 0 8px;
}

/* ===== 左侧：3D 悬浮合页立体书舞台 ===== */
.stage-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeScaleIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.book-stage {
  position: relative;
  width: 100%;
  min-height: calc(var(--book-h) + 92px);
  display: grid;
  place-items: center;
  perspective: 1600px;
  perspective-origin: 50% 48%;
}

/* 旋转轨道光环 */
.orbit {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-outer {
  width: calc(var(--book-w) * 1.62);
  height: calc(var(--book-w) * 1.62);
  border: 1px dashed rgba(148, 178, 235, 0.18);
  animation: spinSlow 42s linear infinite;
}

.orbit-inner {
  width: calc(var(--book-w) * 1.32);
  height: calc(var(--book-w) * 1.32);
  border: 1px solid rgba(255, 122, 51, 0.16);
  animation: spinSlow 28s linear infinite reverse;
}

.orbit-node {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--orange-bright);
  box-shadow: 0 0 14px var(--orange-bright);
}

.orbit-node.node-b {
  top: auto;
  bottom: -3.5px;
  width: 7px;
  height: 7px;
  background: #60a5fa;
  box-shadow: 0 0 14px #60a5fa;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 书后方两侧叠影扇面 */
.book-fan {
  position: absolute;
  width: calc(var(--book-w) * 0.78);
  height: calc(var(--book-h) * 0.78);
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.42;
  filter: brightness(0.75) saturate(0.9);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
  pointer-events: none;
}

.book-fan img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fan-left {
  transform: translate3d(calc(var(--book-w) * -0.46), 14px, -110px) rotateY(-28deg) rotateZ(-9deg);
}

.fan-right {
  transform: translate3d(calc(var(--book-w) * 0.48), 16px, -120px) rotateY(22deg) rotateZ(8deg);
}

.book-stage:hover .fan-left {
  transform: translate3d(calc(var(--book-w) * -0.54), 10px, -100px) rotateY(-32deg) rotateZ(-12deg);
  opacity: 0.58;
}

.book-stage:hover .fan-right {
  transform: translate3d(calc(var(--book-w) * 0.56), 12px, -110px) rotateY(26deg) rotateZ(11deg);
  opacity: 0.58;
}

/* 底座柔光投影 */
.book-pedestal {
  position: absolute;
  width: calc(var(--book-w) * 1.15);
  height: 36px;
  bottom: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(240, 90, 26, 0.35) 0%, rgba(10, 14, 24, 0.6) 45%, transparent 76%);
  filter: blur(12px);
  animation: shadowBreath 5.2s ease-in-out infinite;
}

@keyframes shadowBreath {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(0.88); opacity: 0.58; }
}

/* 零重力呼吸悬浮 */
.book-float {
  animation: bookFloat 5.2s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes bookFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* 3D 实体立体书 */
.book-3d {
  position: relative;
  width: var(--book-w);
  height: var(--book-h);
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  cursor: pointer;
}

.book-3d.switching {
  transform: rotateX(var(--tilt-x)) rotateY(calc(var(--tilt-y) - 18deg)) scale(0.95);
}

.book-back {
  position: absolute;
  inset: 0;
  border-radius: 4px 12px 12px 4px;
  background: linear-gradient(155deg, #c9440c, #8d2a04);
  transform: translateZ(calc(var(--book-depth) * -0.5));
  box-shadow: 0 32px 68px rgba(0, 0, 0, 0.62);
}

.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--book-depth);
  height: 100%;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, #9d3206 0%, #ea5b1b 48%, #c6440c 100%);
  transform-origin: left center;
  transform: translateZ(calc(var(--book-depth) * -0.5)) rotateY(-90deg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset -2px 0 8px rgba(0, 0, 0, 0.28);
}

.book-spine span {
  writing-mode: vertical-rl;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.book-edges {
  position: absolute;
  top: 5px;
  right: 2px;
  width: calc(var(--book-depth) - 4px);
  height: calc(100% - 10px);
  transform-origin: right center;
  transform: translateZ(calc(var(--book-depth) * 0.5 - 2px)) rotateY(-90deg);
  background:
    repeating-linear-gradient(
      to right,
      #f8fafc 0px,
      #f8fafc 2px,
      #d8e0ec 2px,
      #d8e0ec 3.5px
    );
  box-shadow: inset 0 0 10px rgba(10, 15, 28, 0.22);
}

.book-inside {
  position: absolute;
  inset: 4px 4px 4px 2px;
  border-radius: 2px 10px 10px 2px;
  background: linear-gradient(145deg, #ffffff 0%, #eef3fa 100%);
  transform: translateZ(calc(var(--book-depth) * 0.5 - 2px));
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
  box-shadow: inset 14px 0 26px rgba(15, 23, 42, 0.14);
}

.inside-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(240, 90, 26, 0.18), transparent 65%);
}

.inside-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 1.5px solid rgba(39, 64, 102, 0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  gap: 10px;
}

.inside-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--orange);
}

.inside-title {
  font-family: inherit;
  font-size: 19px;
  color: #141a24;
}

.inside-popup {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
}

.popup-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--orange);
  opacity: 0.65;
}

.popup-ring.r1 { width: 46px; height: 46px; border-style: dashed; }
.popup-ring.r2 { width: 26px; height: 26px; border-color: #274066; }

.inside-sub {
  margin: 0;
  font-size: 12px;
  color: #5b677d;
}

/* 可翻开的 3D 橙色封面 */
.book-cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--book-depth) * 0.5));
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 4px 12px 12px 4px;
}

.cover-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px 12px 12px 4px;
  overflow: hidden;
}

.cover-front {
  background: #17346a;
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.45),
    0 0 36px rgba(240, 90, 26, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.cover-front img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cover-crease {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.24) 0%,
    rgba(255, 255, 255, 0.22) 28%,
    rgba(0, 0, 0, 0.10) 56%,
    transparent 100%
  );
  pointer-events: none;
}

/* 流光扫过书封效果 */
.cover-sheen {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 32%,
    rgba(255, 255, 255, 0.24) 46%,
    rgba(255, 255, 255, 0.06) 54%,
    transparent 66%
  );
  transform: translateX(-110%);
  animation: sheenSweep 6.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheenSweep {
  0%, 62% { transform: translateX(-110%); }
  100% { transform: translateX(120%); }
}

.cover-inner {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, #f8fafc, #e6edf7);
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 26, 36, 0.12);
}

.cover-inner span {
  font-size: 12.5px;
  font-weight: 700;
  color: #5b677d;
  letter-spacing: 0.12em;
}

/* 点击书本可轻掀一角预览 */
.book-3d.peeking .book-cover {
  transform: translateZ(calc(var(--book-depth) * 0.5)) rotateY(-34deg);
}

/* 当前书册亮点浮标 */
.vol-spotlight {
  position: absolute;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 7px;
  border-radius: 999px;
  background: rgba(14, 21, 38, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  max-width: 96%;
}

.vol-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange-bright), var(--orange));
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.vol-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 六册切换玻璃底座 ===== */
.shelf {
  width: 100%;
  max-width: 500px;
}

.volumes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(15, 22, 40, 0.66);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.volumes button {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 6px 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.volumes button img {
  width: 40px;
  height: 54px;
  object-fit: contain;
  border-radius: 5px;
  opacity: 0.78;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.36);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.volumes button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  transform: translateY(-2px);
}

.volumes button:hover img {
  opacity: 1;
}

.volumes button[aria-pressed="true"] {
  background: rgba(240, 90, 26, 0.16);
  border-color: rgba(255, 122, 51, 0.78);
  color: #fff;
  box-shadow: 0 0 22px rgba(240, 90, 26, 0.28);
}

.volumes button[aria-pressed="true"] img {
  opacity: 1;
  transform: translateY(-2px) scale(1.06);
}

.volumes button:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 2px;
}

/* ===== 右侧：高吸引力文案 + 暗夜磨砂口令卡 ===== */
.entry-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeSlideUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(240, 90, 26, 0.14);
  border: 1px solid rgba(255, 122, 51, 0.34);
  color: #ff9c66;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.eyebrow-spark {
  color: var(--orange-bright);
}

#cover-title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(36px, 4.3vw, 54px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.title-accent {
  background: linear-gradient(110deg, #ff9955 0%, #ff5e1f 52%, #ffb07c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.hero-lead {
  margin: 14px 0 0;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-2);
}

.hero-lead strong {
  color: #ffffff;
  font-weight: 700;
}

/* 三项亮点指标 */
.metric-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric strong {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.metric span {
  font-size: 12px;
  color: var(--ink-3);
}

.metric-sep {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.12);
}

/* 磨砂玻璃口令解锁卡 */
.entry-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: clamp(20px, 2.6vw, 28px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#access-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#access-form label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.03em;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(7, 11, 22, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.password-field:focus-within {
  background: rgba(7, 11, 22, 0.92);
  border-color: var(--orange-bright);
  box-shadow: 0 0 0 4px rgba(240, 90, 26, 0.22);
}

.password-field:has(input[aria-invalid="true"]) {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
  animation: field-shake 0.36s ease;
}

.field-icon {
  display: grid;
  place-items: center;
  margin-left: 14px;
  color: var(--ink-3);
  flex-shrink: 0;
}

#book-password {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  background: transparent;
  padding: 0 10px 0 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  outline: none;
}

#book-password::placeholder {
  color: #6c7b96;
  font-weight: 500;
}

#show-password {
  appearance: none;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  margin-right: 4px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
  flex-shrink: 0;
}

#show-password:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

#show-password:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 1px;
}

#show-password .icon-eye-closed { display: none; }
#show-password.is-masked .icon-eye-open { display: none; }
#show-password.is-masked .icon-eye-closed { display: block; }

.feedback {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.feedback.is-error { color: var(--danger); }
.feedback.is-ok { color: var(--ok); }

/* 流光主按钮 */
.open-book {
  position: relative;
  overflow: hidden;
  appearance: none;
  border: 0;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7a33 0%, #f05a1a 52%, #d44209 100%);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(240, 90, 26, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.32) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: btnShine 4.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes btnShine {
  0%, 58% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}

.open-book:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(240, 90, 26, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: brightness(1.05);
}

.open-book:active:not(:disabled) {
  transform: translateY(0.5px);
}

.open-book:disabled {
  opacity: 0.78;
  cursor: wait;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.22s ease;
}

.open-book:hover:not(:disabled) .btn-arrow {
  transform: translateX(5px);
}

.noscript-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.entry-foot {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

/* ===== 输对口令：电影级 3D 翻书进入动画 ===== */
body.opening .book-float {
  animation-play-state: paused;
}

body.opening .book-3d {
  transform: rotateX(2deg) rotateY(-2deg) scale(1.16);
}

body.opening .book-cover {
  transform: translateZ(calc(var(--book-depth) * 0.5)) rotateY(-158deg);
}

body.opening .fan-left,
body.opening .fan-right {
  opacity: 0;
  transform: scale(0.86);
}

body.opening .entry-col,
body.opening .shelf,
body.opening .masthead,
body.opening .vol-spotlight {
  opacity: 0.16;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  88% { transform: translateX(3px); }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== iPad 竖屏 & 窄屏 ===== */
@media (max-width: 960px) {
  :root {
    --book-w: clamp(184px, 32vw, 240px);
    --book-depth: 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 20px;
    padding: 4px 0 12px;
  }

  .book-stage {
    min-height: calc(var(--book-h) + 76px);
  }

  .entry-col {
    max-width: 540px;
    width: 100%;
    margin: 0 auto;
  }

  .hero-copy {
    text-align: center;
  }

  .metric-row {
    justify-content: center;
  }
}

/* ===== iPad 横屏紧凑高度（如 1024x768 / 1180x820） ===== */
@media (min-width: 961px) and (max-height: 820px) {
  :root {
    --book-w: clamp(188px, 24vh, 238px);
    --book-depth: 22px;
  }

  .site { gap: 10px; }
  .stage-col { gap: 12px; }
  .book-stage { min-height: calc(var(--book-h) + 68px); }
  #cover-title { font-size: clamp(32px, 3.8vw, 44px); }
  .hero-lead { font-size: 14.5px; margin-top: 10px; }
  .metric-row { margin-top: 12px; }
  .entry-card { padding: 18px 22px; }
}

/* ===== 手机小屏 ===== */
@media (max-width: 540px) {
  :root {
    --book-w: clamp(156px, 44vw, 194px);
    --book-depth: 18px;
  }

  .status-pill { display: none; }
  .fan-left, .fan-right { display: none; }

  .volumes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .volumes button img { width: 36px; height: 48px; }
  .metric-row { gap: 12px; }
  .entry-card { padding: 18px 16px; border-radius: 20px; }
}

/* ===== 减弱动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


.volumes button small {
  display: block;
  font-size: 10px;
  margin-top: 2px;
  color: #bac6db;
}

.open-book {
  width: 100%;
  text-decoration: none;
}
.open-book:focus-visible {
  outline: 3px solid #ffb58b;
  outline-offset: 3px;
}
.opening .open-book {
  pointer-events: none;
}
@media (max-width: 540px) {
  .volumes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.password-field[hidden], #access-form label[hidden] {
  display: none;
}

@keyframes field-shake {
  25%, 75% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
}
