/* ========== H19 心愿树包：toast + 许愿/拍照 modal（暖白卡片，对齐 caption/letter 语言） ========== */

/* toast：挂饰一句话说明，3s 自动消失 */
.h19-toast {
  position: fixed; left: 50%; bottom: 140px; z-index: 46;
  transform: translateX(-50%) translateY(10px);
  max-width: min(480px, 84vw); text-align: center;
  font-size: 14px; letter-spacing: .06em; line-height: 1.8;
  color: #f5ead6; font-family: var(--hand, "Ma Shan Zheng", serif);
  background: rgba(18, 9, 16, .62); backdrop-filter: blur(10px);
  border: 1px solid rgba(224, 137, 156, .3); border-radius: 14px;
  padding: 12px 24px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.h19-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* modal 遮罩（对齐 letter-overlay） */
.h19-overlay {
  position: fixed; inset: 0; z-index: 44;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 5, 10, .55); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
  padding: 20px;
}
.h19-overlay.on { opacity: 1; visibility: visible; }

/* 暖白信纸卡片（对齐 .letter-paper） */
.h19-paper {
  width: min(560px, 94vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, #fffdf6, #fdf0ea);
  color: #4a3138; border-radius: 12px;
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  text-align: center;
}
.h19-kicker {
  margin: 0 0 4px; font-size: 11px; letter-spacing: .3em;
  color: #b3935f;
}
.h19-title {
  margin: 0 0 16px; font-family: var(--hand, "Ma Shan Zheng", serif);
  font-weight: 400; font-size: clamp(22px, 4vw, 28px); color: #4a3138;
}
.h19-paper textarea {
  width: 100%; box-sizing: border-box; min-height: 88px; resize: vertical;
  font-family: var(--hand, "Ma Shan Zheng", serif); font-size: 17px; line-height: 1.9;
  color: #4a3138; background: rgba(216, 189, 150, .08);
  border: 1px solid rgba(179, 147, 95, .45); border-radius: 10px;
  padding: 12px 16px; outline: none;
}
.h19-paper textarea:focus { border-color: #b3935f; box-shadow: 0 0 18px rgba(179, 147, 95, .25); }
.h19-paper textarea::placeholder { color: rgba(179, 147, 95, .55); }

.h19-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: 16px 0 4px;
}
.h19-btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-family: var(--serif, "Noto Serif SC", serif);
  font-size: 14px; letter-spacing: .12em; color: #4a3138;
  background: rgba(216, 189, 150, .12);
  border: 1px solid rgba(179, 147, 95, .55); border-radius: 999px;
  padding: 10px 22px; transition: background .25s, box-shadow .25s, opacity .25s;
}
.h19-btn:hover { background: rgba(216, 189, 150, .28); }
.h19-btn.primary {
  background: linear-gradient(135deg, #e8c07d, #d8a860);
  border-color: #c39a58; color: #3a2a1a; font-weight: 600;
  box-shadow: 0 4px 16px rgba(195, 154, 88, .35);
}
.h19-btn.primary:hover { box-shadow: 0 6px 22px rgba(195, 154, 88, .5); }
.h19-btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

/* 历次心愿只读列表 */
.h19-history { margin-top: 18px; text-align: left; }
.h19-history-title {
  margin: 0 0 8px; font-size: 12px; letter-spacing: .2em;
  color: #b3935f; text-align: center;
}
.h19-wish-list { list-style: none; margin: 0; padding: 0; }
.h19-wish-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 14px; line-height: 1.8; color: #4a3138;
  border-top: 1px dashed rgba(179, 147, 95, .35);
  padding: 8px 4px;
}
.h19-wish-list .h19-wish-text { font-family: var(--hand, "Ma Shan Zheng", serif); }
.h19-wish-list .h19-wish-ts { font-size: 11px; color: rgba(179, 147, 95, .85); white-space: nowrap; }
.h19-wish-list .h19-wish-empty { justify-content: center; color: rgba(179, 147, 95, .8); font-family: var(--hand, "Ma Shan Zheng", serif); }

/* 拍照 modal */
.h19-cam-stage {
  position: relative; width: min(420px, 80vw); margin: 0 auto;
  border-radius: 12px; overflow: hidden;
  background: #14101c; border: 1px solid rgba(179, 147, 95, .4);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .5);
}
.h19-cam-stage video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.h19-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--hand, "Ma Shan Zheng", serif); font-size: 84px; color: #ffe2b0;
  text-shadow: 0 0 24px rgba(255, 200, 120, .8); pointer-events: none;
}
.h19-cam-note { margin: 12px 0 0; font-size: 12.5px; letter-spacing: .08em; color: rgba(179, 147, 95, .95); }
.h19-shot-wrap { margin-top: 16px; }
/* H38 定制相框：米白卡纸 + 玫瑰金细边 + 底部手写落款（LL ♡ KK），照片 img 内嵌 */
.h19-shot-frame {
  position: relative; display: inline-block; margin-top: 8px;
  background: #fffdf6; padding: 10px 10px 42px;
  border: 1px solid rgba(224, 137, 156, .55); border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transform: rotate(-2.5deg);
}
.h19-shot-frame::after { /* 底部手写落款 */
  content: "LL ♡ KK"; position: absolute; left: 0; right: 0; bottom: 11px;
  font-family: var(--hand, "Ma Shan Zheng", serif); font-size: 15px; color: #4a3138;
}
.h19-shot-frame::before { /* 左下小图标 */
  content: "✦"; position: absolute; bottom: 12px; left: 14px;
  font-size: 12px; color: rgba(224, 137, 156, .9);
}
.h19-shot {
  display: block; width: min(220px, 56vw); margin: 0; border-radius: 1px;
}

/* ========== H38 拍照 modal 响应式（移动端优先，桌面不受影响） ========== */
@media (max-width: 700px) {
  .h19-overlay { padding: 12px; } /* 竖屏贴边，把宽度让给预览框 */
  .h19-paper { width: 100%; box-sizing: border-box; max-height: 94vh; }
  .h19-btn { min-height: 44px; } /* 触摸目标 ≥44px */
}
/* 竖屏：预览框 3:4，宽撑满卡片（100vw 去 padding），超高时按 58vh 等比收窄 */
@media (max-width: 700px) and (orientation: portrait) {
  .h19-cam-stage {
    width: min(100%, calc(58vh * .75));
    aspect-ratio: 3 / 4;
  }
  /* video 填满容器（覆盖默认 4:3 宽高比），画面交给 object-fit: cover 裁切 */
  .h19-cam-stage video { height: 100%; aspect-ratio: auto; }
  .h19-count { font-size: clamp(64px, 24vw, 84px); }
}
/* 横屏：预览框 16:9，按窗口高度适配（≤62vh），横向尽量吃满 */
@media (max-width: 980px) and (orientation: landscape) {
  .h19-overlay { padding: 10px 16px; }
  .h19-paper { width: auto; max-width: 100%; max-height: 96vh; padding: 14px 22px; }
  .h19-kicker { display: none; }
  .h19-title { margin-bottom: 8px; font-size: 20px; }
  .h19-cam-note { margin-top: 6px; }
  .h19-cam-stage {
    width: min(calc(100vw - 76px), calc(56vh * 16 / 9));
    aspect-ratio: 16 / 9;
  }
  .h19-cam-stage video { height: 100%; aspect-ratio: auto; }
  .h19-count { font-size: clamp(48px, 30vh, 72px); }
  .h19-row { margin-top: 8px; }
}
