/* ========================================
   信封开屏动画 - 米色高级感
   ======================================== */

/* 信封遮罩层 */
.envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f5ede4;  /* 后备颜色 */
    background-image: url('./images/xf.jpg');
    background-size: cover;      /* ← 关键！让图片铺满全屏 */
    background-position: center; /* ← 关键！图片居中 */
    background-repeat: no-repeat; /* ← 关键！不重复平铺 */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
    overflow: hidden;
}
/* 信封关闭状态 */
.envelope-overlay.closed {
  opacity: 1;
  visibility: visible;
}

/* 信封打开后隐藏 */
.envelope-overlay.opened {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 信封主体 */
.envelope-wrapper {
  position: relative;
  width: min(480px, 85vw);
  height: min(560px, 75vh);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 20px 30px rgba(140, 110, 80, 0.12));
}

.envelope-wrapper:hover {
  transform: translateY(-8px);
  filter: drop-shadow(0 28px 40px rgba(140, 110, 80, 0.16));
}

/* 信封底部（固定层） */
.envelope-base {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%;
  background: linear-gradient(145deg, #f0e5d8 0%, #e8d9ca 100%);
  border-radius: 0 0 8px 8px;
  box-shadow: 
    inset 0 -2px 8px rgba(80, 50, 30, 0.06),
    0 4px 12px rgba(120, 90, 60, 0.08);
  border: 1px solid #dbcdbc;
  border-top: none;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* 信封底部折痕纹理 */
.envelope-base::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    transparent 0px,
    transparent 3px,
    rgba(180, 150, 120, 0.03) 3px,
    rgba(180, 150, 120, 0.03) 8px
  );
  border-radius: 0 0 8px 8px;
  pointer-events: none;
}

/* 信封封口（三角形折页） */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(165deg, #efe3d4 0%, #e3d2c0 100%);
  clip-path: polygon(0% 0%, 50% 80%, 100% 0%);
  border-radius: 4px 4px 0 0;
  box-shadow: 
    inset 0 2px 6px rgba(255, 250, 240, 0.8),
    0 6px 12px rgba(100, 70, 40, 0.08);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #dccdbd;
  border-bottom: none;
  z-index: 10;
}

/* 封口打开状态 */
.envelope-flap.open {
  transform: rotateX(180deg);
  box-shadow: 
    inset 0 -2px 6px rgba(255, 250, 240, 0.6),
    0 10px 20px rgba(100, 70, 40, 0.12);
}

/* 信封内部露出的信纸 */
.envelope-letter {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  height: 65%;
  background: #fcf9f5;
  border-radius: 6px;
  box-shadow: 
    inset 0 1px 4px rgba(0, 0, 0, 0.02),
    0 2px 8px rgba(140, 110, 80, 0.08);
  border: 1px solid #e2d3c2;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
  transform: translateX(-50%) translateY(0);
  z-index: 5;
}

/* 信纸升起动画 */
.envelope-letter.raised {
  transform: translateX(-50%) translateY(-60px);
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

/* 信纸上的装饰线条 */
.letter-line {
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4c3b2, #d4c3b2, transparent);
  margin: 6px 0;
  opacity: 0.5;
}

.letter-line-short {
  width: 50%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #c9b6a2, transparent);
  margin: 4px 0;
  opacity: 0.4;
}

/* 信纸上的邀请文字 */
.letter-title {
  font-family: 'Times New Roman', '宋体', serif;
  font-size: 1.6rem;
  font-weight: 350;
  letter-spacing: 12px;
  color: #5a4a3a;
  margin-bottom: 20px;
  text-transform: uppercase;
  border-bottom: 1px solid #ddd0c0;
  padding-bottom: 12px;
}

.letter-subtitle {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #9a8876;
  letter-spacing: 4px;
  margin-top: 8px;
}

/* 火漆印章 */
.wax-seal {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 30%, #c9302c, #8b1e1a);
  border-radius: 50%;
  box-shadow: 
    0 4px 12px rgba(180, 50, 40, 0.25),
    inset 0 2px 4px rgba(255, 200, 180, 0.4);
  border: 2px solid #b8473a;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ecc8b0;
  font-size: 20px;
  font-family: 'Times New Roman', serif;
  font-weight: bold;
  letter-spacing: 2px;
  transition: opacity 0.4s, transform 0.5s;
}

.wax-seal::before {
  content: '✉';
  font-size: 24px;
  opacity: 0.9;
}

.wax-seal.hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.5);
  pointer-events: none;
}

/* 信封底部的提示文字 */
.envelope-hint {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: #b8a898;
  font-size: 0.85rem;
  letter-spacing: 6px;
  white-space: nowrap;
  font-family: 'Times New Roman', serif;
  text-transform: uppercase;
  opacity: 0.8;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* 背景装饰线条 */
.envelope-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(210, 180, 150, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(180, 140, 100, 0.03) 0%, transparent 50%),
    repeating-linear-gradient(45deg, rgba(190, 160, 130, 0.02) 0px, rgba(190, 160, 130, 0.02) 1px, transparent 1px, transparent 20px);
  pointer-events: none;
}

/* 跳过动画按钮 */
.envelope-skip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: 1px solid #d4c4b2;
  padding: 8px 28px;
  border-radius: 40px;
  color: #9a8a78;
  font-size: 0.8rem;
  letter-spacing: 4px;
  cursor: pointer;
  font-family: 'Times New Roman', serif;
  transition: all 0.3s;
  opacity: 0.5;
  z-index: 30;
}

.envelope-skip:hover {
  opacity: 1;
  background: rgba(245, 235, 225, 0.6);
  border-color: #b8a694;
  color: #6a5a4a;
}

/* 响应式调整 */
@media (max-width: 600px) {
  .envelope-wrapper {
    width: 90vw;
    height: 60vh;
  }
  
  .letter-title {
    font-size: 1.2rem;
    letter-spacing: 8px;
  }
  
  .wax-seal {
    width: 40px;
    height: 40px;
    bottom: -14px;
  }
  
  .wax-seal::before {
    font-size: 20px;
  }
}