/* 3D 内全流程讲解：卡片层、播放条、演出态收纳 */

.story-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
  contain: layout style;
}

/* 演出时收起会抢视线的 UI，画面只留 3D 与卡片 */
body[data-story="1"] .inspector,
body[data-story="1"] .hotspot-layer,
body[data-story="1"] #annotation,
body[data-story="1"] #xray-badge,
body[data-story="1"] .transport,
body[data-story="1"] .stage-caption {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.inspector,
.transport,
.hotspot-layer,
.stage-caption {
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

body[data-story="1"] .stage-topline { opacity: 0; }

body[data-story="1"] .topbar .actions .btn:not(#btn-flow) {
  opacity: 0.42;
  pointer-events: none;
}

/* ---------------- 底部播放条 ---------------- */

.story-bar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 10px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 10px 8px 15px;
  border-radius: 999px;
  background: rgba(7, 17, 24, 0.82);
  border: 1px solid rgba(214, 238, 248, 0.12);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}

.story-bar.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.story-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(53, 224, 200, 0.12);
  animation: story-pulse 1.8s ease-in-out infinite;
}

@keyframes story-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.story-count {
  min-width: 66px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(224, 239, 247, 0.78);
  font-variant-numeric: tabular-nums;
}

.story-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.story-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(214, 238, 248, 0.18);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}

.story-dots i.is-done { background: rgba(53, 224, 200, 0.55); }

.story-dots i.is-now {
  background: var(--accent-bright);
  transform: scale(1.6);
}

.story-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.story-btn {
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(214, 238, 248, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(219, 235, 244, 0.72);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.story-btn:hover {
  color: #ffffff;
  border-color: rgba(214, 238, 248, 0.3);
  background: rgba(255, 255, 255, 0.09);
}

.story-btn.is-primary {
  color: #052921;
  background: var(--accent-bright);
  border-color: transparent;
  font-weight: 700;
}

.story-btn.is-primary:hover { background: #5cebd7; }

.story-btn[aria-pressed="true"] {
  color: var(--accent-bright);
  border-color: rgba(53, 224, 200, 0.4);
  background: rgba(53, 224, 200, 0.1);
}

/* 讲解按钮上的小播放点，提示"这里有人讲" */
#btn-flow .story-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 8px;
  line-height: 1;
}

/* 讲解员只在演出态出现：非演出时右下角是 inspector 的地盘 */
.guide-root {
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

body:not([data-story="1"]) .guide-root {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 900px) {
  body[data-story="1"] .guide-root { display: none; }
  body[data-story="1"] .steps { display: none !important; }
}

@media (max-width: 980px) {
  .story-bar {
    left: 14px;
    right: 14px;
    bottom: 14px;
    transform: translateY(10px);
    justify-content: space-between;
    max-width: none;
  }
  .story-bar.is-in { transform: translateY(0); }
  .story-dots { display: none; }
}

@media (max-width: 560px) {
  .story-bar { gap: 8px; padding: 7px 8px 7px 12px; }
  .story-count { min-width: 0; }
  .story-btn { padding: 0 9px; }
}
