/* =========================================================
 * poster.css — 分享海报 + 预览对话框 + 分享按钮
 *
 * 海报使用固定 750×1334（微信朋友圈推荐尺寸），
 * 放在屏幕外用 html2canvas 截图，用户看到的是生成的 PNG。
 * ========================================================= */

/* ============= 海报舞台（离屏渲染） ============= */
.poster-stage {
  position: fixed;
  left: -99999px;  /* 关键：藏在屏幕外，仍参与布局，html2canvas 可截图 */
  top: 0;
  width: 750px;
  height: 1334px;
  pointer-events: none;
  z-index: -1;
}

.poster {
  position: relative;
  width: 750px;
  height: 1334px;
  padding: 80px 60px;
  color: #f5e6d3;
  font-family: 'STSong', 'Songti SC', 'Noto Serif SC', serif;
  overflow: hidden;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(139, 30, 63, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(212, 175, 55, 0.15) 0%, transparent 55%),
    linear-gradient(180deg, #0e0620 0%, #1a0b2e 40%, #2a1245 70%, #0e0620 100%);
}

/* 星光小点 */
.poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 15% 12%, rgba(255, 240, 200, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 82% 18%, rgba(244, 208, 63, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 25% 42%, rgba(255, 240, 200, 0.7), transparent),
    radial-gradient(2px 2px at 78% 55%, rgba(244, 208, 63, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 12% 68%, rgba(255, 240, 200, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 90% 78%, rgba(255, 240, 200, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 35% 88%, rgba(244, 208, 63, 0.6), transparent);
  pointer-events: none;
}

.poster-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* 四角装饰 */
.poster-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 2px solid #d4af37;
  opacity: 0.8;
}
.p-tl { top: 32px; left: 32px; border-right: none; border-bottom: none; }
.p-tr { top: 32px; right: 32px; border-left: none; border-bottom: none; }
.p-bl { bottom: 32px; left: 32px; border-right: none; border-top: none; }
.p-br { bottom: 32px; right: 32px; border-left: none; border-top: none; }

/* ============= 顶部标题区 ============= */
.poster-top {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 30px;
}

.poster-ornament-top {
  color: #d4af37;
  margin-bottom: 30px;
  opacity: 0.85;
}
.poster-ornament-top svg { display: block; margin: 0 auto; }

.poster-title-zh {
  margin: 0 0 12px;
  font-family: 'STSong', 'Songti SC', 'Noto Serif SC', serif;
  font-size: 62px;
  font-weight: normal;
  letter-spacing: 20px;
  padding-left: 20px;  /* 补偿字间距 */
  color: #f4d03f;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.poster-title-en {
  margin: 0;
  font-family: 'Cinzel', 'Cormorant Garamond', serif;
  font-size: 20px;
  letter-spacing: 12px;
  padding-left: 12px;
  color: #c9b895;
  font-style: italic;
}

/* ============= 咖啡杯装饰 ============= */
.poster-cup-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 20px 0;
}

.poster-cup {
  display: inline-block;
  color: #d4af37;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

/* ============= 内容区 ============= */
.poster-content {
  position: relative;
  z-index: 2;
  margin: 30px 0 40px;
  text-align: center;
}

/* 首页版：诗意引言 */
.poster-content.pc-home .pc-quote {
  font-size: 26px;
  line-height: 1.9;
  color: #f5e6d3;
  font-style: italic;
  letter-spacing: 4px;
  padding: 30px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
}

/* 结果版：主题 + 摘要 */
.poster-content.pc-result .pc-subject-label {
  font-size: 18px;
  letter-spacing: 8px;
  padding-left: 8px;
  color: #c9b895;
  margin-bottom: 10px;
  display: block;
}

.poster-content.pc-result .pc-title {
  font-size: 44px;
  color: #f4d03f;
  letter-spacing: 12px;
  padding-left: 12px;
  margin: 0 0 24px;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  font-weight: normal;
}

.poster-content.pc-result .pc-divider {
  width: 60%;
  height: 20px;
  margin: 0 auto 24px;
  color: #d4af37;
  opacity: 0.7;
}
.poster-content.pc-result .pc-divider svg { display: block; margin: 0 auto; }

.poster-content.pc-result .pc-quote {
  font-size: 24px;
  line-height: 1.9;
  color: #f5e6d3;
  font-style: italic;
  letter-spacing: 3px;
  padding: 0 20px;
}

/* ============= 底部：二维码 + 品牌 ============= */
.poster-footer {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 100px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 24px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  background: rgba(14, 6, 32, 0.4);
}

.poster-qr-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  padding: 10px;
  background: #f5e6d3;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-qr {
  width: 120px;
  height: 120px;
}
.poster-qr canvas,
.poster-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.poster-cta {
  flex: 1;
  text-align: left;
}

.poster-cta-hint {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 6px;
  padding-left: 6px;
  color: #c9b895;
  font-family: 'STSong', 'Songti SC', serif;
}

.poster-cta-main {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: 6px;
  padding-left: 6px;
  color: #f4d03f;
  font-family: 'STSong', 'Songti SC', serif;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.poster-brand {
  margin: 0;
  font-size: 14px;
  letter-spacing: 3px;
  color: #d4af37;
  opacity: 0.7;
  font-family: 'Cinzel', serif;
}

/* =========================================================
 * 首页"邀好友同卜"按钮
 * ========================================================= */
.btn-share-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.4rem;
  margin-top: 0.9rem;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  color: var(--color-parchment-dim);
  font-family: var(--font-decorative);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.25s ease;
  animation: fadeInUp 1.2s ease 0.7s both;
}

.btn-share-home:active {
  transform: scale(0.97);
  background: rgba(212, 175, 55, 0.12);
  color: var(--color-gold-bright);
  border-color: rgba(212, 175, 55, 0.7);
}

/* =========================================================
 * 结果页 "分享海报" 高亮按钮 + 神秘口令
 * ========================================================= */
.btn-export-highlight {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(139, 30, 63, 0.35) 100%) !important;
  border-color: rgba(244, 208, 63, 0.7) !important;
  color: var(--color-gold-bright) !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

.secret-code-wrap {
  padding: 0 1rem 0.5rem;
  text-align: center;
  background: rgba(14, 6, 32, 0.9);
}

.btn-secret-code {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: 1px dashed rgba(212, 175, 55, 0.5);
  border-radius: 16px;
  color: var(--color-parchment-dim);
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-secret-code:active {
  transform: scale(0.97);
  color: var(--color-gold-bright);
  border-color: rgba(212, 175, 55, 0.8);
  border-style: solid;
}

/* =========================================================
 * 海报预览对话框
 * ========================================================= */
.poster-preview {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.poster-preview.is-show {
  display: flex;
  animation: oracleFadeIn 0.4s ease both;
}

.pp-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pp-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-height: 100%;
  overflow: hidden;
}

.pp-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  display: block;
}

.pp-hint {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--color-parchment-dim);
  letter-spacing: 0.1em;
  text-align: center;
}

.pp-close {
  padding: 0.6rem 1.8rem;
}
