* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: "Microsoft YaHei UI", "微软雅黑", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #FFF5F7 0%, #FFE4EC 50%, #F0F8FF 100%);
  background-attachment: fixed;
  color: #333;
  overflow-x: hidden;
}

input, button, textarea {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}

.page {
  min-height: 100vh;
  padding: 15px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 30px);
  position: relative;
  overflow: hidden;
}

/* ========= 头部 ========= */
.header {
  text-align: center;
  padding: 40px 15px 35px;
  position: relative;
  z-index: 2;
}

.cake-icon {
  font-size: 70px;
  animation: bounce 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.happy-text {
  font-size: 44px;
  font-weight: bold;
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 50%, #FFC371 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 10px;
  letter-spacing: 4px;
  animation: fadeInUp 0.8s ease-out;
  -webkit-text-fill-color: transparent;
}

.name-text {
  font-size: 30px;
  font-weight: bold;
  color: #333;
  margin-top: 12px;
  animation: fadeInUp 1s ease-out;
  word-break: break-all;
}

.date-text {
  font-size: 17px;
  color: #FF6B9D;
  margin-top: 10px;
  animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========= 烟花 ========= */
.fireworks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
}

.firework .spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
}

.firework .spark.s1 { transform: translate(0, -40px);   background: #FF6B9D; animation: boom1 2s ease-out infinite; }
.firework .spark.s2 { transform: translate(28px,-28px);  background: #FFD93D; animation: boom2 2s ease-out infinite; }
.firework .spark.s3 { transform: translate(40px, 0);     background: #6BCB77; animation: boom3 2s ease-out infinite; }
.firework .spark.s4 { transform: translate(28px, 28px);  background: #4D96FF; animation: boom4 2s ease-out infinite; }
.firework .spark.s5 { transform: translate(0, 40px);     background: #FF6B9D; animation: boom5 2s ease-out infinite; }
.firework .spark.s6 { transform: translate(-28px,28px);  background: #FFD93D; animation: boom6 2s ease-out infinite; }
.firework .spark.s7 { transform: translate(-40px, 0);    background: #6BCB77; animation: boom7 2s ease-out infinite; }
.firework .spark.s8 { transform: translate(-28px,-28px); background: #4D96FF; animation: boom8 2s ease-out infinite; }

@keyframes boom1 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(0,-40px) scale(0);} }
@keyframes boom2 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(28px,-28px) scale(0);} }
@keyframes boom3 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(40px,0) scale(0);} }
@keyframes boom4 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(28px,28px) scale(0);} }
@keyframes boom5 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(0,40px) scale(0);} }
@keyframes boom6 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(-28px,28px) scale(0);} }
@keyframes boom7 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(-40px,0) scale(0);} }
@keyframes boom8 { 0%,100%{opacity:0;transform:translate(0,0) scale(1);} 20%{opacity:1;} 80%{opacity:0;transform:translate(-28px,-28px) scale(0);} }

/* ========= 通用卡片 ========= */
.section {
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.1);
}

.section-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.section-title .emoji {
  margin-right: 8px;
  font-size: 22px;
}

.empty {
  text-align: center;
  padding: 50px 20px;
  color: #ccc;
  font-size: 15px;
}

/* ========= 照片轮播 ========= */
.swiper {
  width: 100%;
  height: 320px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
}

.swiper-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
}

.swiper-slide {
  min-width: 100%;
  height: 100%;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.swiper-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
}

.swiper-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 107, 157, 0.3);
  transition: all 0.3s;
}

.swiper-dot.active {
  width: 22px;
  border-radius: 4px;
  background: #FF6B9D;
}

/* ========= 祝福列表 ========= */
.wish-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wish-item {
  background: linear-gradient(135deg, #FFF0F5 0%, #FFF8DC 100%);
  border-radius: 14px;
  padding: 22px 18px;
  position: relative;
  animation: fadeInUp 0.6s ease-out both;
}

.wish-quote {
  font-size: 40px;
  color: #FF6B9D;
  font-family: Georgia, serif;
  line-height: 1;
  opacity: 0.5;
}

.wish-quote.right {
  position: absolute;
  right: 14px;
  bottom: 4px;
  transform: rotate(180deg);
}

.wish-content {
  font-size: 17px;
  color: #444;
  line-height: 1.85;
  padding: 0 12px;
  text-align: center;
}

.preserve-format {
  white-space: pre-wrap;
  word-break: break-word;
  display: inline-block;
  text-align: left;
  width: 100%;
}

/* ========= 音乐 ========= */
.music-player {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #E8F4FD 0%, #F0F8FF 100%);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s;
}

.music-player:active {
  transform: scale(0.98);
}

.music-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
}

.music-icon.rotating {
  animation: rotate 4s linear infinite;
}

.music-icon.paused {
  animation-play-state: paused;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-name {
  font-size: 17px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-status {
  font-size: 13px;
  color: #888;
}

.play-btn {
  width: 44px;
  height: 44px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

/* ========= 底部 ========= */
.footer {
  padding: 40px 15px 25px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 280px;
  pointer-events: none;
  overflow: hidden;
}

.heart {
  position: absolute;
  bottom: -20px;
  font-size: 24px;
  animation: floatUp 4.5s ease-in-out infinite;
  opacity: 0;
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  15%  { opacity: 0.9; }
  100% { transform: translateY(-260px) scale(0.4); opacity: 0; }
}

.blessing-text {
  font-size: 16px;
  color: #FF6B9D;
  font-weight: 500;
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

.admin-entry {
  margin-top: 25px;
  padding: 15px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}

/* ========= 按钮 ========= */
.btn-primary, .btn-secondary {
  font-size: 15px;
  border-radius: 30px;
  padding: 10px 28px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #FF6B9D 0%, #FF85A2 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 157, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.25);
}

.btn-secondary {
  background: #fff;
  color: #FF6B9D;
  border: 1.5px solid #FF6B9D;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: #FFF5F7;
}

/* ========= 弹窗 ========= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 26px 22px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 14px;
  color: #888;
  text-align: center;
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: #F7F8FA;
  border-radius: 10px;
  font-size: 15px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: #FF6B9D;
  background: #fff;
}

.modal-error {
  color: #FF4D4F;
  font-size: 13px;
  margin-top: 8px;
  padding-left: 4px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.modal-actions button {
  flex: 1;
}

/* ========= Toast ========= */
.toast {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  max-width: 80%;
  text-align: center;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ========= 图片灯箱 ========= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s;
}

.lightbox-img {
  max-width: 94%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 44px;
  color: #fff;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  z-index: 10;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #ddd;
  font-size: 14px;
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 40px;
  text-align: center;
  transition: background 0.2s;
  z-index: 10;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========= 开场遮罩 ========= */
.splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #1a0a2e 0%, #3d1a4d 50%, #5c2a55 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  animation: splashIn 0.6s ease-out;
}

@keyframes splashIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-emoji {
  font-size: 90px;
  animation: splashBounce 2.5s ease-in-out infinite;
  margin-bottom: 10px;
}

@keyframes splashBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-20px) rotate(5deg); }
}

.splash-title {
  font-size: 42px;
  font-weight: bold;
  background: linear-gradient(135deg, #FFD700 0%, #FF6B9D 50%, #FF8E53 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 6px;
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(255, 107, 157, 0.3);
}

.splash-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
}

.splash-btn {
  display: inline-block;
  padding: 16px 50px;
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
  border-radius: 40px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 40px rgba(255, 107, 157, 0.5);
  animation: btnPulse 1.8s ease-in-out infinite;
  transition: transform 0.15s;
}

.splash-btn:active {
  transform: scale(0.95);
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 107, 157, 0.5); }
  50%      { box-shadow: 0 0 60px rgba(255, 107, 157, 0.8), 0 0 80px rgba(255, 142, 83, 0.4); }
}

.splash-btn-text {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 3px;
}

.splash-hint {
  margin-top: 25px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ========= Canvas 粒子背景 ========= */
.particle-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.fx-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ========= 蛋糕 + 蜡烛 ========= */
.cake-wrap {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.cake-icon {
  font-size: 90px;
  animation: bounce 2s ease-in-out infinite;
  display: block;
}

.cake-candles {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}

.candle {
  width: 14px;
  height: 34px;
  background: linear-gradient(180deg, #FFB6C1 0%, #FF6B9D 50%, #E85A7A 100%);
  border-radius: 3px 3px 2px 2px;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: inset -2px 0 rgba(0,0,0,0.12);
}

.candle:active { transform: scale(0.92); }

.candle::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: #333;
}

.flame {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  animation: flameFlicker 0.3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.8));
  pointer-events: none;
}

@keyframes flameFlicker {
  from { transform: translateX(-50%) scale(1) rotate(-3deg); }
  to   { transform: translateX(-50%) scale(1.15) rotate(3deg); }
}

.candle.out .flame {
  animation: blowOut 0.5s ease-out forwards;
}

@keyframes blowOut {
  0%   { opacity: 1; transform: translateX(-50%) scale(1.3) translateY(0); filter: blur(0); }
  50%  { opacity: 0.6; transform: translateX(-50%) scale(0.7) translateY(-8px); filter: blur(2px); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.3) translateY(-20px); filter: blur(5px); }
}

/* ========= 祝福卡 3D 翻转 + 打字机 ========= */
.wish-content.typewriter {
  white-space: pre-wrap;
  word-break: break-word;
  display: inline-block;
  text-align: left;
  width: 100%;
}

.wish-content.typewriter::after {
  content: '|';
  display: inline-block;
  animation: blink 0.7s step-end infinite;
  color: #FF6B9D;
  font-weight: bold;
  margin-left: 1px;
}

@keyframes blink {
  from, to { opacity: 1; }
  50%     { opacity: 0; }
}

.wish-item.flip-in {
  animation: flipIn 0.8s ease-out both;
  perspective: 1000px;
}

@keyframes flipIn {
  from { opacity: 0; transform: rotateY(-90deg) translateY(20px); }
  to   { opacity: 1; transform: rotateY(0) translateY(0); }
}

/* ========= 许愿弹窗 ========= */
.wish-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.wish-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.wish-modal-box {
  position: relative;
  background: linear-gradient(160deg, #FFF5F7 0%, #FFE4EC 100%);
  border-radius: 22px;
  padding: 32px 26px;
  width: 88%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: wishPop 0.5s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

@keyframes wishPop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.wish-modal-title {
  font-size: 24px;
  font-weight: bold;
  color: #FF6B9D;
  margin-bottom: 12px;
}

.wish-modal-text {
  font-size: 14px;
  color: #888;
  margin-bottom: 20px;
}

.wish-modal-input {
  width: 100%;
  padding: 13px 16px;
  background: #fff;
  border: 1.5px solid #FFD4DF;
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 18px;
  transition: border-color 0.2s;
}

.wish-modal-input:focus {
  border-color: #FF6B9D;
}

.wish-modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 107, 157, 0.4);
  transition: transform 0.15s;
}

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

/* ========= 点赞区 ========= */
.like-section {
  text-align: center;
  margin: 18px auto 8px;
  padding: 14px;
  position: relative;
  z-index: 2;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.2);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s;
}

.like-btn:active { transform: scale(0.94); }

.like-icon {
  font-size: 22px;
  transition: transform 0.3s;
}

.like-icon.liked {
  animation: heartBeat 0.5s ease-out;
  filter: drop-shadow(0 0 6px #FF6B9D);
}

@keyframes heartBeat {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.5); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.like-count {
  font-size: 17px;
  font-weight: bold;
  color: #FF6B9D;
  min-width: 30px;
}

.like-label {
  font-size: 12px;
  color: #bbb;
  margin-top: 8px;
}

@media (min-width: 700px) {
  .page { max-width: 500px; margin: 0 auto; }
  .happy-text { font-size: 52px; }
  .cake-icon { font-size: 100px; }
}
