:root{
  --red:#C4161C; --red-d:#9E1015; --gold:#C9A227; --gold-l:#F0D28C;
  --cream:#FDF8F2; --ink:#1B1B1B; --muted:#8A8A8A; --line:#EFE2D6;
  --serif:"Songti SC","STSong","SimSun","Noto Serif SC",serif;
  --sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{
  background:#141418;font-family:var(--sans);color:var(--ink);
  display:flex;align-items:center;justify-content:center;overflow:hidden;
}
#app{
  position:relative;width:100%;max-width:390px;height:100dvh;max-height:846px;
  background:var(--cream);overflow:hidden;
  box-shadow:0 40px 120px rgba(0,0,0,.65);
}
@media(min-width:560px){
  #app{border-radius:42px;height:846px}
}
.screen{
  position:absolute;inset:0;display:flex;flex-direction:column;
  opacity:0;visibility:hidden;transform:translateX(16px);
  transition:opacity .3s ease,transform .34s cubic-bezier(.2,.8,.2,1),visibility .34s;
}
.screen.active{opacity:1;visibility:visible;transform:none;z-index:2}

#s-cover{display:block;padding:0;background:#f8f0e2}
#s-cover iframe{display:block;width:100%;height:100%;border:0;background:#f8f0e2}

/* ---------- cover ---------- */
#s-cover{background:var(--cream);color:var(--ink)}
.cover-art{position:relative;height:50%;min-height:290px;overflow:hidden}
.hero{position:absolute;inset:0;background-size:118%;background-position:center 46%;
  animation:kb 24s ease-out both}
@keyframes kb{from{transform:scale(1.04)}to{transform:scale(1.12)}}
.top-scrim{position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(12,9,6,.55) 0%,rgba(12,9,6,.06) 26%,rgba(12,9,6,0) 52%,rgba(12,9,6,.24) 100%)}
.cover-top{position:absolute;z-index:3;left:0;right:0;top:0;display:flex;justify-content:space-between;
  align-items:center;padding:calc(env(safe-area-inset-top) + 20px) 22px 0}
.brand{font-size:10px;letter-spacing:.16em;color:rgba(255,255,255,.86);text-shadow:0 1px 10px rgba(0,0,0,.45)}
.demo-chip{font-size:9px;letter-spacing:.1em;padding:4px 8px;border-radius:999px;
  background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.28);color:rgba(255,255,255,.85);backdrop-filter:blur(6px)}
.cover-panel{position:relative;z-index:3;flex:1;display:flex;flex-direction:column;
  margin-top:-26px;background:var(--cream);border-radius:26px 26px 0 0;
  box-shadow:0 -14px 34px rgba(50,32,14,.13);
  padding:22px 24px calc(env(safe-area-inset-bottom) + 16px)}
.kicker{display:flex;align-items:center;gap:9px;font-size:10.5px;letter-spacing:.2em;color:var(--red);margin-bottom:13px}
.kicker:before{content:'';width:18px;height:1px;background:var(--red);opacity:.55}
.cover h1{font-family:var(--serif);font-weight:700;font-size:36px;line-height:1.24;margin:0;
  color:var(--ink);letter-spacing:.01em}
.cover h1 em{font-style:normal;color:var(--red)}
.cover .sub{font-size:12.5px;color:#7d7166;margin:12px 0 0;line-height:1.75}
.badges{display:flex;gap:7px;margin-top:16px;flex-wrap:wrap}
.badge{font-size:10.5px;padding:6px 11px;border-radius:999px;color:#7A5B3E;
  background:#F7EBDD;border:1px solid #EEDCC8}
.cta{width:100%;height:52px;margin-top:auto;border:0;border-radius:999px;cursor:pointer;
  background:linear-gradient(180deg,#D62026,#B21016);color:#fff;font-size:16px;font-weight:600;
  letter-spacing:.06em;box-shadow:0 12px 30px rgba(196,22,28,.3);font-family:var(--sans)}
.cta:active{transform:scale(.985)}
.cta.note{margin-top:10px;text-align:center;font-size:10.5px;color:#A2937F;box-shadow:none;padding:0;height:auto;background:none}
.cover-links{display:flex;justify-content:center;gap:16px;margin-top:10px;font-size:10.5px}
.cover-links button{background:none;border:0;color:#A2937F;font-size:10.5px;padding:4px;text-decoration:underline;text-underline-offset:3px}

/* ---------- header ---------- */
.hdr{position:relative;z-index:4;display:flex;align-items:center;gap:8px;
  padding:calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background:rgba(253,248,242,.94);backdrop-filter:blur(14px);border-bottom:1px solid rgba(0,0,0,.045)}
.hdr .back{width:34px;height:34px;border:0;background:none;font-size:20px;color:var(--ink);
  display:grid;place-items:center;cursor:pointer;padding:0}
.hdr .title{flex:1;text-align:center;font-size:15.5px;font-weight:600;margin-right:34px}
.hdr .step{position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:10px;color:var(--muted);letter-spacing:.08em}

.body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.body::-webkit-scrollbar{display:none}

/* ---------- spots ---------- */
.spots-top{position:relative;overflow:hidden;
  background:linear-gradient(105deg,#FDF3E4 0%,#FBF7F0 46%,#E6F2EE 100%)}
.appbar{position:relative;z-index:4;display:flex;align-items:center;
  height:calc(44px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 10px 0}
.appbar .back{width:34px;height:34px;border:0;background:none;font-size:22px;line-height:1;
  color:#1B1B1B;display:grid;place-items:center;cursor:pointer;padding:0}
.appbar-title{position:absolute;left:0;right:0;text-align:center;font-size:15px;font-weight:600;
  color:#1B1B1B;pointer-events:none;letter-spacing:.01em}
.appbar-title em{font-style:normal;color:var(--red)}
.spots-hero{position:relative;z-index:2;padding:12px 20px 24px}
.spots-hero:before{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(90deg,rgba(253,243,228,.97) 0%,rgba(253,243,228,.8) 38%,rgba(253,243,228,0) 68%)}
.spots-hero h1{position:relative;z-index:2;margin:0;display:inline-block;
  font-family:'MSZ',"STXingkai","华文行楷","STKaiti","KaiTi",serif;
  font-size:36px;line-height:1.5;font-weight:400;letter-spacing:.05em;color:#141414;
  transform:skewX(-9deg);transform-origin:left bottom;
  text-shadow:0 1px 0 rgba(255,255,255,.55)}
.spots-hero p{position:relative;z-index:2;margin:10px 0 0;font-size:12px;color:#6F6A64}
.spots-hero p em{font-style:normal;color:#E8622A;font-weight:700;font-size:13px}
.skyline{position:absolute;right:-10px;bottom:-8px;width:236px;height:auto;z-index:0;opacity:1}

.intro{padding:18px 20px 2px}
.intro h2{font-family:var(--serif);font-size:27px;line-height:1.2;margin:0 0 8px;letter-spacing:.01em}
.intro p{font-size:12px;color:var(--muted);margin:0;line-height:1.7}
.group{margin:18px 20px 0}
.group-t{display:flex;align-items:center;gap:7px;font-size:11.5px;color:#7a6f64;margin-bottom:10px;letter-spacing:.04em}
.dot{width:6px;height:6px;border-radius:50%}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.spot{position:relative;display:flex;flex-direction:column;width:100%;padding:0;border:2px solid transparent;
  border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 6px 16px rgba(90,60,30,.07);
  text-align:left;cursor:pointer;font-family:var(--sans);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.spot:active{transform:scale(.985)}
.spot .thumb{display:block;width:100%;aspect-ratio:3/2;flex:0 0 auto;
  background-size:cover;background-position:center}
.spot .nm{display:block;padding:9px 10px 10px;font-size:12px;font-weight:600;letter-spacing:.01em;line-height:1.3}
.spot .tag{position:absolute;top:7px;left:7px;font-size:8.5px;padding:2.5px 6px;border-radius:5px;color:#fff;
  letter-spacing:.04em;font-weight:500}
.spot.soon{opacity:.8;cursor:default}
.spot.soon .thumb{filter:grayscale(.45)}
.spot.soon .nm{color:#8A8074}
.soon-tag{position:absolute;left:50%;top:34%;transform:translate(-50%,-50%);
  background:rgba(255,255,255,.94);color:#8A7F6F;font-size:10px;padding:4px 10px;
  border-radius:999px;border:1px solid #E4D9C8;white-space:nowrap;z-index:3}
.spot.sel{border-color:var(--red);box-shadow:0 8px 22px rgba(196,22,28,.18)}
.spot .chk{position:absolute;top:7px;right:7px;width:19px;height:19px;border-radius:50%;
  background:var(--red);color:#fff;font-size:10px;display:none;place-items:center;
  box-shadow:0 2px 6px rgba(0,0,0,.2)}
.spot.sel .chk{display:grid}
.coming{margin:14px 20px 0;border:1.5px dashed #E2D2C2;border-radius:14px;padding:16px;
  text-align:center;font-size:11px;color:#B09B87;line-height:1.7}
.bottombar{position:absolute;left:0;right:0;bottom:0;z-index:6;
  padding:14px 20px calc(env(safe-area-inset-bottom) + 14px);
  background:linear-gradient(180deg,rgba(253,248,242,0) 0%,rgba(253,248,242,.95) 34%,rgba(253,248,242,1) 100%)}
.btn{width:100%;height:50px;border:0;border-radius:999px;background:var(--red);color:#fff;
  font-size:15px;font-weight:600;letter-spacing:.04em;font-family:var(--sans);cursor:pointer;
  box-shadow:0 10px 24px rgba(196,22,28,.28)}
.btn:disabled{background:#E6DCD2;color:#AC9F92;box-shadow:none}
.btn:active:not(:disabled){transform:scale(.99)}

/* ---------- upload ---------- */
.upload-body{padding:8px 22px 120px}
.upload-body h2{font-family:var(--serif);font-size:26px;margin:16px 0 6px}
.upload-body .lead{font-size:12px;color:var(--muted);margin:0 0 4px}
.spot-line{font-size:11.5px;color:#8A7F6E;margin:8px 0 14px;line-height:1.5}
.frame{margin:16px auto 12px;width:100%;aspect-ratio:3/4;max-height:52vh;border-radius:22px;overflow:hidden;
  background:#F4EBE1;border:1.5px dashed #DCC9B7;display:grid;place-items:center;position:relative;cursor:pointer}
.frame.filled{border-style:solid;border-color:#EADCCD}
.frame img{width:100%;height:100%;object-fit:contain;background:#F7F1E8;display:block}
.frame .ph{text-align:center;color:#B5A08B;font-size:11.5px;line-height:1.9}
.frame .ph .big{display:block;font-size:34px;margin-bottom:6px;opacity:.55}
.frame .re{position:absolute;right:10px;bottom:10px;background:rgba(0,0,0,.45);color:#fff;
  font-size:10.5px;padding:5px 10px;border-radius:999px;backdrop-filter:blur(4px)}
.beauty-chip{position:absolute;left:10px;top:10px;font-size:9.5px;color:#7A5B3E;
  background:rgba(255,255,255,.9);border:1px solid rgba(201,162,39,.28);
  padding:4px 9px;border-radius:999px;backdrop-filter:blur(4px)}
.consent{display:flex;gap:8px;font-size:11px;color:#5f5f5f;line-height:1.65;margin:6px 2px 0}
.cbox{width:16px;height:16px;border:1.5px solid #CBB8A6;border-radius:4px;flex:0 0 auto;margin-top:1px;
  display:grid;place-items:center;font-size:10px;color:#fff;background:#fff;cursor:pointer}
.cbox.on{background:var(--red);border-color:var(--red)}
.consent a{color:var(--red);text-decoration:none}
.tips{display:flex;justify-content:center;gap:14px;font-size:10px;color:#A2917F;margin-top:14px}
.privacy{margin-top:16px;background:#FBF2EA;border-radius:12px;padding:12px 14px;font-size:10.5px;
  color:#8A7360;line-height:1.7}

/* ---------- generating ---------- */
#s-gen{background:var(--cream);color:var(--ink)}
.gen-page{flex:1;display:flex;flex-direction:column;
  padding:calc(env(safe-area-inset-top) + 26px) 24px calc(env(safe-area-inset-bottom) + 16px)}
.gen-head{max-width:340px}
.gen-kicker{font-size:9.5px;letter-spacing:.22em;color:#B08A5A;margin-bottom:8px}
.gen-title{font-family:var(--serif);font-size:21px;line-height:1.35;margin:0 0 6px;
  font-weight:700;color:#201A14}
.gen-stage{font-size:11.5px;color:#8C7B69;letter-spacing:.02em;min-height:17px}
.gen-frame-wrap{display:flex;justify-content:center;padding:18px 0 0}
.gen-frame{position:relative;height:min(56vh,520px);aspect-ratio:9/16;border-radius:20px;
  background:radial-gradient(120% 95% at 50% 42%,#FFFDF9 0%,#FDF6EB 68%,#F7EDDF 100%);
  border:1px solid #EADCCB;box-shadow:0 18px 44px rgba(120,90,50,.12);
  overflow:hidden;isolation:isolate}
#genCanvas{position:absolute;inset:0;width:100%;height:100%;transition:opacity .45s ease}
#genImage{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;
  transform:scale(1.02);transition:opacity .5s ease,transform .7s cubic-bezier(.2,.8,.2,1)}
.gen-frame.done #genCanvas{opacity:0}
.gen-frame.done #genImage{opacity:1;transform:none}
.gen-frame.failed #genCanvas{opacity:.16;filter:grayscale(1)}
.gen-fail-note{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:10px;opacity:0;pointer-events:none;
  transition:opacity .3s ease;color:#B23A2E}
.gen-fail-note span{width:46px;height:46px;border-radius:50%;border:1.5px solid #E3B7AF;
  display:grid;place-items:center;font-size:22px;font-weight:700;background:#FFF7F5}
.gen-fail-note b{font-size:13px;font-weight:600;letter-spacing:.06em}
.gen-frame.failed .gen-fail-note{opacity:1}
.gen-pct{position:absolute;right:14px;bottom:14px;z-index:3;padding:7px 13px;border-radius:999px;
  background:#fff;border:1px solid #EFE2D2;box-shadow:0 6px 16px rgba(120,90,50,.14);
  font-size:12.5px;font-weight:700;color:#7A5B3E;letter-spacing:.02em;
  transition:color .3s,background .3s,border-color .3s}
.gen-frame.done .gen-pct{background:linear-gradient(135deg,#E8C46A,#C9A227);color:#fff;border-color:#C9A227}
.gen-frame.failed .gen-pct{color:#B23A2E;border-color:#E9BFB8}
.gen-tip{margin:14px auto 0;max-width:300px;min-height:32px;text-align:center;
  font-size:11px;line-height:1.7;color:#A2907C;letter-spacing:.02em;transition:opacity .5s ease}
.gen-tip.fade{opacity:0}
.gen-actions{display:none;justify-content:center;gap:12px;margin:6px 0 4px}
.gen-actions.on{display:flex}
.gen-actions.on + .gen-cancel{display:none}
.gen-actions .btn{width:auto;min-width:104px;height:40px;font-size:13px;box-shadow:none}
.gen-cancel{margin-top:auto;background:none;border:0;color:#A2907C;font-size:11px;padding:12px}
@media (max-height:700px){
  .gen-page{padding-top:calc(env(safe-area-inset-top) + 14px)}
  .gen-title{font-size:19px}
  .gen-frame{height:min(50vh,420px)}
  .gen-tip{min-height:26px}
}

/* ---------- poster ---------- */
#s-poster{background:var(--cream)}
.poster-body{flex:1;min-height:0;overflow-y:auto;padding:16px 20px 176px}
#poster{width:auto;max-width:100%;max-height:calc(100dvh - 268px);margin:0 auto;display:block;border-radius:12px;box-shadow:0 18px 44px rgba(90,55,20,.24)}
.poster-meta{text-align:center;font-size:10.5px;color:var(--muted);margin-top:12px;line-height:1.7}
.poster-actions{position:absolute;left:0;right:0;bottom:0;z-index:6;
  padding:12px 20px calc(env(safe-area-inset-bottom) + 14px);
  background:linear-gradient(180deg,rgba(253,248,242,0),rgba(253,248,242,.96) 30%,#FDF8F2 100%);
  display:flex;flex-direction:column;gap:9px}
.btn.ghost{background:#FFFDFA;border:1px solid #EFE0CF;color:#8A6B4E;box-shadow:none}
.linkbtn{background:none;border:0;color:#9A8C7E;font-size:11.5px;padding:2px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.poster-links{display:flex;align-items:center;justify-content:center;gap:10px}
.poster-links .dot{color:#C9BCA9;font-size:11px}
.wx-mask{position:absolute;inset:0;z-index:200;background:rgba(0,0,0,.66);display:none}
.wx-mask.on{display:block}
.wx-arrow{position:absolute;right:26px;top:12px;font-size:38px;color:#fff;line-height:1}
.wx-tip{position:absolute;right:20px;top:66px;text-align:right;color:#fff;font-size:14px;line-height:1.9}

/* ---------- thanks ---------- */
#s-thanks{background:linear-gradient(180deg,#FDF8F2,#F8EDE0);align-items:center;justify-content:center;padding:0 30px}
.thanks-tag{display:inline-block;margin-bottom:26px;font-size:13px;letter-spacing:.04em;
  color:#8E4A3C;background:rgba(196,22,28,.05);border:1px solid rgba(196,22,28,.12);
  border-radius:999px;padding:7px 15px;white-space:nowrap}
.thanks-c{display:flex;flex-direction:column;align-items:center;text-align:center;width:100%}
.tick{width:64px;height:64px;border-radius:50%;background:var(--red);display:grid;place-items:center;
  color:#fff;font-size:28px;box-shadow:0 12px 30px rgba(196,22,28,.32);margin-bottom:20px;
  animation:pop .5s cubic-bezier(.2,1.2,.3,1) both}
@keyframes pop{from{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}
#s-thanks h2{font-family:var(--serif);font-size:30px;margin:0 0 10px}
#s-thanks p{font-size:12.5px;color:#7d7166;line-height:1.8;margin:0 0 6px}
.thumb{width:104px;margin:20px 0 6px;border-radius:8px;box-shadow:0 8px 20px rgba(90,55,20,.2);display:block}
#s-thanks .mini{font-size:10.5px;color:#B3A395;margin-top:2px}
.thanks-actions{width:100%;margin-top:24px;display:flex;flex-direction:column;gap:10px}
.thanks-actions .btn{height:48px}
.foot{margin-top:22px;font-size:9.5px;color:#C0B2A4;letter-spacing:.08em}

/* ---------- toast & sheet ---------- */
#toast{position:absolute;left:50%;bottom:96px;transform:translate(-50%,10px);z-index:50;
  background:rgba(28,24,20,.92);color:#fff;font-size:11.5px;padding:9px 16px;border-radius:999px;
  opacity:0;pointer-events:none;transition:.25s;white-space:nowrap;max-width:86%}
#toast.on{opacity:1;transform:translate(-50%,0)}
.sheet{position:absolute;inset:0;z-index:60;display:none}
.sheet.on{display:block}
.sheet .mask{position:absolute;inset:0;background:rgba(20,16,12,.45);opacity:0;transition:.25s}
.sheet.on .mask{opacity:1}
.sheet .card{position:absolute;left:0;right:0;bottom:0;background:#fff;border-radius:20px 20px 0 0;
  padding:22px 22px calc(env(safe-area-inset-bottom) + 22px);transform:translateY(100%);
  transition:transform .3s cubic-bezier(.2,.8,.2,1);max-height:76%;overflow-y:auto}
.sheet.on .card{transform:none}
.sheet h4{font-size:15px;margin:0 0 12px}
.sheet p{font-size:11.5px;color:#5f5f5f;line-height:1.85;margin:0 0 8px}
.sheet .close{margin-top:14px;width:100%;height:44px;border-radius:12px;border:0;background:#F4EBE1;
  color:#6b5b4c;font-size:13px;font-weight:600}

/* 微信保存海报 */
.save-mask{position:absolute;inset:0;z-index:40;display:none;background:rgba(14,11,8,.8);backdrop-filter:blur(4px)}
.save-mask.on{display:grid;place-items:center;padding:24px}
.save-panel{display:flex;flex-direction:column;align-items:center;gap:12px;max-height:100%}
.save-panel img{max-height:68vh;max-width:100%;border-radius:10px;box-shadow:0 22px 60px rgba(0,0,0,.45);-webkit-touch-callout:default;pointer-events:auto}
.save-tip{color:#fff;font-size:12px;letter-spacing:.06em;opacity:.9}
