/* 全局样式，iOS 风格 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Arial", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #fff5fa 0%, #e1bee7 100%);
  color: #2a2a2a;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Emoji 背景 */
.emoji-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.emoji-bg .emoji {
  position: absolute;
  font-size: 36px;
  opacity: 0.2;
  animation: float 8s ease-in-out infinite, fade 8s ease-in-out infinite;
}

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

@keyframes fade {
  0% { opacity: 0.1; }
  50% { opacity: 0.2; }
  100% { opacity: 0.1; }
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  background: rgba(255, 245, 250, 0.65);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  margin-bottom: 100px;
  position: relative;
  z-index: 0;
  width: 100%;
  box-sizing: border-box;
}

h1 {
  text-align: center;
  margin-top: 16px;
  font-size: 1.7em;
  font-weight: 600;
  color: #4527a0;
  padding: 8px 0;
  z-index: 1;
}

.section {
  margin: 24px 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(245, 232, 240, 0.45);
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.image-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

.image-wrapper img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: block;
}

.image-wrapper figure {
  margin: 0;
  text-align: center;
}

.image-wrapper figcaption {
  margin-top: 6px;
  font-family: 'Great Vibes', 'Segoe Script', 'Comic Sans MS', cursive;
  font-size: 1.1em;
  font-style: italic;
  color: #6a4c93;
  letter-spacing: 0.05em;
}

/* 相框样式 */
.framed-figure {
  margin: 0;
  text-align: center;
}

.image-frame {
  position: relative;
  display: inline-block;
  padding: 8px;
  background: linear-gradient(135deg, #f8e1e9 0%, #f3d7e0 100%);
  border: 2px solid #ce93d8;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-frame img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* 自适应相框样式 */
.adaptive-frame {
  margin: 0;
  text-align: center;
}

.adaptive-frame .image-frame {
  display: inline-block;
  padding: 2px;
  background: linear-gradient(135deg, #f8e1e9 0%, #f3d7e0 100%);
  border: 2px solid #ce93d8;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  line-height: 0;
}

.adaptive-frame img {
  width: 100%;
  max-height: 600px;
  height: auto;
  border-radius: 6px;
  display: block;
  object-fit: contain;
}

.video-wrapper {
  text-align: center;
  margin: 20px 0;
  z-index: 1;
}

.video-wrapper button {
  background: linear-gradient(135deg, #ce93d8, #ab47bc);
  color: #fff;
  padding: 10px 20px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.video-wrapper button:hover,
.video-wrapper button:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, #ab47bc, #8e24aa);
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  position: relative;
  background: rgba(255, 245, 250, 0.9);
  padding: 10px;
  border-radius: 14px;
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.popup-content video {
  width: 100%;
  height: auto;
  max-height: 100%;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}

.close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ce93d8;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.close-btn:hover,
.close-btn:active {
  transform: scale(0.9);
}

.music-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1em;
  font-weight: 500;
  z-index: 1001;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.music-prompt.hidden {
  display: none;
}

.music-prompt p {
  background: rgba(245, 232, 240, 0.3);
  padding: 14px 22px;
  border-radius: 10px;
  text-align: center;
}

#music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #f06292, #ec407a);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  line-height: 44px;
  text-align: center;
}

#music-toggle:hover,
#music-toggle:active {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#music-toggle.rotating {
  animation: rotate 2s linear infinite;
}

#index-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #f48fb1, #d81b60);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#index-btn:hover,
#index-btn:active {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

@media (max-width: 600px) {
  .emoji-bg .emoji {
    font-size: 28px;
    opacity: 0.3;
  }

  .container {
    padding: 10px;
    margin: 0 6px 90px 6px;
    border-radius: 10px;
    background: rgba(255, 245, 250, 0.6);
  }

  .section {
    padding: 10px;
    margin: 20px 0;
    background: rgba(245, 232, 240, 0.4);
  }

  h1 {
    font-size: 1.4em;
  }

  .video-wrapper button {
    padding: 8px 16px;
    font-size: 13px;
  }

  .popup-content {
    max-width: 92%;
    max-height: 80%;
    padding: 6px;
  }

  .popup-content video {
    max-height: 100%;
    width: 100%;
    border-radius: 8px;
  }

  .image-wrapper img {
    max-height: 300px;
  }

  .image-frame {
    padding: 4px;
  }

  .adaptive-frame .image-frame {
    padding: 2px;
  }

  .adaptive-frame img {
    max-height: 500px;
  }

  #music-toggle {
    width: 36px;
    height: 36px;
    font-size: 14px;
    bottom: 16px;
    right: 16px;
    line-height: 36px;
    text-align: center;
  }

  #music-toggle:hover,
  #music-toggle:active {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  #index-btn {
    padding: 8px 16px;
    font-size: 13px;
    bottom: 16px;
    left: 16px;
  }

  #index-btn:hover,
  #index-btn:active {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .music-prompt p {
    font-size: 0.9em;
    padding: 10px 16px;
  }
}