/* ==========================================================
 * 婚书 - 信封气泡 & 信笺浮层
 * 设计语言：纯白信纸 + 极淡灰描边 + 朱红火漆印章
 * ========================================================== */

/* ===== 信封气泡（聊天里的那一张） ===== */
.wl-envelope-wrap {
  display: inline-block;
  margin: 6px 0 6px 4px;
  user-select: none;
}

.wl-envelope {
  position: relative;
  width: 240px;
  height: 152px;
  cursor: pointer;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 1), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(240, 240, 240, 0.7), transparent 50%),
    linear-gradient(135deg, #ffffff 0%, #fafafa 60%, #f3f3f3 100%);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 -1px 0 rgba(0, 0, 0, 0.05) inset,
    0 8px 22px rgba(0, 0, 0, 0.10),
    0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.wl-envelope::before {
  /* 内圈极细描边 */
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  pointer-events: none;
}

.wl-envelope::after {
  /* 极淡纸纹 */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1.5px),
    radial-gradient(rgba(0, 0, 0, 0.012) 1px, transparent 1.5px);
  background-size: 5px 5px, 9px 9px;
  background-position: 0 0, 2px 3px;
  mix-blend-mode: multiply;
  opacity: 0.6;
  pointer-events: none;
}

.wl-envelope:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 -1px 0 rgba(0, 0, 0, 0.06) inset,
    0 14px 30px rgba(0, 0, 0, 0.14),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.wl-envelope:hover .wl-env-seal {
  transform: translate(-50%, -50%) rotate(-6deg) scale(1.06);
}

/* 信封顶部三角封口 */
.wl-env-flap {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 60%;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 1) 0%, rgba(240, 240, 240, 0) 60%),
    linear-gradient(135deg, #ffffff 0%, #f4f4f4 60%, #e8e8e8 100%);
  clip-path: polygon(0 0, 50% 70%, 100% 0);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.wl-env-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  z-index: 2;
}

/* "喜"字已从 DOM 移除，保留空规则做兼容 */
.wl-env-seal { display: none !important; }


.wl-env-text {
  flex: 1;
  min-width: 0;
}

.wl-env-title {
  font-family: '楷体', 'KaiTi', 'STKaiti', '宋体', serif;
  font-size: 14px;
  font-weight: 700;
  color: #2a2a2a;
  letter-spacing: 1px;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-env-sub {
  font-family: '楷体', 'KaiTi', 'STKaiti', serif;
  font-size: 11px;
  color: #7a7a7a;
  letter-spacing: 0.5px;
  opacity: 0.95;
}


/* ===== 用户回信小气泡（用户侧） ===== */
.wl-reply-wrap {
  display: inline-block;
  margin: 6px 4px 6px 0;
}

.wl-reply-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f6f6 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  cursor: pointer;
  max-width: 220px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 180ms ease;
}
.wl-reply-bubble:hover { transform: translateY(-1px); }

.wl-reply-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #b8262a;
  background: #fff;
  border: 1px solid rgba(184, 38, 42, 0.35);
  border-radius: 50%;
  flex-shrink: 0;
}
.wl-reply-text { min-width: 0; }
.wl-reply-title {
  font-size: 12px; font-weight: 700; color: #2a2a2a;
  font-family: '楷体', 'KaiTi', serif;
}
.wl-reply-preview {
  font-size: 11px; color: #7a7a7a; opacity: 0.9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 170px;
  margin-top: 2px;
}


/* ===== 信笺浮层 ===== */
.wl-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.wl-modal.wl-modal-in {
  opacity: 1;
  pointer-events: auto;
}

.wl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wl-paper {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(86vw, 420px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px 28px 22px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 1), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(245, 245, 245, 0.7), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    inset 0 0 0 8px rgba(255, 255, 255, 0.9),
    inset 0 0 0 9px rgba(0, 0, 0, 0.05);
  font-family: '楷体', 'KaiTi', 'STKaiti', '宋体', serif;
  color: #2a2a2a;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 280ms ease;
}

.wl-modal.wl-modal-in .wl-paper {
  transform: translate(-50%, -50%) scale(1);
}

/* 极淡晕染（基本只是细微深浅） */
.wl-paper::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.04), transparent 35%),
    radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, 0.03), transparent 30%),
    radial-gradient(ellipse at 100% 100%, rgba(0, 0, 0, 0.03), transparent 30%);
  border-radius: 4px;
}

/* 极淡纸纹 */
.wl-paper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1.5px),
    radial-gradient(rgba(0, 0, 0, 0.010) 1px, transparent 1.5px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 4px;
  mix-blend-mode: multiply;
  opacity: 0.55;
  border-radius: 4px;
}

.wl-paper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.wl-paper-meta {
  font-size: 12px;
  color: #7a7a7a;
  letter-spacing: 0.5px;
}

.wl-paper-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  font-family: serif;
  color: #555;
  cursor: pointer;
  transition: background 160ms ease;
  user-select: none;
}
.wl-paper-close:hover { background: rgba(0, 0, 0, 0.06); }

.wl-paper-to {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

.wl-paper-body {
  font-size: 15px;
  line-height: 1.95;
  color: #1f1f1f;
  white-space: normal;
  letter-spacing: 0.5px;
  text-indent: 2em;
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.wl-paper-sign {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #2a2a2a;
  letter-spacing: 2px;
  margin-top: 8px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

/* 朱砂印章（落款下方，唯一暖色重点） */
.wl-paper-sign::after {
  content: '印';
  display: inline-block;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  vertical-align: middle;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 220, 200, 0.4), transparent 50%),
    linear-gradient(135deg, #c8302d 0%, #a01f1c 100%);
  border-radius: 4px;
  color: #ffffff;
  font-family: '楷体', 'KaiTi', serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
  box-shadow:
    0 2px 4px rgba(80, 0, 0, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6),
    inset 0 0 0 3px rgba(160, 30, 28, 0.7);
  transform: rotate(-5deg);
  letter-spacing: 0;
}

/* 已回信展示区 */
.wl-reply-shown {
  margin-top: 18px;
  padding: 14px 16px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}
.wl-reply-shown-title {
  font-size: 13px;
  font-weight: 700;
  color: #7a7a7a;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.wl-reply-shown-body {
  font-size: 14px;
  line-height: 1.85;
  color: #2a2a2a;
  text-indent: 2em;
}

/* 操作按钮 */
.wl-paper-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.wl-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f4f4f4);
  color: #2a2a2a;
  font-family: '楷体', 'KaiTi', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 2px 4px rgba(0, 0, 0, 0.06);
}
.wl-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 4px 10px rgba(0, 0, 0, 0.10);
}
.wl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wl-btn-save {
  background: linear-gradient(180deg, #ffffff, #ececec);
  color: #1a1a1a;
}
.wl-btn-reply {
  background: linear-gradient(180deg, #d83a36, #b8262a);
  color: #ffffff;
  border-color: rgba(120, 25, 25, 0.55);
  text-shadow: 0 1px 0 rgba(60, 0, 0, 0.4);
}
.wl-btn-close {
  background: linear-gradient(180deg, #f8f8f8, #e8e8e8);
}
.wl-btn-ghost {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.18);
}
.wl-btn-send {
  background: linear-gradient(180deg, #2a2a2a, #111111);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* 回信输入区 */
.wl-reply-zone {
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.wl-reply-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #ffffff;
  font-family: '楷体', 'KaiTi', '宋体', serif;
  font-size: 14px;
  line-height: 1.8;
  color: #1f1f1f;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}
.wl-reply-input:focus {
  border-color: #b8262a;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(184, 38, 42, 0.12);
}
.wl-reply-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* 收藏卡片标签 */
.wl-fav-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  background: linear-gradient(135deg, #c8302d, #a01f1c);
  border-radius: 10px;
  font-family: '楷体', 'KaiTi', serif;
}

/* 移动端微调 */
@media (max-width: 480px) {
  .wl-paper {
    width: 92vw;
    padding: 22px 20px 18px;
  }
  .wl-paper-body { font-size: 14.5px; }
  .wl-envelope { width: 220px; height: 142px; }
  .wl-env-body { padding: 0 18px; }
}
