/* ===== 医师节 · 养生茶方（信封 + 茶卡） ===== */
/* 配色：宣纸米白 + 本草墨绿 + 朱砂点缀，与星图金蓝形成场景切换 */

/* ---------- 信封遮罩 ---------- */
.env-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 320;
  background: rgba(3, 8, 20, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.env-mask.show { opacity: 1; pointer-events: auto; }

.env-scene {
  width: 6.3rem;
  max-width: 88%;
  perspective: 16rem;
  text-align: center;
}

.envelope {
  position: relative;
  width: 100%;
  height: 5.0rem;
  cursor: pointer;
}

/* 信封背板 */
.env-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(165deg, #e9d3a3, #d8bd85);
  border-radius: 0.14rem;
  z-index: 1;
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.55);
}

/* 信纸（初始藏在信封内，拆封后上升） */
.env-letter {
  position: absolute;
  left: 4%; right: 4%;
  top: 5%;
  height: 88%;
  background: #fdf8ea;
  border-radius: 0.1rem;
  z-index: 2;
  padding: 0.4rem 0.3rem;
  text-align: center;
  box-shadow: 0 0.04rem 0.2rem rgba(90, 60, 10, 0.25);
  transition: transform 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 0.45s;
}
.env-letter-title {
  font-family: "STSong", "SimSun", "Songti SC", serif;
  font-size: 0.34rem;
  color: #8a5a1a;
  margin-bottom: 0.2rem;
  letter-spacing: 0.08em;
}
.env-letter-body {
  font-family: "STSong", "SimSun", "Songti SC", serif;
  font-size: 0.25rem;
  line-height: 1.85;
  color: #4a3f28;
}
.env-letter-body + .env-letter-body { margin-top: 0.18rem; }

/* 信封前袋（下半V形兜） */
.env-front {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 3;
  border-radius: 0.14rem;
  background: linear-gradient(180deg, #f0ddb2, #e0c792);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -0.03rem 0.1rem rgba(120, 85, 20, 0.2);
}

/* 信封盖（上三角，拆封时向上翻开） */
.env-flap {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 56%;
  z-index: 4;
  background: linear-gradient(180deg, #e7d09e, #d6ba80);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.55s ease;
  border-radius: 0.14rem 0.14rem 0 0;
  backface-visibility: hidden;
}

/* 火漆印 */
.env-seal {
  position: absolute;
  left: 50%; top: 47%;
  transform: translate(-50%, -50%);
  width: 1.0rem; height: 1.0rem;
  border-radius: 50%;
  z-index: 5;
  background: radial-gradient(circle at 35% 30%, #d9a441, #a8722a);
  color: #fff7e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "STSong", "SimSun", "Songti SC", serif;
  font-size: 0.42rem;
  box-shadow: 0 0.06rem 0.2rem rgba(60, 35, 0, 0.45), inset 0 0 0.08rem rgba(255, 240, 200, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 拆封状态 */
.envelope.open { cursor: default; }
.envelope.open .env-flap {
  transform: rotateX(178deg);
  z-index: 1;
  transition: transform 0.55s ease, z-index 0s 0.28s;
}
.envelope.open .env-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.35);
}
.envelope.open .env-letter {
  transform: translateY(-64%);
}

/* 信封下方区域：固定高度容器，提示/按钮切换时不影响信封位置 */
.env-bottom {
  position: relative;
  height: 1.4rem;
  margin-top: 0.5rem;
}
.env-hint {
  position: absolute;
  top: 0.26rem;
  left: 0; right: 0;
  font-size: 0.26rem;
  color: #c8b28a;
  animation: envPulse 1.8s ease-in-out infinite;
}
.envelope.open ~ .env-hint, .env-hint.hide { opacity: 0; animation: none; transition: opacity 0.3s; }
@keyframes envPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* 拆封后的「查看茶方」按钮（停在信纸状态，手动跳转） */
.env-next {
  position: absolute;
  top: 0;
  left: 50%;
  height: 0.88rem;
  padding: 0 0.7rem;
  border: none;
  border-radius: 0.44rem;
  background: linear-gradient(90deg, #ffc85e, #ff9a3d);
  color: #4a2c00;
  font-size: 0.32rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 0.08rem 0.4rem rgba(255, 170, 60, 0.35);
  opacity: 0;
  transform: translate(-50%, 0.2rem);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.env-next.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.env-next:active { transform: translate(-50%, 0) scale(0.96); }

/* ---------- 茶方页（整页即一张长图，长按保存） ---------- */
.tea-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 310;
  background: #f5efe0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.tea-mask.show { opacity: 1; pointer-events: auto; }

.tea-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.tea-page {
  max-width: 6.9rem;
  margin: 0 auto;
  background: #f5efe0;
}

.tea-fullimg {
  width: 100%;
  display: block;
}

.tea-img-loading {
  padding: 3rem 0;
  text-align: center;
  color: #8a6a3a;
  font-size: 0.3rem;
  font-family: "STSong", "SimSun", "Songti SC", serif;
  letter-spacing: 0.1em;
}

/* 底部操作条：提示句居中 + 返回按钮居中 */
.tea-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.24rem 0.3rem calc(0.24rem + constant(safe-area-inset-bottom));
  padding-bottom: calc(0.24rem + env(safe-area-inset-bottom));
  background: #f5efe0;
  border-top: 1px solid #e2d5b4;
}
.tea-bar-tip {
  margin: 0 0 0.2rem;
  font-size: 0.26rem;
  color: #8a6a3a;
  letter-spacing: 0.04em;
  text-align: center;
}
.tea-btn-close {
  min-width: 2.6rem;
  height: 0.8rem;
  padding: 0 0.7rem;
  border-radius: 0.4rem;
  border: 1px solid #b9a06a;
  background: transparent;
  color: #8a6a3a;
  font-size: 0.28rem;
}
.tea-bar button:active { transform: scale(0.96); }

/* 已点亮面板里的茶方入口（与确认函入口并排） */
.tea-entry {
  margin-left: 0.2rem;
  border-color: rgba(120, 200, 150, 0.5) !important;
  background: rgba(80, 170, 120, 0.14) !important;
  color: #a8e0c0 !important;
}
