/* ============================================================================
   《星云航线》
   纪念碑谷 / 小王子 治愈暖彩绘本风样式表 (panda_storybook.css)
   ============================================================================ */

:root {
  --storybook-cream: rgba(255, 251, 243, 0.92);
  --storybook-card: rgba(255, 248, 235, 0.95);
  --storybook-ink: #3d2b1f;
  --storybook-sub: #7c5e46;
  --storybook-gold: #d97706;
  --storybook-gold-bright: #f59e0b;
  --storybook-border: rgba(217, 119, 6, 0.36);
  --storybook-shadow: 0 14px 38px rgba(92, 61, 30, 0.18);
  --duoji-warm: #16a34a;
  --mimi-warm: #9333ea;
  --pading-warm: #0284c7;
}

/* 彻底屏蔽任何工程调试黑条，防止遮挡台词与画面 */
#hardwareControls,
#hardwareMonitor,
#ringChain {
  display: none !important;
}

/* ============================================================================
   1. 顶部中央：🤖 小机器人「拾光」实时拼装【屋顶流星放映机】工作台
   ============================================================================ */
.projector-workbench {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--storybook-cream);
  backdrop-filter: blur(14px);
  border: 2px solid var(--storybook-border);
  border-radius: 22px;
  padding: 8px 18px 8px 12px;
  box-shadow: var(--storybook-shadow);
  color: var(--storybook-ink);
  max-width: min(860px, 94vw);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.projector-workbench.pulse-upgrade {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.65);
  border-color: #f59e0b;
}

.shiguang-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid rgba(217, 119, 6, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.8);
}

.shiguang-avatar-wrap img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.projector-workbench.pulse-upgrade .shiguang-avatar-wrap img {
  animation: wrenchHammer 0.55s ease-in-out;
}

@keyframes wrenchHammer {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-16deg) scale(1.15); }
  50% { transform: rotate(14deg) scale(1.18); }
  75% { transform: rotate(-8deg) scale(1.08); }
}

.shiguang-wrench-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fffdf9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.workbench-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 260px;
}

.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workbench-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--storybook-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.workbench-stage-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.projector-slots-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.projector-slot-dot {
  width: 22px;
  height: 10px;
  border-radius: 999px;
  background: rgba(180, 140, 100, 0.22);
  border: 1px solid rgba(180, 140, 100, 0.45);
  transition: all 0.3s ease;
  position: relative;
}

.projector-slot-dot.filled {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-color: #d97706;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.65);
}

.projector-slot-dot.knob-event-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffbeb;
  border: 2px dashed #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.projector-slot-dot.knob-event-marker.filled {
  background: #f59e0b;
  color: #fff;
  border-style: solid;
}

.workbench-dialogue {
  font-size: 12.5px;
  color: var(--storybook-sub);
  font-weight: 600;
  max-width: 440px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 6枚总星灯透镜小徽章栏 */
.projector-lenses-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-left: 12px;
  border-left: 1.5px dashed rgba(217, 119, 6, 0.3);
}

.lenses-icons-row {
  display: flex;
  gap: 4px;
}

.lens-mini-gem {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(180, 140, 100, 0.18);
  border: 1.5px solid rgba(180, 140, 100, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #a88b73;
  transition: all 0.3s ease;
}

.lens-mini-gem.repaired {
  background: radial-gradient(circle, #fef08a 0%, #f59e0b 100%);
  border-color: #b45309;
  color: #78350f;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  transform: scale(1.1);
}

.lens-mini-gem.current {
  border-color: #d97706;
  background: #fffbeb;
  color: #d97706;
  font-weight: 900;
}

/* ============================================================================
   2. 右下角绘本风「黄金星盘罗盘 & 拾光星灯大招」组件 (#starCompassWidget)
   ============================================================================ */
.star-compass-widget {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--storybook-cream);
  border: 2px solid var(--storybook-border);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  box-shadow: var(--storybook-shadow);
  color: var(--storybook-ink);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.star-compass-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(217, 119, 6, 0.28);
}

.star-compass-widget.nova-ready {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.55);
  animation: compassPulse 1.8s infinite ease-in-out;
}

@keyframes compassPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.compass-dial-ring {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbeb 0%, #fde68a 75%, #f59e0b 100%);
  border: 2.5px solid #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(217, 119, 6, 0.25);
}

.compass-needle {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.compass-needle::after {
  content: "▲";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #b45309;
  text-shadow: 0 1px 2px #fff;
}

.compass-center-icon {
  font-size: 22px;
  line-height: 1;
  z-index: 2;
}

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

.compass-lane-tag {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--storybook-ink);
}

.compass-action-tag {
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
}

/* ============================================================================
   3. 盘中重头戏：「🎛️ 狂拧旋钮帮拾光给星灯上发条」互动弹窗 (#knobEventModal)
   ============================================================================ */
.knob-event-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(61, 43, 31, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.knob-event-card {
  width: min(560px, 92vw);
  background: linear-gradient(180deg, #fffdf9 0%, #fef3c7 100%);
  border: 3px solid #f59e0b;
  border-radius: 28px;
  padding: 24px 28px;
  box-shadow: 0 24px 64px rgba(120, 53, 15, 0.38);
  text-align: center;
  color: var(--storybook-ink);
  position: relative;
  overflow: hidden;
}

.knob-event-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.knob-event-title {
  font-size: 22px;
  font-weight: 900;
  color: #78350f;
  margin-bottom: 6px;
}

.knob-event-desc {
  font-size: 13.5px;
  color: #92400e;
  margin-bottom: 16px;
  line-height: 1.5;
}

.clockwork-stage {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clockwork-gear-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px dashed #d97706;
  background: radial-gradient(circle, #fffbeb 0%, #fde68a 70%, #fcd34d 100%);
  box-shadow: 0 8px 28px rgba(217, 119, 6, 0.35);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.clockwork-center-lamp {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fffdf9;
  border: 3px solid #f59e0b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(245, 158, 11, 0.3);
}

.clockwork-center-lamp img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.clockwork-percent {
  font-size: 15px;
  font-weight: 900;
  color: #b45309;
  margin-top: 2px;
}

.knob-progress-bar {
  width: 100%;
  height: 16px;
  background: rgba(217, 119, 6, 0.18);
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid rgba(217, 119, 6, 0.45);
  margin-bottom: 12px;
}

.knob-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.16s ease;
}

.knob-manual-btn {
  appearance: none;
  border: 2px solid #d97706;
  background: #fffbeb;
  color: #92400e;
  font-size: 13.5px;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.knob-manual-btn:hover {
  background: #fde68a;
  transform: scale(1.04);
}

/* ============================================================================
   极简纸质绘本：开场页 (#onboardingOverlay)、过关弹窗 (#storyModal)、
   信物卡、记忆回响气泡、关底分镜。
   只用三种颜色：纸 #fbf8f2 · 墨 #2c221e · 哑光暗金细线 rgba(180,130,70,.32)
   只用三种字号：标题 22px · 正文 15.5px(行高 1.9) · 提示/按钮 13px
   选择器带 ID，优先级高于 index.html 内联样式。
   ============================================================================ */
:root {
  --sb-paper: #fbf8f2;
  --sb-ink: #2c221e;
  --sb-line: rgba(180, 130, 70, 0.32);
  --sb-serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
}

#onboardingOverlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--sb-paper);
  backdrop-filter: none;
  transition: opacity 0.5s ease;
}
#onboardingOverlay.hidden { opacity: 0; pointer-events: none; }
#onboardingOverlay #prologueAtmosphereCanvas { opacity: 0.18; filter: grayscale(1) sepia(0.6); }

#onboardingOverlay .storybook-sheet {
  width: min(860px, 95vw);
  min-height: 0;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px 36px 20px;
  background: var(--sb-paper);
  border: 1px solid var(--sb-line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(44, 34, 30, 0.14);
  color: var(--sb-ink);
  font-family: var(--sb-serif);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 顶部书名 + 三页递进横排胶囊标签（不竖排、不重叠） */
#onboardingOverlay .storybook-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--sb-line);
  font: 700 13px/1.4 var(--sb-serif);
  letter-spacing: 0.06em;
  color: var(--sb-ink);
}
#onboardingOverlay .storybook-page-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#onboardingOverlay .storybook-page-btn {
  width: auto !important;
  height: auto !important;
  padding: 6px 14px;
  border: 1px solid var(--sb-line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.85);
  color: var(--sb-ink);
  font: 700 12.5px/1.25 var(--sb-sans);
  letter-spacing: 0.02em;
  white-space: nowrap !important;
  cursor: pointer;
  transition: all 0.2s ease;
}
#onboardingOverlay .storybook-page-btn:hover {
  background: rgba(180, 130, 70, 0.14);
}
#onboardingOverlay .storybook-page-btn.active {
  background: var(--sb-ink);
  border-color: var(--sb-ink);
  color: var(--sb-paper);
  box-shadow: 0 3px 10px rgba(44, 34, 30, 0.2);
}

/* 左图右文双栏开本布局（单屏完整展示，不拉长滚动） */
#onboardingOverlay .onboarding-panel { display: none; flex: none; }
#onboardingOverlay .onboarding-panel.active {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  align-items: center;
  text-align: left;
  animation: sbPage 0.4s ease;
}
@media (max-width: 740px) {
  #onboardingOverlay .onboarding-panel.active {
    grid-template-columns: 1fr;
  }
}
@keyframes sbPage { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sb-art {
  position: relative;
  width: 100%;
  height: 168px;
  margin: 0 0 18px;
  border: 1px solid var(--sb-line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sb-paper);
}
.sb-art-main { width: 100%; height: 100%; object-fit: contain; filter: sepia(0.18) saturate(0.82); }
.sb-art-main[src$="bg_greenhouse.png"] { object-fit: cover; opacity: 0.88; }
.sb-art-inset { position: absolute; right: 22px; bottom: 6px; height: 118px; width: auto; filter: drop-shadow(0 4px 6px rgba(44, 34, 30, 0.18)); }

.sb-title { margin: 0 0 12px; font: 700 21px/1.45 var(--sb-serif); letter-spacing: 0.05em; color: var(--sb-ink); border: 0; padding: 0; }
.sb-prose { font: 400 15px/1.85 var(--sb-serif); letter-spacing: 0.04em; color: var(--sb-ink); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.sb-prose p { margin: 0; text-indent: 2em; }
.sb-hint { margin: 16px 0 0; padding-top: 12px; width: 100%; border-top: 1px solid var(--sb-line); font: 400 13px/1.6 var(--sb-serif); letter-spacing: 0.03em; color: var(--sb-ink); opacity: 0.85; }

/* 初始画面顶部：开发板一键连接条 + 底部操控区 */
#onboardingOverlay .onboard-hid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 16px;
  margin: 0 0 16px;
  border-radius: 10px;
  border: 1.5px solid #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.14);
}
#onboardingOverlay .onboard-hid-bar.connected {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.16);
}
#onboardingOverlay .onboard-hid-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid #b45309;
  background: #d97706;
  color: #ffffff;
  font: 800 13px/1.25 var(--sb-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
#onboardingOverlay .onboard-hid-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}
#onboardingOverlay .onboard-hid-bar.connected .onboard-hid-btn {
  border-color: #15803d;
  background: #16a34a;
}

#onboardingOverlay .storybook-footer {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--sb-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#onboardingOverlay .storybook-footer > div:first-child { display: flex !important; align-items: center; gap: 10px; flex-wrap: wrap; }
#onboardingOverlay .storybook-footer > div:last-child { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-left: auto; }
#onboardingOverlay .btn-book-outline,
#onboardingOverlay .btn-book-dark,
#pandaChapterEnding .btn-book-dark,
#storyModal .btn-book-dark {
  font: 700 13.5px/1.25 var(--sb-sans);
  letter-spacing: 0.04em;
  padding: 11px 22px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
#onboardingOverlay .btn-book-outline { border: 1px solid var(--sb-line); background: transparent; color: var(--sb-ink); }
#onboardingOverlay .btn-book-outline:hover { background: rgba(180, 130, 70, 0.1); }
#onboardingOverlay .btn-book-dark,
#pandaChapterEnding .btn-book-dark,
#storyModal .btn-book-dark { border: 1px solid var(--sb-ink); background: var(--sb-ink); color: var(--sb-paper); font-weight: 400; }
#onboardingOverlay .btn-book-dark:hover,
#pandaChapterEnding .btn-book-dark:hover,
#storyModal .btn-book-dark:hover { background: var(--sb-paper); color: var(--sb-ink); transform: none; }
#onboardingOverlay button:focus-visible,
#pandaChapterEnding button:focus-visible,
#storyModal button:focus-visible { outline: 2px solid var(--sb-ink); outline-offset: 3px; }

/* —— 过关 / 迫降弹窗：同一张纸，同一套字号 —— */
#storyModal.story-modal-backdrop { background: rgba(251, 248, 242, 0.92); backdrop-filter: blur(4px); }
#storyModal .story-modal-card {
  width: min(600px, 94vw);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 36px 48px 28px;
  background: var(--sb-paper);
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  box-shadow: none;
  color: var(--sb-ink);
  font-family: var(--sb-serif);
}
#storyModal .story-modal-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid var(--sb-line); }
#storyModal .story-wonder-box { background: transparent; border: 1px solid var(--sb-line); border-radius: 2px; padding: 10px; width: 150px; }
#storyModal .story-wonder-box img { width: 96px; height: 96px; }
#storyModal .story-wonder-name,
#storyModal .story-wonder-desc,
#storyModal .story-badge-pill,
#storyModal .story-lost-item { font: 400 13px/1.7 var(--sb-serif); color: var(--sb-ink); background: transparent; border: 0; padding: 0; margin: 4px 0 0; }
#storyModal .story-modal-title { font: 700 22px/1.5 var(--sb-serif); color: var(--sb-ink); margin: 0; letter-spacing: 0.06em; }
#storyModal .story-lines-container { font: 400 15.5px/1.9 var(--sb-serif); letter-spacing: 0.06em; color: var(--sb-ink); display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; }
#storyModal .story-line-item { text-indent: 2em; }

/* —— 信物：卡片、弹窗内联、未解锁提示 —— */
.sb-keep-inline, .sb-keep-body {
  margin-top: 6px;
  padding: 14px 18px;
  border: 1px solid var(--sb-line);
  border-radius: 2px;
  background: var(--sb-paper);
  color: var(--sb-ink);
  font-family: var(--sb-serif);
  text-align: left;
}
.sb-keep-no { font: 400 13px/1.6 var(--sb-serif); letter-spacing: 0.14em; opacity: 0.78; }
.sb-keep-title { font: 700 15.5px/1.9 var(--sb-serif); }
.sb-keep-story { font: 400 13px/1.8 var(--sb-serif); letter-spacing: 0.04em; }
.sb-keep-pending { font: 400 13px/1.8 var(--sb-serif); color: var(--sb-ink); opacity: 0.7; text-align: center; padding-top: 6px; }

#pandaKeepsakeCard {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 46;
  width: min(460px, 92vw);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  cursor: pointer;
}
#pandaKeepsakeCard.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#pandaKeepsakeCard .sb-keep-body { box-shadow: 0 10px 30px rgba(44, 34, 30, 0.16); }

/* —— 拾光的记忆回响：飞行中维修台下方的一小条字 —— */
#pandaEchoBubble {
  position: fixed;
  top: 150px;
  left: 50%;
  z-index: 21;
  width: min(560px, 90vw);
  transform: translate(-50%, -6px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 18px;
  background: var(--sb-paper);
  border: 1px solid var(--sb-line);
  border-radius: 2px;
  color: var(--sb-ink);
  font: 400 13px/1.8 var(--sb-serif);
  letter-spacing: 0.04em;
  text-align: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
#pandaEchoBubble.show { opacity: 0.97; transform: translate(-50%, 0); }

/* —— 关底分镜 —— */
#pandaChapterEnding {
  position: fixed;
  inset: 0;
  z-index: 47;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(251, 248, 242, 0.96);
}
#pandaChapterEnding.show { display: flex; animation: sbPage 0.5s ease; }
#pandaChapterEnding .sb-ending-sheet {
  width: min(600px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px 48px 28px;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: var(--sb-paper);
  text-align: center;
  color: var(--sb-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
}
#pandaChapterEnding .sb-art { height: 150px; }
#pandaChapterEnding .btn-book-dark { margin-top: 18px; }

@media (max-width: 640px) {
  #onboardingOverlay .storybook-sheet, #storyModal .story-modal-card, #pandaChapterEnding .sb-ending-sheet { padding: 26px 22px 20px; }
  .sb-art { height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  #onboardingOverlay .onboarding-panel.active, #pandaChapterEnding.show { animation: none; }
  #pandaKeepsakeCard, #pandaEchoBubble { transition: none; }
}

/* =========================================================================
   极简正式关：第 1 关教学保留完整说明；第 2~6 关及无限副本（body.formal-clean-hud）精简界面
   ========================================================================= */
body.formal-clean-hud #projectorWorkbench {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}
/* 拾光说话时淡入 2.5 秒的轻量浮条 */
body.formal-clean-hud #projectorWorkbench.wb-flash {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
  padding: 6px 14px;
  gap: 8px;
}
body.formal-clean-hud #projectorWorkbench .workbench-header,
body.formal-clean-hud #projectorWorkbench .projector-slots-row,
body.formal-clean-hud #projectorWorkbench .projector-lenses-mini { display: none; }

body.formal-clean-hud .bottom-dock .pilot-pill-sub,
body.formal-clean-hud #btnCloneAutoPilot { display: none; }
/* 未派出分身时隐藏分身冗长文字，只保留已派出分身的轨道指示 */
body.formal-clean-hud .bottom-dock .clone-ctrl-pill:not(.deployed) { display: none; }
body.formal-clean-hud #btn-echo-clone [id="echoCountText"] { font-weight: 800; }

body.formal-clean-hud .star-compass-widget .compass-info { display: none; }
body.formal-clean-hud .star-compass-widget { padding: 6px; gap: 0; }
body.formal-clean-hud .star-compass-widget:hover { filter: brightness(1.05); }

@media (prefers-reduced-motion: reduce) {
  body.formal-clean-hud #projectorWorkbench { transition: none; }
}

/* 正式关：星灯罗盘满能量呼吸发光 */
body.formal-clean-hud .star-compass-widget.nova-ready {
  animation: compassBreath 2s ease-in-out infinite;
}
@keyframes compassBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
  50% { box-shadow: 0 0 18px 6px rgba(245, 158, 11, 0.55); }
}
@media (prefers-reduced-motion: reduce) {
  body.formal-clean-hud .star-compass-widget.nova-ready { animation: none; box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.5); }
}

/* 三星评价 + 三小只收集胶囊（正式关极简模式下依然常驻） */
.star-quota-pill {
  font-size: 12.5px;
  font-weight: 800;
  color: #8c5e2a;
  background: linear-gradient(135deg, #fff7e0, #fde9b8);
  border: 1.5px solid #d4a24c;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.star-quota-pill.full {
  color: #7a4a05;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}
body.formal-clean-hud .star-quota-pill { display: inline-block; }

.recall-hint {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #8c5e2a;
  opacity: 0.85;
}
body.formal-clean-hud .recall-hint { display: none; }
.clone-recall-btn { color: #b91c1c; }
.clone-ctrl-pill.deployed { cursor: pointer; }
.clone-recall-btn { appearance: none; border: 1px solid #fca5a5; background: #fff1f2; border-radius: 999px; font-size: 10px; font-weight: 800; padding: 1px 6px; cursor: pointer; }
body.formal-clean-hud .clone-ctrl-pill:not(.deployed) .clone-recall-btn { display: none; }
