* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #FF6B9D 0%, #FF6B9D 15%, #ffffff 15%, #ffffff 85%, #FF6B9D 85%, #FF6B9D 100%);
  min-height: 100vh;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  width: 100vw;
  min-height: 100vh;
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.bg {
  width: 100%;
  max-width: 100vw;
  height: auto;
  min-height: 70vh;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

/* 关闭按钮 */
#close-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  font-size: 28px;
  color: white;
  cursor: pointer;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

#close-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* 相纸容器 */
.polaroid-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

/* 相纸包装器 */
.polaroid-wrapper {
  position: relative;
  opacity: 0;
  transform: translateY(-100px) scale(0.8);
}

/* 相纸弹出动画 */
.polaroid-wrapper.paper-eject {
  animation: ejectPaper 1.5s ease-out forwards;
}

@keyframes ejectPaper {
  0% {
    opacity: 0;
    transform: translateY(-100px) scale(0.8);
  }
  30% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  45% {
    transform: translateY(20px) scale(0.98);
  }
  60% {
    transform: translateY(-10px) scale(1);
  }
  75% {
    transform: translateY(5px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 拍立得样式 */
.polaroid {
  position: relative;
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  width: 160px;
  cursor: pointer;
}

.photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.nickname-tag {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF6B9D, #FF8E53);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

/* 底部文字 */
.bottom-text {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 10;
}

.blessing-text {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 4px;
}

/* 返回按钮 */
.back-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: bold;
  color: #FF6B9D;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  z-index: 10;
}

.back-btn:hover {
  background: white;
  transform: translateX(-50%) scale(1.05);
}

/* 放大遮罩 */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.zoom-overlay img {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 32px;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.zoom-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header .title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.modal-header .close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.modal-header .close-btn:hover {
  background: #eee;
}

.modal-body {
  padding: 20px;
}

/* 上传区域 */
.upload-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 200px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
}

.upload-area:hover {
  border-color: #FF6B9D;
  background: #fff5f8;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-text {
  color: #999;
  font-size: 14px;
}

/* 预览区域 */
.preview-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.preview-container img {
  width: 100%;
  display: block;
}

.change-btn {
  width: 100%;
  padding: 10px;
  border: none;
  background: #f5f5f5;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

.change-btn:hover {
  background: #eee;
}

/* 昵称输入 */
#nickname-input {
  width: 100%;
  padding: 12px 16px;
  margin-top: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

#nickname-input:focus {
  border-color: #FF6B9D;
}

#nickname-input::placeholder {
  color: #ccc;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
}

.submit-btn.active {
  background: linear-gradient(135deg, #FF6B9D, #FF8E53);
  color: white;
}

.submit-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* 响应式适配 */
@media (max-width: 480px) {
  .polaroid {
    width: 200px;
    padding: 10px;
  }
  
  .photo {
    aspect-ratio: 1;
  }
  
  .nickname-tag {
    bottom: -28px;
    padding: 7px 14px;
    font-size: 13px;
  }
  
  .blessing-text {
    font-size: 20px;
    letter-spacing: 2px;
  }
  
  .back-btn {
    padding: 10px 28px;
    font-size: 14px;
  }
  
  .modal {
    width: 95%;
  }
}
