/* 演示动画共用外壳：舞台 / 步骤胶囊 / 说明条 / 重播按钮（sync、matrix、canvas 三支动画共用） */
:root {
  --page: #05090d;
  --panel: #0b1218;
  --panel-2: #0d161d;
  --ink: #edf6fa;
  --muted: #91a4af;
  --line: rgba(173, 213, 229, 0.18);
  --cyan: #76ddff;
  --cyan-soft: rgba(118, 221, 255, 0.16);
  --amber: #e8b466;
}

* {
  box-sizing: border-box;
}

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

/* 嵌入站内 iframe 使用：铺满容器、去掉页面级留白 */
body {
  display: block;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--panel);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

.player {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--panel);
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--panel-2);
  isolation: isolate;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-top {
  position: absolute;
  inset: clamp(14px, 2.6vw, 30px) clamp(14px, 3vw, 36px) auto;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 24px;
  pointer-events: none;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
}

.step {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(170, 213, 229, 0.13);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7, 13, 18, 0.56);
  font-size: clamp(9px, 0.9vw, 12px);
  line-height: 1;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.step-index {
  color: rgba(237, 246, 250, 0.46);
  font-variant-numeric: tabular-nums;
}

.step.is-active {
  color: var(--ink);
  border-color: rgba(118, 221, 255, 0.46);
  background: rgba(118, 221, 255, 0.1);
}

.step.is-active .step-index {
  color: var(--cyan);
}

.controlbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 70px;
  padding: 14px clamp(14px, 3vw, 36px);
  border-top: 1px solid rgba(169, 212, 229, 0.12);
  background: rgba(9, 16, 22, 0.98);
}

.caption {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.caption-index {
  color: var(--cyan);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.caption p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #c5d3da;
  font-size: clamp(12px, 1.15vw, 15px);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.replay {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(172, 216, 232, 0.19);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(173, 213, 229, 0.07);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.replay:hover {
  border-color: rgba(118, 221, 255, 0.52);
  background: rgba(118, 221, 255, 0.1);
}

.replay:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.progress-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 2px;
  background: rgba(174, 215, 231, 0.08);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(118, 221, 255, 0.6), var(--cyan));
  transform-origin: left center;
}

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

@media (max-width: 680px) {
  .stage-top {
    gap: 12px;
  }

  .steps {
    max-width: 66%;
    gap: 4px;
  }

  .step {
    min-height: 24px;
    padding: 0 7px;
  }

  .step-label {
    display: none;
  }

  .step-index {
    font-size: 10px;
  }

  .controlbar {
    height: 62px;
    padding: 8px 14px;
  }

  .caption {
    gap: 8px;
  }

  .caption p {
    font-size: 12px;
    line-height: 1.45;
  }

  .replay {
    min-width: 62px;
    min-height: 38px;
    padding: 0 12px;
  }
}
