/* Rocket Launch Pad Animation System */
/* 火箭发射动画系统 CSS 样式 */

:root {
  --rocket-primary: #2c3e50;
  --rocket-accent: #e74c3c;
  --rocket-white: #ecf0f1;
  --rocket-flame: #ff6b35;
  --rocket-flame-core: #ffd700;
  --rocket-fog: rgba(255, 255, 255, 0.6);
  --charge-light-off: #34495e;
  --charge-light-on: #2ecc71;
  --tower-color: #95a5a6;
  --metal-light: #f0f4f8;
  --metal-dark: #8492a6;
  --metal-highlight: #ffffff;
}

/* RocketPad 容器 */
.rocket-pad {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #87ceeb 0%, #e0f6ff 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* 夜间模式背景 */
.rocket-pad.night {
  background: linear-gradient(to bottom, #0a1128 0%, #1c2951 100%);
}

/* 星空模式背景 */
.rocket-pad.space {
  background: radial-gradient(ellipse at center, #1e3a5f 0%, #0a0e27 100%);
}

/* 星星背景 */
.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 2s;
}

.rocket-pad.space .stars {
  opacity: 1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* SVG 容器 */
.rocket-svg-container {
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  left: 0;
  transform-origin: center bottom;
  transition: transform 0.5s ease-out;
}

/* 云层遮罩 */
.cloud-mask {
  position: absolute;
  width: 100%;
  height: 200px;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

/* ==================== 火箭组件样式 ==================== */

/* 火箭主体 */
.rocket {
  transform-origin: center bottom;
  transition: transform 0.1s ease-out;
}

/* 火箭各模块 */
.rocket-stage {
  transform-origin: center center;
}

.rocket-fairing {
  fill: var(--rocket-white);
  stroke: var(--rocket-primary);
  stroke-width: 2;
}

.rocket-body {
  fill: var(--rocket-white);
  stroke: var(--rocket-primary);
  stroke-width: 2;
}

.rocket-engine {
  fill: var(--rocket-primary);
  stroke: var(--rocket-accent);
  stroke-width: 1.5;
}

.rocket-booster {
  fill: var(--rocket-accent);
  stroke: var(--rocket-primary);
  stroke-width: 2;
}

.rocket-window {
  fill: #3498db;
  opacity: 0.7;
}

.rocket-stripe {
  fill: var(--rocket-accent);
}

/* 发射塔 */
.launch-tower {
  fill: none;
  stroke: var(--tower-color);
  stroke-width: 3;
}

.tower-light {
  fill: var(--charge-light-off);
  transition: fill 0.3s;
}

.tower-light.charged {
  fill: var(--charge-light-on);
  filter: drop-shadow(0 0 5px var(--charge-light-on));
}

/* ==================== 动画片段 Clips ==================== */

/* Idle 待命循环 */
@keyframes idle-fog-loop {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.5);
  }
}

.clip-idle-fog-loop .fog {
  animation: idle-fog-loop 4s ease-out infinite;
}

@keyframes idle-light-breath {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.clip-idle-light-breath .tower-light.charged {
  animation: idle-light-breath 2s ease-in-out infinite;
}

@keyframes idle-micro-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-0.5px); }
  75% { transform: translateX(0.5px); }
}

.clip-idle-micro-shake .rocket {
  animation: idle-micro-shake 4s ease-in-out infinite;
}

/* Charging 通电反馈 */
.clip-charge-fog-intensify .fog {
  animation: idle-fog-loop 2s ease-out infinite;
}

/* Countdown 倒计时 */
.countdown-display {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 120px;
  font-weight: bold;
  color: var(--rocket-accent);
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.8);
  opacity: 0;
  pointer-events: none;
}

@keyframes countdown-number {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.clip-countdown .countdown-display {
  animation: countdown-number 1s ease-out;
}

/* Ignite 点火 */
@keyframes ignite-flame-on {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.3;
  }
  40% {
    opacity: 0.6;
  }
  60% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.95;
  }
  100% {
    opacity: 1;
  }
}

.clip-ignite .flame {
  animation: ignite-flame-on 0.6s ease-out forwards;
}

@keyframes flame-flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); }
  25% { transform: scaleY(1.1) scaleX(0.95); }
  50% { transform: scaleY(0.95) scaleX(1.05); }
  75% { transform: scaleY(1.05) scaleX(0.97); }
}

.flame.active {
  animation: flame-flicker 0.15s ease-in-out infinite;
  transform-origin: center top;  /* 闪烁时也从顶部开始 */
}

@keyframes ignite-smoke-burst {
  0% {
    opacity: 0.8;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(3) translateY(-50px);
  }
}

.clip-ignite .smoke-burst {
  animation: ignite-smoke-burst 1s ease-out forwards;
}

@keyframes ignite-shake-strong {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-2px) rotate(-0.5deg); }
  20% { transform: translateX(2px) rotate(0.5deg); }
  30% { transform: translateX(-2px) rotate(-0.3deg); }
  40% { transform: translateX(2px) rotate(0.3deg); }
  50% { transform: translateX(-1px); }
  60% { transform: translateX(1px); }
  70% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

.clip-ignite .rocket {
  animation: ignite-shake-strong 0.8s ease-in-out;
}

/* Liftoff 离架上升 - 火箭本体移动 */
@keyframes liftoff-slow-rise {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-80px);
  }
}

/* 场景缩放动画 - 通过缩小场景表现火箭飞高 */
@keyframes scene-zoom-out {
  0% {
    transform: scale(1) translateY(0);
  }
  100% {
    transform: scale(0.3) translateY(-50%);
  }
}

/* 背景元素平滑缩放 */
.background-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-origin: center bottom;
  transition: transform 2s ease-out;
}

/* Separation 分离事件 */
@keyframes sep-stage-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(200px) rotate(15deg);
  }
}

.separating {
  animation: sep-stage-fall 2s ease-in forwards;
}

@keyframes sep-booster-left {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-100px, 150px) rotate(-45deg);
  }
}

@keyframes sep-booster-right {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(100px, 150px) rotate(45deg);
  }
}

.booster-left.separating {
  animation: sep-booster-left 2s ease-out forwards;
}

.booster-right.separating {
  animation: sep-booster-right 2s ease-out forwards;
}

/* 穿云效果 */
@keyframes cloud-mask-enter {
  0% {
    opacity: 0;
    top: 40%;
  }
  50% {
    opacity: 1;
    top: 50%;
  }
  100% {
    opacity: 0;
    top: 60%;
  }
}

.clip-cloud-transit .cloud-mask {
  animation: cloud-mask-enter 3s ease-in-out forwards;
}

/* 背景转换到星空 */
.clip-sky-to-space .rocket-pad {
  animation: sky-to-space 3s ease-in-out forwards;
}

@keyframes sky-to-space {
  0% {
    background: linear-gradient(to bottom, #87ceeb 0%, #e0f6ff 100%);
  }
  100% {
    background: radial-gradient(ellipse at center, #1e3a5f 0%, #0a0e27 100%);
  }
}

/* 入轨环闪光 */
.orbit-ring {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 3px solid var(--charge-light-on);
  border-radius: 50%;
  opacity: 0;
}

@keyframes orbit-ring-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.clip-orbit-flash .orbit-ring {
  animation: orbit-ring-flash 1.5s ease-out forwards;
}

/* ==================== 毕业典礼 UI ==================== */

.graduation-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 80%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.graduation-panel.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.graduation-title {
  font-size: 32px;
  font-weight: bold;
  color: var(--rocket-primary);
  text-align: center;
  margin-bottom: 20px;
}

.achievement-badge {
  width: 120px;
  height: 120px;
  margin: 20px auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.stat-item {
  padding: 15px;
  background: var(--rocket-fog);
  border-radius: 10px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--rocket-accent);
}

.stat-label {
  font-size: 14px;
  color: #7f8c8d;
  margin-top: 5px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--rocket-accent);
  color: white;
}

.btn-primary:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
  background: var(--rocket-white);
  color: var(--rocket-primary);
  border: 2px solid var(--rocket-primary);
}

.btn-secondary:hover {
  background: var(--rocket-primary);
  color: white;
  transform: translateY(-2px);
}

/* ==================== 充能指示器 ==================== */

.charge-indicator {
  position: absolute;
  bottom: 30px;
  left: 20px;
  display: flex;
  gap: 10px;
}

.charge-light-ui {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--charge-light-off);
  transition: all 0.3s;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.charge-light-ui.active {
  background: var(--charge-light-on);
  box-shadow: 0 0 15px var(--charge-light-on);
}

/* ==================== 状态文本显示 ==================== */

.status-text {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: bold;
  color: var(--rocket-primary);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  opacity: 0;
  transition: opacity 0.3s;
}

.status-text.show {
  opacity: 1;
}
