/* pages.css — 各屏(P1–P6)视觉布局
 * 设计基准：750 × 1334 (1rem = 100px @ 750 宽)
 * 配色：
 *   --c-primary #78A848 (草绿)
 *   --c-light   #90C048 (亮绿)
 *   --c-light2  #A8C048 (亮绿2)
 *   --c-deep    #48A860 (深绿)
 *   --c-warm    #F0D878 (暖黄)
 *   --c-warm2   #F0D890 (暖黄2)
 *   --c-bg      #F0F0D8 (米白底)
 */

/* ====== 通用屏幕容器 ====== */
.screen { /* 宽度、定位、比例(750/1334) 均由 main.css 统一控制，确保背景图不变形 */ }
.screen-bg { background-size: cover; background-position: top center; background-repeat: no-repeat; background-color: var(--c-bg); }
.screen-inner { background-image: url('../assets/bg1.webp'); }
.screen-home  { background-image: url('../assets/bg1.webp'); }

/* ====== 顶部 logo（左上）- HTML 文字版 "新东方" ====== */
.top-logo { position: absolute; top: .26rem; left: .3rem; z-index: 3; pointer-events: none; line-height: 1; }
.top-logo .logo-zh { display: block; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 900; font-size: .5rem; color: #fff; letter-spacing: .02rem; text-shadow: 0 .02rem .04rem rgba(0,0,0,.25); }
.top-logo .logo-en { display: block; font-family: Arial, sans-serif; font-size: .16rem; color: #fff; font-weight: 600; letter-spacing: .04rem; margin-top: .04rem; opacity: .9; }

/* ====== 通用：艺术字/标题（楷体手写感）====== */
.kaiti { font-family: "STKaiti", "Kaiti SC", "KaiTi", "Hiragino Sans GB", "Microsoft YaHei", serif; font-weight: 700; letter-spacing: .02rem; color: #fff; text-shadow: 0 .04rem .08rem rgba(72,168,96,.18); }

/* ====== 通用按钮 ====== */
.btn-pill { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: .8rem; padding: .26rem .9rem; font-family: inherit; font-size: .36rem; font-weight: 800; color: #fff; cursor: pointer; box-shadow: 0 .08rem .16rem rgba(0,0,0,.18); transition: transform .12s, box-shadow .12s, filter .12s; letter-spacing: .04rem; }
.btn-pill:active { transform: scale(.97); box-shadow: 0 .04rem .08rem rgba(0,0,0,.18); }
.btn-warm { background: linear-gradient(180deg, #F8E89A 0%, #F0D878 50%, #E0B860 100%); color: #C8581A; border: .03rem solid #F0D890; text-shadow: 0 .02rem 0 #fff8d8; }
.btn-warm-lg { background: linear-gradient(180deg, #F8E89A 0%, #F0D878 45%, #D8A840 100%); color: #C8581A; border: .04rem solid #F0D890; padding: .32rem 1rem; font-size: .44rem; border-radius: 1rem; text-shadow: 0 .02rem 0 #fff8d8; }
.btn-primary { background: linear-gradient(180deg, var(--c-light2) 0%, var(--c-primary) 100%); color: #fff; border: .03rem solid var(--c-deep); }
.btn-outline { background: #fff; color: var(--c-deep); border: .04rem solid var(--c-deep); }
.btn-share-action { background: linear-gradient(180deg, #F8E89A 0%, #F0D878 50%, #D8A840 100%); color: #C8581A; border: .04rem solid #F0D890; padding: .28rem .9rem; font-size: .36rem; border-radius: .8rem; text-shadow: 0 .02rem 0 #fff8d8; }

/* ====== P1 首页 ====== */
#p1 { padding-top: 0; }
.p1-art { position: absolute; top: .9rem; left: 50%; transform: translateX(-50%); width: 6.6rem; text-align: center; }
.p1-art h1 { font-size: 1.05rem; line-height: 1.18; color: #fff; }
.p1-art .sub { margin-top: .18rem; font-size: .32rem; font-weight: 600; color: #fff; letter-spacing: .04rem; text-shadow: 0 .02rem 0 var(--c-deep); }
.p1-btn { position: absolute; top: 8.55rem; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.p1-poem { position: absolute; top: 9.7rem; left: 0; right: 0; text-align: center; font-size: .26rem; line-height: 1.8; color: #fff; text-shadow: 0 .02rem .04rem rgba(0,0,0,.25); }
.p1-poem .y { color: #FFE078; font-weight: 700; margin: 0 .04rem; }
.p1-poem .today { display: block; margin-top: .16rem; font-size: .3rem; font-weight: 800; }
.p1-foot { position: absolute; bottom: .36rem; left: 0; right: 0; text-align: center; font-size: .22rem; color: rgba(255,255,255,.78); padding: 0 .4rem; line-height: 1.6; }

/* ====== P2 上传编辑 ====== */
.p2-card { position: absolute; top: 1.6rem; left: .55rem; width: 6.4rem; background: #FCFAEB; border-radius: .16rem; box-shadow: 0 .12rem .36rem rgba(72,168,96,.18); padding: 0; box-sizing: border-box; overflow: hidden; }
.p2-card-top { position: relative; width: 100%; height: 1.5rem; background: url('../assets/pdf-extract/p11_top.png') center bottom/cover no-repeat; }
.p2-card-body { padding: .3rem .3rem 0; }
.p2-card .p2-frame { position: relative; width: 100%; height: 4.6rem; background: #fff; border-radius: .12rem; overflow: hidden; box-shadow: inset 0 0 0 .02rem #E8E2C0; display: flex; align-items: center; justify-content: center; }
.p2-card .p2-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; transform-origin: center center; }
.p2-card .p2-frame .upload-tip { display: flex; flex-direction: column; align-items: center; color: #999; font-size: .26rem; }
.p2-card .p2-frame .upload-tip .cam { font-size: .7rem; line-height: 1; color: #B8B49A; }
.p2-card .p2-frame .upload-tip .t1 { font-size: .32rem; color: #6B6B5E; margin-top: .14rem; font-weight: 700; }
.p2-card .p2-frame .upload-tip .t2 { font-size: .22rem; color: #9A9682; margin-top: .06rem; }
.p2-card .wish { display: block; width: 100%; height: 1.5rem; margin: .24rem 0 .2rem; padding: .18rem .24rem; border: .02rem solid #D8D2A8; border-radius: .12rem; background: #FFFDF1; font-size: .3rem; font-family: inherit; color: var(--c-deep); resize: none; box-sizing: border-box; }
.p2-card .wish::placeholder { color: #B5B090; }
.p2-xdf { text-align: center; font-size: .36rem; font-weight: 800; color: var(--c-deep); letter-spacing: .06rem; padding: .1rem 0 .2rem; }
.p2-tagline { position: relative; height: 2.4rem; padding: 0; text-align: center; font-size: .24rem; color: #fff; letter-spacing: .04rem; text-shadow: 0 .02rem 0 rgba(72,168,96,.4); background: url('../assets/pdf-extract/p11_bot.png') center top/100% 100% no-repeat; }
.p2-bottom { position: absolute; bottom: .3rem; left: 0; right: 0; text-align: center; }
.p2-bottom .btn-warm-lg { padding: .26rem 1rem; font-size: .36rem; }

/* ====== P3 卡片预览 ====== */
.p3-title { position: absolute; top: .9rem; left: 0; right: 0; text-align: center; }
.p3-title h2 { font-size: .8rem; line-height: 1.15; color: #fff; }
.p3-sub { position: absolute; top: 2.65rem; left: 0; right: 0; text-align: center; font-size: .28rem; color: #fff; line-height: 1.6; text-shadow: 0 .02rem 0 rgba(72,168,96,.4); }
.p3-sub .y { color: #FFE078; font-weight: 700; margin: 0 .04rem; }
.p3-card-wrap { position: absolute; top: 3.7rem; left: 50%; transform: translateX(-50%); width: 6.6rem; }
.p3-card-wrap img { width: 100%; display: block; border-radius: .16rem; box-shadow: 0 .12rem .36rem rgba(0,0,0,.18); }
.p3-actions { position: absolute; bottom: .5rem; left: 0; right: 0; display: flex; justify-content: center; gap: .3rem; }
.p3-actions .btn-pill { padding: .26rem .7rem; font-size: .32rem; border-radius: .8rem; }

/* ====== P4 分享 ====== */
.p4-title { position: absolute; top: 1rem; left: 0; right: 0; text-align: center; }
.p4-title h2 { font-size: .8rem; line-height: 1.2; color: #fff; }
.p4-title h2 .y { color: #FFE078; }
.p4-sub { position: absolute; top: 4rem; left: 0; right: 0; text-align: center; font-size: .26rem; color: #fff; line-height: 1.7; text-shadow: 0 .02rem 0 rgba(72,168,96,.4); padding: 0 .3rem; }
.p4-sub .y { color: #FFE078; font-weight: 700; margin: 0 .04rem; }
.p4-channels { position: absolute; top: 6.4rem; left: .7rem; right: .7rem; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.85); border-radius: 1.2rem; padding: .2rem .3rem; box-shadow: 0 .04rem .12rem rgba(72,168,96,.12); }
.p4-channels .ch { display: flex; flex-direction: column; align-items: center; width: 1.3rem; }
.p4-channels .ch .icon { width: .9rem; height: .9rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .5rem; color: #fff; box-shadow: 0 .04rem .12rem rgba(0,0,0,.12); }
.p4-channels .ch .icon.wx   { background: #2DC26B; }
.p4-channels .ch .icon.pyq  { background: #7ED957; }
.p4-channels .ch .icon.xhs  { background: #FF3B5C; }
.p4-channels .ch .icon.dy   { background: #000; }
.p4-channels .ch .icon svg { width: .52rem; height: .52rem; }
.p4-channels .ch .lbl { margin-top: .06rem; font-size: .22rem; color: #6B6B5E; }
.p4-channel-label { position: absolute; top: 5.8rem; left: 0; right: 0; text-align: center; font-size: .26rem; color: var(--c-deep); letter-spacing: .08rem; }
.p4-channel-label::before, .p4-channel-label::after { content: '——'; color: var(--c-deep); margin: 0 .12rem; }
.p4-bottom { position: absolute; bottom: .5rem; left: 0; right: 0; text-align: center; }
.p4-bottom .btn-share-action { padding: .28rem 1rem; font-size: .36rem; }
.p4-foot { position: absolute; bottom: .2rem; left: 0; right: 0; text-align: center; font-size: .18rem; color: rgba(255,255,255,.7); padding: 0 .3rem; line-height: 1.5; }

/* ====== P5 9 宫格抽奖 ====== */
/* ====== P5 抽奖（雪碧图重做）====== */
.p5-frame { position: absolute; }
.p5-frame .p5-frame-bg { pointer-events: none; }
.p5-grid { position: absolute; top: 0; left: .15rem; right: .15rem; aspect-ratio: 1; padding: 0.5rem 0.4rem 0.3rem 0.35rem; box-sizing: border-box; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: .06rem; }
.p5-grid .slot { position: relative; display: flex; align-items: center; justify-content: center; }
.p5-grid .slot.center { cursor: pointer; }
.p5-grid .slot.wheel-hit::after { content: ''; position: absolute; inset: 4%; border: .06rem solid #FFE078; border-radius: .12rem; box-shadow: 0 0 .3rem rgba(255,224,120,.9); pointer-events: none; }
.p5-bottom { position: absolute; bottom: .5rem; left: .5rem; right: .5rem; }
.p5-bottom .tip { background: rgba(255,255,255,.92); border-radius: .16rem; padding: .22rem .3rem; text-align: center; box-shadow: 0 .04rem .12rem rgba(0,0,0,.08); }
.p5-bottom .tip .t1 { font-size: .28rem; font-weight: 800; color: #C8581A; }
.p5-bottom .tip .t2 { font-size: .22rem; color: #8A6A4A; margin-top: .04rem; }
#drawResult { display: none; }
/* 通用提示弹窗（跨屏 fixed） */
.msg-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.msg-modal[hidden] { display: none; }
.msg-modal-card { background: #fff; border-radius: .24rem; padding: .6rem .5rem; width: 5rem; text-align: center; box-shadow: 0 .12rem .36rem rgba(0,0,0,.3); }
.msg-modal-card .msg-modal-img { position: relative; margin: 0 auto .3rem; }
.msg-modal-card .msg-modal-img[hidden] { display: none; }
.msg-modal-card .msg-modal-img-top { filter: drop-shadow(0 .03rem .06rem #479B69); }
.msg-modal-text { font-size: .3rem; color: #444; margin-bottom: .3rem; line-height: 1.6; white-space: pre-wrap; }
.msg-modal-btn { display: block; width: 100%; padding: .2rem; background: #78A848; color: #fff; border: none; border-radius: .4rem; font-size: .3rem; font-weight: 700; cursor: pointer; }
.msg-modal-btn.sp { position: relative; width: var(--pw); margin: .3rem auto 0; }
/* 分享弹窗（P2 生成贺卡后）*/
.share-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.share-modal[hidden] { display: none; }
.share-modal-card { position: relative; background: #fff; border-radius: .24rem; padding: .5rem .5rem .4rem; width: 6rem; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; box-shadow: 0 .12rem .36rem rgba(0,0,0,.3); }
.modal-close-x { position: absolute; top: .14rem; right: .14rem; width: .56rem; height: .56rem; background: transparent; border: none; font-size: .42rem; color: #9a9a9a; line-height: .56rem; padding: 0; cursor: pointer; z-index: 10; }
.share-modal-imgwrap { width: 5rem; position: relative; border-radius: .12rem; overflow: hidden; background: #f3f3f3; }
.share-modal-imgwrap img { display: block; width: 100%; height: auto; }
.share-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: .3rem .2rem .2rem; background: transparent; pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.share-overlay.saved { background: linear-gradient(to bottom, rgba(255,255,255,0.02) 0%, #fff 15%); pointer-events: auto; }
.share-modal-tip { font-size: .26rem; font-weight: 700; color: #E08A2E; margin: 0 0 .14rem; padding: .14rem .34rem; background: linear-gradient(to bottom, #fff, #fff4e6); border: .02rem solid rgba(245,172,79,.55); border-radius: .12rem; box-shadow: inset 0 .03rem .06rem rgba(255,255,255,.95), inset 0 -.03rem .05rem rgba(0,0,0,.06), 0 0 .24rem .1rem rgba(255,240,210,.45), 0 .06rem .18rem rgba(0,0,0,.18); text-shadow: 0 0 .04rem rgba(255,255,255,.9), 0 .02rem .04rem rgba(0,0,0,.25); pointer-events: none; order: 1; }
.share-channel { position: relative; margin: 0 0 .14rem; display: none; order: 1; }
.share-modal-btn { position: relative; margin: 0; order: 2; }
#shareGoDraw { display: none; }
.share-overlay.saved .share-modal-tip { display: none; }
.share-overlay.saved .share-channel { display: block; }
.share-overlay.saved #shareGoDraw { display: block; }
.share-modal-card .sp { position: relative; left: auto; top: auto; }
/* 抽奖结果弹窗 */
.draw-modal { position: absolute; inset: 0; background: rgba(0,0,0,.6); z-index: 10; display: flex; align-items: center; justify-content: center; }
.draw-modal[hidden] { display: none; }
.draw-modal-card { background: #fff; border-radius: .24rem; padding: .5rem .5rem .4rem; width: 5.4rem; text-align: center; box-shadow: 0 .12rem .36rem rgba(0,0,0,.3); }
.draw-modal-card .draw-prize-img { position: relative; margin: 0 auto .2rem; }
.draw-modal-card .draw-prize-img[hidden] { display: none; }
.draw-modal-title { font-size: .36rem; font-weight: 800; color: #C8581A; margin-bottom: .12rem; }
.draw-modal-name { font-size: .28rem; color: #444; margin-bottom: .3rem; }
.draw-modal-btn { display: block; width: 100%; padding: .2rem; background: #78A848; color: #fff; border: none; border-radius: .4rem; font-size: .3rem; font-weight: 700; cursor: pointer; }
.draw-modal-btn.sp { position: relative; width: var(--pw); margin: .3rem auto 0; }
.draw-modal-actions { display: flex; gap: .18rem; justify-content: center; align-items: center; margin-top: .3rem; }
.draw-modal-actions .draw-modal-btn { width: var(--pw, auto); flex: 0 0 auto; margin: 0; padding: 0; background-color: transparent; border: 0; }

/* ====== P6 填表 ====== */
/* ====== P6 中奖收货（雪碧图重做）====== */
.p6-prize { position: absolute; top: 4.8rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: row; align-items: center; gap: .3rem; }
.p6-prize .p6-prize-img { position: relative; flex: 0 0 auto; }
.p6-prize .name { font-size: .3rem; font-weight: 800; color: #fff; text-shadow: 0 .02rem .04rem rgba(0,0,0,.25); white-space: nowrap; }
.p6-form { position: absolute; top: 6.4rem; left: .5rem; right: .5rem; padding-bottom: 1.2rem; }
.p6-form .field { display: flex; align-items: center; background: rgba(255,255,255,.6); border-radius: .12rem; padding: .22rem .28rem; margin-bottom: .2rem; box-shadow: 0 .04rem .12rem rgba(72,168,96,.12); }
.p6-form .field .lbl { width: 1.4rem; font-size: .28rem; color: var(--c-deep); font-weight: 700; }
.p6-form .field input, .p6-form .field textarea { flex: 1; border: none; outline: none; background: transparent; font-size: .28rem; font-family: inherit; color: #333; resize: none; }
.p6-form .field.textarea-field { align-items: flex-start; padding: .24rem .28rem; }
.p6-form .field.textarea-field textarea { min-height: .9rem; }
.p6-submit { position: relative !important; transform: none; display: inline-block !important; }
.p6-submit-wrap { display: flex; justify-content: center; margin-top: .4rem; }
.p6-form .field.p6-upload-field { flex-direction: column; align-items: stretch; gap: .14rem; }
.p6-upload-area { display: block; min-height: 2rem; border: 2px dashed #c8b48a; border-radius: .12rem; background: #fff; overflow: hidden; cursor: pointer; }
.p6-upload-tip { text-align: center; color: #b9a06a; font-size: .26rem; line-height: 2rem; }
#claimSuccess { position: absolute; top: 6.4rem; left: 0; right: 0; text-align: center; font-size: .36rem; color: #fff; font-weight: 800; padding: 0 .6rem; line-height: 1.8; }
#claimSuccess .big { font-size: .48rem; display: block; margin-bottom: .2rem; }

/* ====== P0 微信引导 ====== */
#p0 { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
#p0 .guide { background: rgba(255,255,255,.95); border-radius: .24rem; padding: .6rem .5rem; text-align: center; color: var(--c-deep); box-shadow: 0 .12rem .36rem rgba(0,0,0,.15); }
#p0 .guide h3 { font-size: .4rem; margin-bottom: .24rem; }
#p0 .guide p { font-size: .26rem; color: #888; line-height: 1.7; margin-top: .16rem; }
#p0 .guide .icon { font-size: .8rem; color: var(--c-primary); }

/* ====== 响应式适配 ====== */
@media (max-aspect-ratio: 750/1334) {
  /* 短屏：按屏高收缩定位（用 vh 兜底） */
  .p1-poem { top: calc(9.7rem - 0.5vh); }
  .p3-actions, .p4-bottom, .p5-bottom, .p6-bottom { bottom: max(.3rem, 1.5vh); }
}
@media (min-width: 768px) {
  /* PC 预览：font-size 基于 vh（匹配 #app 宽），元素不随窗口宽度变大 */
  html { font-size: calc(100vh / 13.34); }
  #app { box-shadow: 0 0 .6rem rgba(0,0,0,.15); max-width: calc(100vh * 750 / 1334); }
}

/* ====== P2 海报生成页（雪碧图重做）====== */
.p2-frame { position: absolute; left: 1.01rem; top: 1.13rem; width: 5.59rem; height: 11.16rem; }
.p2-frame .p2-frame-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; z-index: 2; }
.p2-frame .p2-paper { position: absolute; left: 3.1%; top: 1.5%; width: 94.2%; height: 71.1%; background: url('../assets/shisheng.webp') center/cover no-repeat; border-radius: .08rem; box-shadow: 0 .04rem .12rem rgba(0,0,0,.06); z-index: 0; }
.p2-frame .p2-upload { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); cursor: pointer; z-index: 2; }
.p2-frame .p2-upload input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; top: 0; left: 0; }
.p2-frame .p2-upload .p2-upload-tip { width: 4rem; height: auto; pointer-events: none; }
.p2-frame .p2-photo { position: absolute; left: 3.1%; top: 1.5%; width: 94.2%; height: 71.1%; overflow: hidden; border-radius: .08rem; z-index: 1; }
.p2-frame .p2-photo img { position: absolute; width: 100%; height: 100%; top: 0; left: 0; object-fit: cover; object-position: 50% 50%; }
.p2-frame .p2-wish { position: absolute; left: 3.2%; top: 78%; width: 94.2%; height: 1.6rem; background: transparent; border: .02rem dashed rgba(255,255,255,.75); border-radius: .04rem; padding: .18rem .32rem; font-size: .24rem; font-family: "STKaiti", "Kaiti SC", "KaiTi", "楷体", serif; color: #fff; resize: none; box-sizing: border-box; z-index: 3; text-align: left; }
.p2-frame .p2-wish::placeholder { color: rgba(255,255,255,.55); }
.p2-actions { position: absolute; left: .2rem; right: .2rem; top: 12.4rem; height: 1.04rem; display: flex; align-items: center; justify-content: space-between; z-index: 6; }
.p2-spacer { position: relative; height: 13.8rem; pointer-events: none; }
.p2-actions .p2-btn { position: relative; flex: 0 0 auto; border: 0; padding: 0; cursor: pointer; background-color: transparent; }

/* P2 合成结果图（覆盖相框区域）+ 按钮状态 */
.p2-result { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); width: 6.2rem; height: 11.57rem; z-index: 5; background: transparent; }
.p2-result img { width: 100%; height: 100%; object-fit: fill; display: block; }
.p2-actions[data-state="composed"] [data-btn="help"] { display: none; }  /* 生成后隐藏"帮我写" */
