/* 信封场景 — 独立文件，修改后刷新即生效 */
#env-scene {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #07070f;
}
#env-scene .env-hint {
  color: #555570;
  font-size: 12px;
  margin-top: 20px;
  letter-spacing: 2px;
  transition: opacity 0.3s;
  cursor: pointer;
}
#env-scene .env-hint:hover { color: #667eea; }
.env-wrap { perspective: 1200px; cursor: pointer; }
.env-3d {
  width: 440px;
  height: 320px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease-in-out;
}
.env-3d.flipped { transform: rotateY(180deg); }

.env-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.env-front { z-index: 2; background: #1a1820 url('/static/gen/20260624153452_84_12.jpg') center/contain no-repeat; }
.env-back { transform: rotateY(180deg); }
.env-face img { width: 100%; height: 100%; display: block; object-fit: contain; }
.env-back { position: relative; }
.env-back img { cursor: pointer; }

/* 火印点击热区（完全透明，点击图片上的火印位置） */
.env-seal-hotspot {
  position: absolute;
  top: 57%; left: 50%;
  transform: translate(-50%, -50%);
  width: 70px; height: 70px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
}

/* 火印提示文字（翻转后才出现） */
.env-seal-hint {
  position: absolute;
  top: 35%; left: 50%;
  transform: translate(-50%, -50%);
  color: #a78bfa;
  font-size: 14px;
  letter-spacing: 3px;
  white-space: nowrap;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(167,139,250,0.3);
  text-align: center;
  line-height: 2;
}
.env-seal-hint .arrow {
  display: block;
  font-size: 22px;
  color: #a78bfa;
  letter-spacing: 0;
}
.env-3d.flipped .env-seal-hint {
  opacity: 1;
}

/* 正面收件人叠加层 */
.env-recipient {
  position: absolute;
  top: 45%;
  left: 55%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  pointer-events: none;
  font-family: 'KaiTi', 'STKaiti', 'Noto Serif SC', 'STSong', 'SimSun', serif;
}
.env-to {
  font-size: 15px;
  color: #8a7a62;
  letter-spacing: 4px;
  margin-bottom: 10px;
  margin-left: -15px;
  text-align: left;
}
.env-name {
  font-size: 28px;
  font-weight: 700;
  color: #3a3020;
  letter-spacing: 12px;
  display: inline;
}
.env-title {
  font-size: 15px;
  color: #6a5a42;
  letter-spacing: 10px;
  display: inline;
  margin-left: 20px;
}
.env-open-row {
  font-size: 15px;
  color: #8a7a62;
  letter-spacing: 18px;
  display: block;
  text-align: right;
  margin-top: 4px;
  margin-right: 40px;
}

/* 信封打开 → 致谢信 */
.env-letter {
  position: fixed;
  top: 100vh;
  left: 0;
  right: 0;
  height: 100vh;
  z-index: 9998;
  background: #0f0f1a;
  display: none;
  overflow-y: auto;
  padding: 40px 20px;
}
.env-letter-inner { max-width: 820px; width: 100%; margin: 0 auto; }
.env-thankyou {
  --rhythm: 36px;
  background:
    /* 纸纹颗粒感 */
    repeating-linear-gradient(
      0deg, transparent, transparent 2px,
      rgba(160,140,110,0.10) 2px, rgba(160,140,110,0.10) 4px
    ),
    /* 红色横线 - 每36px一条，与行高对齐 */
    repeating-linear-gradient(
      transparent, transparent calc(var(--rhythm) - 1px),
      rgba(200,40,40,0.2) calc(var(--rhythm) - 1px),
      rgba(200,40,40,0.2) var(--rhythm)
    ) 0 40px / 100% calc(100% - 40px) no-repeat,
    /* 左上角暖光晕 */
    radial-gradient(ellipse at 0% 0%, rgba(245,235,215,0.4) 0%, transparent 60%),
    #f8f2e4;
  border-radius: 2px;
  padding: 48px 40px;
  margin-bottom: 24px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.6);
  border: 1px solid #e8dcc8;
  position: relative;
}
.env-thankyou .et-title {
  font-size: 30px;
  color: #3a3020;
  margin-bottom: 24px;
  font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  text-align: center;
  letter-spacing: 6px;
  font-weight: 700;
  line-height: var(--rhythm);
  height: calc(var(--rhythm) * 1.3);
}
.env-thankyou .et-greeting {
  font-size: 18px;
  color: #3a3020;
  font-weight: 700;
  margin-bottom: 0;
  text-indent: 0;
  line-height: var(--rhythm);
}
.env-thankyou p {
  font-size: 15px;
  line-height: var(--rhythm);
  color: #5a4a32;
  margin-bottom: 0;
  text-indent: 2em;
}
.env-thankyou .env-closing { text-indent: 0; margin-top: 0; text-align: left; }
.env-thankyou .env-respect { text-indent: 2em; margin-top: 0; text-align: left; }
.env-thankyou .env-signature { text-indent: 0; margin-top: 0; text-align: right; }
.env-thankyou .env-wish { text-indent: 0; text-align: center; font-size: 15px; color: #5a4a32; line-height: var(--rhythm); margin-top: 0; letter-spacing: 1px; }
.env-thankyou .env-divider { display: none; }
