html {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.container {
  height: 100vh;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  visibility: hidden;
  position: relative;
  overflow: hidden;
}

.container div.six {
  top: 9vh;
  z-index: 1;
}

.container div.seven,
.container div.eight {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.container > div {
  position: absolute;
  left: 0;
  right: 0;
  top: 12vh; /* 所有场景文字整体上移 */
  pointer-events: none;
}

/* ===== 1. 开场问候 ===== */
.one { font-size: 4.5rem; color: #333; }
.one h1 { font-weight: 500; margin: 0; }
.one h1 span { display: inline-block; }

.two {
  font-size: 1.2rem;
  font-weight: lighter;
  color: #888;
}

/* ===== 2. 生日宣言 ===== */
.three { font-size: 3rem; color: #ff69b4; }
.three p { margin: 0; }

/* ===== 3. 对话气泡 ===== */
.four .text-box {
  width: 600px;
  margin: 0 auto;
  border: 3px solid #aaa;
  border-radius: 5px;
  padding: 10px;
  position: relative;
  background: #fff;
}

.text-box p { margin: 0; text-align: left; }
.text-box span { visibility: hidden; }

.text-box .fake-btn {
  position: absolute;
  right: 5px;
  bottom: 5px;
  color: #fff;
  background-color: rgb(21, 161, 237);
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 0.9rem;
}

/* ===== 4. 思考序列 ===== */
.five p {
  font-size: 2rem;
  position: absolute;
  left: 0;
  right: 0;
  color: #555;
  margin: 0;
}

.idea-3 strong {
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  color: #ff69b4;
}

.five .idea-5 { font-size: 4rem; }

.idea-5 span,
.idea-6 span,
.wish-hbd span {
  display: inline-block;
}

.idea-6 span {
  font-size: 11rem;
  color: #ff69b4;
}

/* ===== 5. 生日祝福 ===== */
.six { position: relative; }

.wish-hbd {
  font-size: 3em;
  margin: 0;
  text-transform: uppercase;
}

.wish h5 {
  font-weight: lighter;
  font-size: 2rem;
  margin: 10px 0 0;
  color: #888;
}

/* ===== 6. 气球（放大版，6 个横向位置均匀分布） ===== */
.baloons img {
  display: inline-block;
  position: absolute;
  width: 260px;
}

.baloons img:nth-child(6n + 1) { left: 2%; }
.baloons img:nth-child(6n + 2) { left: 18%; }
.baloons img:nth-child(6n + 3) { left: 36%; }
.baloons img:nth-child(6n + 4) { left: 54%; }
.baloons img:nth-child(6n + 5) { left: 70%; }
.baloons img:nth-child(6n + 6) { left: 86%; }

/* ===== 7. 粒子圆圈 ===== */
.eight svg {
  width: 25px;
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  z-index: -1;
}

.eight svg:nth-child(1) { top: 7vh; left: 5vw; fill: #bd6ecf; }
.eight svg:nth-child(2) { top: 23vh; left: 35vw; fill: #7dd175; }
.eight svg:nth-child(3) { top: 33vh; left: 23vw; fill: #349d8b; }
.eight svg:nth-child(4) { top: 43vh; left: 57vw; fill: #347a9d; }
.eight svg:nth-child(5) { top: 68vh; left: 7vw; fill: #c66053; }
.eight svg:nth-child(6) { top: 42vh; left: 77vw; fill: #bfaa40; }
.eight svg:nth-child(7) { top: 68vh; left: 83vw; fill: #e3bae8; }
.eight svg:nth-child(8) { top: 86vh; left: 37vw; fill: #8762cb; }
.eight svg:nth-child(9) { top: 94vh; left: 87vw; fill: #9a90da; }

/* ===== 8. 结尾（许愿之后） ===== */
.nine {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  display: none; /* 默认隐藏，结尾序列开始时由 GSAP 显示，避免拦截许愿弹窗点击 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 18vh; /* 内容整体上移，视觉更舒适 */
}

.nine p {
  font-size: 1.6rem;
  font-weight: 300;
  color: #666;
  margin: 0;
}

.end-wishes {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.end-wish {
  font-size: 2rem !important;
  color: #ff69b4 !important;
  font-weight: 500 !important;
}

.end-final {
  font-size: 3.2rem !important;
  color: #ff1493 !important;
  font-weight: 700 !important;
  margin-top: 10px !important;
}

.last-smile {
  font-size: 2.6rem !important;
  margin-top: 4px !important;
}

#replay {
  z-index: 3;
  cursor: pointer;
  pointer-events: auto;
  margin-top: 18px !important;
  font-size: 1rem !important;
  color: #ff69b4 !important;
  text-decoration: underline;
  opacity: 0.75;
}

/* ===== 许愿弹窗 ===== */
.wish-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.wish-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.wish-dialog {
  background: #fff;
  border-radius: 24px;
  padding: 36px 40px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 92%;
}

.wish-dialog-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wish-icon { font-size: 2rem; }

.wish-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #ff69b4;
}

.wish-hint {
  font-size: 0.95rem;
  color: #999;
  margin-bottom: 18px;
}

.wish-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  background: #f9f9f9;
  transition: border-color 0.3s;
}

.wish-input:focus {
  border-color: #ff69b4;
  background: #fff;
}

.wish-input::placeholder { color: #bbb; }

.wish-btn {
  margin-top: 16px;
  padding: 12px 36px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.wish-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
}

.wish-btn:active { transform: scale(0.98); }

.wish-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.2rem;
  color: #ff69b4;
  font-weight: 600;
  margin-top: 18px;
}

.confirm-icon { font-size: 1.5rem; }

/* ===== 音乐按钮 ===== */
.music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* ===== 响应式 ===== */
@media screen and (max-height: 1000px) {
  .baloons img:nth-child(even) { left: -8%; }
  .baloons img:nth-child(odd) { right: -8%; }
}

@media screen and (max-width: 600px) {
  .container { max-width: 100%; }

  .one { font-size: 2.5rem; }
  .two { font-size: 1rem; }

  .three { font-size: 1.8rem; }

  .four .text-box { width: 90%; }
  .text-box .fake-btn { right: 5px; bottom: -38px; }

  .five p { font-size: 1.3rem; }
  .five .idea-5 { font-size: 2.2rem; }
  .idea-5 span { display: block; }
  .idea-6 span { font-size: 7rem; }

  .wish-hbd { font-size: 1.8em; }
  .wish h5 { font-size: 1.2rem; }

  .baloons img { width: 150px; }
  .baloons img:nth-child(6n + 5) { left: 56%; }
  .baloons img:nth-child(6n + 6) { left: 72%; }

  .nine { padding-bottom: 8vh; }

  .nine p { font-size: 1.1rem; }
  .end-wish { font-size: 1.5rem !important; }
  .end-final { font-size: 2.4rem !important; }
  .last-smile { font-size: 2rem !important; }
  #replay { font-size: 0.85rem !important; }

  .wish-dialog { padding: 28px 24px; }
  .wish-title { font-size: 1.5rem; }
}
