/* =====================================================================
   星愿 StarWish · 个性化生日祝福站
   样式系统：浅色应用外壳 + 自带美术风格的成片舞台
   ===================================================================== */

/* ---------- 1. 变量 ---------- */
:root{
  --bg:            #f7f5f2;
  --bg-soft:       #ffffff;
  --bg-sink:       #efece7;
  --line:          #e6e1da;
  --line-strong:   #d8d1c7;
  --text:          #26211d;
  --text-2:        #6b6259;
  --text-3:        #9c948a;
  --brand:         #e8547c;
  --brand-2:       #ff8a5b;
  --brand-soft:    #fdeef2;
  --violet:        #7c6cf0;
  --gold:          #d9a441;
  --teal:          #29a99a;
  --radius:        16px;
  --radius-lg:     24px;
  --shadow-sm:     0 1px 2px rgba(38,33,29,.05), 0 2px 8px rgba(38,33,29,.05);
  --shadow:        0 4px 14px rgba(38,33,29,.07), 0 12px 40px rgba(38,33,29,.06);
  --shadow-lg:     0 18px 60px rgba(38,33,29,.14);
  --font: "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei UI","Microsoft YaHei",
          -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,"Noto Sans SC",sans-serif;
  --font-hand: "Kaiti SC","STKaiti",KaiTi,"Songti SC",serif;
  --ease: cubic-bezier(.22,1,.36,1);
}

/* ---------- 2. 重置（移动端优先 + 微信内置浏览器兼容） ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ height:100%; -webkit-text-size-adjust:100%; text-size-adjust:100%; overflow-x:clip; }
body{
  margin:0; min-height:100%; font-family:var(--font); color:var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, #fdeef2 0%, transparent 60%),
    radial-gradient(900px 500px at 5% 0%, #eef0ff 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  overflow-x:clip; overscroll-behavior-y:none;
  -webkit-tap-highlight-color:transparent;
  text-rendering:optimizeLegibility;
}
/* 微信 / QQ 内置浏览器里长按选中会打断点按体验，仅正文允许选中 */
body{ -webkit-user-select:none; user-select:none; }
input,textarea,[contenteditable="true"]{ -webkit-user-select:text; user-select:text; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ -webkit-appearance:none; appearance:none; touch-action:manipulation; }
/* 16px 以下输入框在 iOS 上会触发自动放大，统一压住 */
@media (max-width:767.98px){
  input,select,textarea{ font-size:16px !important; }
}
h1,h2,h3,h4,p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }
img{ max-width:100%; display:block; }
img[data-src]{ background:var(--bg-sink); }
hr{ border:0; border-top:1px solid var(--line); margin:18px 0; }
::selection{ background:var(--brand); color:#fff; }
/* 横向滚动容器：iOS / 微信里滚动更跟手 */
.album-track,.agent-quick,.hero-tags,.stage-bar-mid,.chips,.share-grid,.tip-scroll{
  -webkit-overflow-scrolling:touch;
}
/* 微信 X5 内核不支持 backdrop-filter 时用不透明底兜底 */
@supports not ((backdrop-filter:blur(4px)) or (-webkit-backdrop-filter:blur(4px))){
  #topbar{ background:var(--bg); }
  .stage-bar{ background:var(--bg); }
  .voice-bar,.wall-note,.scene-btn,.album-item{ background:rgba(255,255,255,.14); }
}

/* ---------- 3. 特效层 ---------- */
#fx-layer{
  position:fixed; inset:0; width:100%; height:100%;
  pointer-events:none; z-index:60;
}

/* ---------- 4. 顶栏 ---------- */
#topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:12px max(20px,4vw);
  background:rgba(247,245,242,.82); backdrop-filter:blur(14px) saturate(1.4);
  border-bottom:1px solid var(--line);
}
.brand{ display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.brand .logo{ font-size:24px; filter:drop-shadow(0 3px 6px rgba(232,84,124,.3)); }
.brand-text{ display:flex; flex-direction:column; line-height:1.05; }
.brand-text b{ font-size:17px; letter-spacing:.06em; }
.brand-text em{ font-style:normal; font-size:10px; letter-spacing:.24em; color:var(--text-3); text-transform:uppercase; }
.topnav{ display:flex; align-items:center; gap:6px; }
.nav-btn{
  border:0; background:transparent; color:var(--text-2); cursor:pointer;
  padding:8px 12px; border-radius:10px; font-size:14px; transition:.2s var(--ease);
}
.nav-btn:hover{ background:var(--bg-sink); color:var(--text); }
.icon-btn{
  width:34px; height:34px; border-radius:10px; border:0; cursor:pointer;
  background:var(--bg-sink); color:var(--text-2); font-size:15px; transition:.2s;
}
.icon-btn:hover{ background:var(--line-strong); color:var(--text); }

/* ---------- 5. 屏幕切换 ---------- */
#app{ position:relative; }
.screen{ display:none; }
.screen.is-active{ display:block; animation:screenIn .5s var(--ease) both; }
@keyframes screenIn{ from{ opacity:0; transform:translateY(14px);} to{ opacity:1; transform:none;} }

/* ---------- 6. 按钮 ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid transparent; border-radius:999px; cursor:pointer;
  padding:10px 20px; font-size:14px; font-weight:600;
  transition:.22s var(--ease); white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn-lg{ padding:14px 30px; font-size:16px; }
.btn-sm{ padding:7px 14px; font-size:13px; }
.btn-primary{
  background:linear-gradient(120deg,var(--brand),var(--brand-2));
  color:#fff; box-shadow:0 8px 22px rgba(232,84,124,.32);
}
.btn-primary:hover{ box-shadow:0 12px 32px rgba(232,84,124,.42); transform:translateY(-1px); }
.btn-ghost{ background:var(--bg-soft); border-color:var(--line-strong); color:var(--text); }
.btn-ghost:hover{ background:var(--bg-sink); }
.btn-dark{ background:#2b2521; color:#fff; }
.btn-dark:hover{ background:#1c1815; }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.chip-btn{
  border:1px solid var(--line-strong); background:var(--bg-soft);
  border-radius:999px; padding:6px 14px; font-size:13px; cursor:pointer;
  color:var(--text-2); transition:.2s;
}
.chip-btn:hover{ border-color:var(--brand); color:var(--brand); }
.chip-btn.is-on{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand); }

/* ---------- 7. 首页 ---------- */
.hero{
  position:relative; max-width:940px; margin:0 auto;
  padding:clamp(48px,8vw,96px) 24px 32px; text-align:center;
}
.hero-glow{
  position:absolute; left:50%; top:0; width:760px; max-width:100vw; height:420px; transform:translateX(-50%);
  background:radial-gradient(closest-side,rgba(232,84,124,.20),transparent 70%);
  filter:blur(20px); pointer-events:none; z-index:-1; overflow:hidden;
}
.hero-kicker{
  display:inline-block; font-size:12px; letter-spacing:.2em; color:var(--brand);
  background:var(--brand-soft); border:1px solid rgba(232,84,124,.22);
  padding:6px 16px; border-radius:999px; margin-bottom:22px;
}
.hero-title{
  font-size:clamp(30px,5.4vw,56px); line-height:1.24; letter-spacing:-.01em;
  font-weight:800; margin-bottom:20px;
}
.hero-title .grad{
  background:linear-gradient(100deg,var(--brand) 0%,var(--brand-2) 45%,var(--gold) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero-sub{ max-width:640px; margin:0 auto 32px; color:var(--text-2); font-size:16px; line-height:1.8; }
.hero-cta{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.hero-tags{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:38px;
}
.hero-tags li{
  font-size:13px; color:var(--text-2); background:var(--bg-soft);
  border:1px solid var(--line); padding:7px 15px; border-radius:999px; box-shadow:var(--shadow-sm);
}

.mode-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
  gap:24px; max-width:1080px; margin:24px auto 0; padding:0 24px;
}
.mode-card{
  position:relative; overflow:hidden; cursor:pointer;
  background:var(--bg-soft); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:26px; box-shadow:var(--shadow);
  transition:.32s var(--ease);
}
.mode-card::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  border:2px solid transparent; transition:.3s;
}
.mode-card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-lg); }
.mode-card:hover::after{ border-color:rgba(232,84,124,.5); }
.mode-card.pet:hover::after{ border-color:rgba(124,108,240,.5); }
.mode-visual{
  height:120px; border-radius:var(--radius); margin-bottom:18px;
  display:flex; align-items:center; justify-content:center; gap:14px;
  overflow:hidden; position:relative;
}
.capsule-visual{ background:linear-gradient(135deg,#3a2f28,#6b5445); }
.capsule-visual .film{
  width:62px; height:74px; border-radius:6px; background:#e7d9c4;
  box-shadow:0 6px 18px rgba(0,0,0,.35); transform:rotate(-7deg);
  animation:floaty 4.6s ease-in-out infinite;
}
.capsule-visual .film:nth-child(2){ transform:rotate(4deg) scale(1.12); background:#f2e6d3; animation-delay:.6s; z-index:2; }
.capsule-visual .film:nth-child(3){ transform:rotate(9deg); animation-delay:1.1s; }
@keyframes floaty{ 0%,100%{ margin-top:0 } 50%{ margin-top:-8px } }
.pet-visual{ background:linear-gradient(135deg,#efe8ff,#ffe9ef); }
.pet-visual span{ font-size:32px; animation:pawFloat 4s ease-in-out infinite; }
.pet-visual span:nth-child(2){ animation-delay:.4s }
.pet-visual span:nth-child(3){ animation-delay:.8s }
.pet-visual span:nth-child(4){ animation-delay:1.2s; font-size:42px }
.pet-visual span:nth-child(5){ animation-delay:1.6s; font-size:42px }
@keyframes pawFloat{ 0%,100%{ transform:translateY(0) rotate(-6deg) } 50%{ transform:translateY(-10px) rotate(6deg) } }

.mode-card h3{ font-size:19px; margin-bottom:10px; }
.mode-card p{ color:var(--text-2); font-size:14px; line-height:1.75; }
.feature-list{ margin:16px 0 18px; display:grid; gap:8px; }
.feature-list li{ font-size:13px; color:var(--text-2); padding-left:20px; position:relative; }
.feature-list li::before{ content:"✓"; position:absolute; left:0; color:var(--teal); font-weight:700; }
.mode-go{ font-size:13px; font-weight:700; color:var(--brand); }
.mode-card.pet .mode-go{ color:var(--violet); }

.home-features{
  max-width:1080px; margin:56px auto 80px; padding:0 24px;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:18px;
}
.feat{ background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius); padding:20px; }
.feat i{ font-style:normal; font-size:22px; display:block; margin-bottom:10px; }
.feat h4{ font-size:15px; margin-bottom:8px; }
.feat p{ font-size:13px; color:var(--text-2); line-height:1.7; }

/* ---------- 8. 向导 ---------- */
.wizard{
  max-width:820px; margin:0 auto; padding:24px 20px 40px;
  display:flex; flex-direction:column; min-height:calc(100vh - 60px);
}
.wizard-head{
  display:flex; align-items:center; gap:16px; margin-bottom:20px;
  /* 向导较长，把头部（含进度条）钉在顶栏下方，滚动时始终可见 */
  position:sticky; top:calc(var(--topbar-h, 57px) + 8px); z-index:30;
  background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius);
  padding:12px 16px; box-shadow:var(--shadow-sm);
}
.wizard-meta{ flex:1; min-width:0; }
.wizard-meta b{ font-size:14px; display:block; margin-bottom:8px; }
.progress{ height:6px; background:var(--bg-sink); border-radius:999px; overflow:hidden; }
.progress i{
  display:block; height:100%; width:0%; border-radius:999px;
  background:linear-gradient(90deg,var(--brand),var(--brand-2)); transition:width .45s var(--ease);
}
.wz-step{ font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }

.chat{ flex:1; display:flex; flex-direction:column; gap:16px; padding:8px 2px 20px; }
.msg{ display:flex; gap:10px; align-items:flex-end; animation:msgIn .45s var(--ease) both; }
@keyframes msgIn{ from{ opacity:0; transform:translateY(12px) } to{ opacity:1; transform:none } }
.msg .avatar{
  width:34px; height:34px; flex:0 0 34px; border-radius:12px;
  display:grid; place-items:center; font-size:17px;
  background:linear-gradient(135deg,#ffe1ea,#ffe8d4); box-shadow:var(--shadow-sm);
}
.bubble{
  max-width:min(560px,78%); background:var(--bg-soft); border:1px solid var(--line);
  border-radius:16px 16px 16px 4px; padding:13px 16px; font-size:14.5px; line-height:1.75;
  box-shadow:var(--shadow-sm);
}
.bubble .tip{ display:block; margin-top:8px; font-size:12.5px; color:var(--text-3); }
.msg.me{ flex-direction:row-reverse; }
.msg.me .bubble{
  background:linear-gradient(120deg,var(--brand),var(--brand-2)); color:#fff;
  border-color:transparent; border-radius:16px 16px 4px 16px;
}
.msg.me .avatar{ background:#2b2521; color:#fff; }
.msg.sys .bubble{ background:var(--bg-sink); border-style:dashed; }

.composer{
  position:sticky; bottom:0; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px; box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:12px;
}
/* 批2返工①：四屏表单态不能 sticky —— 表单比视口高时 sticky 会把上半截钉死在视口外，
   无法滚到。表单态改 static 让页面自然滚动。 */
#composer.is-form{ position:static; box-shadow:none; }
.chips{ display:flex; flex-wrap:wrap; gap:9px; }
.chip{
  border:1px solid var(--line-strong); background:var(--bg); border-radius:999px;
  padding:9px 16px; font-size:13.5px; cursor:pointer; transition:.2s var(--ease);
  display:inline-flex; align-items:center; gap:6px;
}
.chip:hover{ border-color:var(--brand); color:var(--brand); background:var(--brand-soft); transform:translateY(-1px); }
.chip.is-on{ background:var(--brand); color:#fff; border-color:var(--brand); }
.chip .emo{ font-size:15px; }
.input-row{ display:flex; gap:10px; align-items:center; }
.input-row input[type=text],.input-row input[type=date],.input-row input[type=number],.input-row textarea,.input-row select{
  flex:1; min-width:0; border:1px solid var(--line-strong); background:var(--bg);
  border-radius:12px; padding:12px 14px; font-size:14px; outline:none; transition:.2s;
}
.input-row textarea{ resize:vertical; min-height:84px; line-height:1.7; }
.input-row input:focus,.input-row textarea:focus,.input-row select:focus{
  border-color:var(--brand); box-shadow:0 0 0 4px rgba(232,84,124,.12); background:#fff;
}
.composer .hint{ font-size:12px; color:var(--text-3); }
/* 批2 · 向导 4 屏表单（屏1 档案）
   width:100% 必须带：composer 是纵向 flex，margin:auto 会取消子项默认拉伸，表单会缩成内容宽 */
.wz-form{ display:grid; gap:12px; width:100%; max-width:600px; margin:0 auto; }
.wz-field{ display:grid; gap:6px; }
.wz-label{ font-size:12.5px; font-weight:600; color:var(--text-2); letter-spacing:.3px; }
.wz-field .input-row{ margin:0; }
.wz-field .hint{ font-size:12px; }
.upload-drop{
  border:1.5px dashed var(--line-strong); border-radius:14px; padding:20px;
  text-align:center; cursor:pointer; background:var(--bg); transition:.2s;
}
.upload-drop:hover{ border-color:var(--brand); background:var(--brand-soft); }
.upload-drop b{ display:block; margin-bottom:4px; font-size:14px; }
.upload-drop span{ font-size:12.5px; color:var(--text-3); }
.preview-grid{ display:flex; flex-wrap:wrap; gap:10px; }
.preview-grid .ph{
  width:78px; height:78px; border-radius:12px; overflow:hidden; position:relative;
  border:1px solid var(--line); background:var(--bg-sink);
}
.preview-grid .ph img{ width:100%; height:100%; object-fit:cover; }
.preview-grid .ph button{
  position:absolute; top:2px; right:2px; width:20px; height:20px; border-radius:50%;
  border:0; background:rgba(0,0,0,.6); color:#fff; font-size:11px; cursor:pointer; line-height:1;
}
.preview-grid .ph .tag{
  position:absolute; left:0; right:0; bottom:0; font-size:10px; color:#fff;
  background:rgba(0,0,0,.55); text-align:center; padding:2px 0;
}
.rec-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.rec-dot{ width:10px; height:10px; border-radius:50%; background:#e5484d; }
.rec-dot.is-live{ animation:blink 1s infinite; }
@keyframes blink{ 0%,100%{ opacity:1 } 50%{ opacity:.25 } }
.wish-cards{ display:grid; gap:10px; }
.wish-card{
  text-align:left; border:1px solid var(--line); background:var(--bg); border-radius:14px;
  padding:14px 16px; cursor:pointer; font-size:14px; line-height:1.8; transition:.2s var(--ease);
}
.wish-card:hover{ border-color:var(--brand); background:var(--brand-soft); transform:translateX(3px); }
.wish-card.is-on{ border-color:var(--brand); background:var(--brand-soft); box-shadow:0 0 0 3px rgba(232,84,124,.12); }

/* ---------- 9. 成片舞台 ---------- */
#screen-stage{ padding-bottom:40px; }
.stage-bar{
  position:sticky; top:57px; z-index:30;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px max(16px,4vw);
  background:rgba(247,245,242,.88); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.stage-bar-mid{ display:flex; gap:8px; }
#stage{ max-width:1060px; margin:20px auto 0; padding:0 16px; }

/* ---------- 10. 抽屉 / 弹窗 / Toast ---------- */
.drawer{
  position:fixed; top:0; right:0; height:100%; width:min(420px,92vw); z-index:80;
  background:var(--bg-soft); border-left:1px solid var(--line);
  box-shadow:-20px 0 60px rgba(38,33,29,.14);
  transform:translateX(102%); transition:transform .42s var(--ease);
  display:flex; flex-direction:column;
}
.drawer.is-open{ transform:none; }
.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px; border-bottom:1px solid var(--line);
}
.drawer-body{ padding:20px; overflow:auto; display:grid; gap:14px; }
.field{ display:grid; gap:7px; }
.field span{ font-size:12.5px; color:var(--text-2); }
.field input{
  border:1px solid var(--line-strong); border-radius:11px; padding:11px 13px;
  font-size:13.5px; background:var(--bg); outline:none; transition:.2s;
}
.field input:focus{ border-color:var(--brand); background:#fff; }
.drawer-actions{ display:flex; gap:10px; }
.hint{ font-size:12.5px; color:var(--text-3); line-height:1.7; }
.hint.tiny{ font-size:11.5px; }
.mask{
  position:fixed; inset:0; background:rgba(38,33,29,.4); backdrop-filter:blur(3px);
  z-index:70; opacity:0; pointer-events:none; transition:.3s;
}
.mask.is-open{ opacity:1; pointer-events:auto; }

.modal{
  position:fixed; inset:0; z-index:90; display:grid; place-items:center; padding:20px;
  background:rgba(38,33,29,.5); backdrop-filter:blur(6px);
  animation:fadeIn .28s ease both; overflow:auto;
}
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }
.modal-box{
  background:var(--bg-soft); border-radius:var(--radius-lg); width:min(680px,100%);
  max-height:88vh; overflow:auto; box-shadow:var(--shadow-lg);
  animation:popIn .42s var(--ease) both;
}
.modal-box.wide{ width:min(920px,100%); }
@keyframes popIn{ from{ opacity:0; transform:translateY(24px) scale(.97) } to{ opacity:1; transform:none } }
.modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:20px 22px; border-bottom:1px solid var(--line); position:sticky; top:0;
  background:var(--bg-soft); z-index:2; border-radius:var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-head b{ font-size:16px; }
.modal-body{ padding:22px; display:grid; gap:16px; }
.modal-foot{ padding:16px 22px; border-top:1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }

/* 弹窗打开时，隐藏页面上固定的浮动按钮，避免压住弹窗底部内容 */
body.has-modal .music-cta,
body.has-modal .share-cta,
body.has-modal .agent-fab,
body.has-modal .agent-tease{ display:none !important; }

/* 强提示条（微信里「长按保存」这类必须看到的说明） */
.tip-callout{
  display:flex; gap:10px; align-items:flex-start;
  background:linear-gradient(120deg,rgba(232,84,124,.14),rgba(255,167,89,.16));
  border:1px solid rgba(232,84,124,.38); border-radius:14px;
  padding:12px 14px; font-size:14px; line-height:1.65; color:var(--text); font-weight:600;
}
.tip-callout-ico{ font-size:18px; line-height:1.2; flex:none; }
.tip-callout b{ color:var(--brand); }
.tip-callout .sub{ display:block; margin-top:4px; font-size:12.5px; font-weight:400; color:var(--text-2); }

#toast-wrap{ position:fixed; left:50%; bottom:32px; transform:translateX(-50%); z-index:120; display:grid; gap:8px; justify-items:center; }
.toast{
  background:#2b2521; color:#fff; font-size:13.5px; padding:11px 20px; border-radius:999px;
  box-shadow:var(--shadow-lg); animation:toastIn .35s var(--ease) both;
}
@keyframes toastIn{ from{ opacity:0; transform:translateY(14px) } to{ opacity:1; transform:none } }

/* ---------- 11. 作品列表 ---------- */
.proj-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; }
.proj-card{
  border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--bg);
  cursor:pointer; transition:.24s var(--ease);
}
.proj-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--line-strong); }
.proj-thumb{ height:104px; background:linear-gradient(120deg,#3a2f28,#6b5445); position:relative; }
.proj-thumb img{ width:100%; height:100%; object-fit:cover; }
.proj-body{ padding:12px 14px; }
.proj-body b{ font-size:14px; display:block; margin-bottom:4px; }
.proj-body span{ font-size:11.5px; color:var(--text-3); }
.proj-del{ position:absolute; top:6px; right:6px; z-index:2; }

/* ---------- 12. 成片渲染：通用舞台（独立美术风格）---------- */
.scene{
  --scene-bg1:#1b1633; --scene-bg2:#3a1f3d; --scene-accent:#ffd36e;
  position:relative; width:100%; aspect-ratio:16/10; min-height:520px;
  border-radius:var(--radius-lg); overflow:hidden; color:#fff;
  background:radial-gradient(120% 100% at 50% 0%,var(--scene-bg2),var(--scene-bg1) 70%);
  box-shadow:var(--shadow-lg); font-family:var(--font);
}
.scene.theme-warm{ --scene-bg1:#2b1a2e; --scene-bg2:#6d2f45; --scene-accent:#ffd98a; }
.scene.theme-funny{ --scene-bg1:#12314a; --scene-bg2:#0c6b73; --scene-accent:#ffe066; }
.scene.theme-literary{ --scene-bg1:#101c2c; --scene-bg2:#2c4a5e; --scene-accent:#cfe7ff; }
.scene.theme-retro{ --scene-bg1:#241408; --scene-bg2:#6b3d16; --scene-accent:#f0c178; }
.scene.theme-pet-cat{ --scene-bg1:#1c1636; --scene-bg2:#4a2b6b; --scene-accent:#ffb3d9; }
.scene.theme-pet-dog{ --scene-bg1:#17303a; --scene-bg2:#2f6d5e; --scene-accent:#ffd88a; }
.scene.is-film::after{
  content:""; position:absolute; inset:0; pointer-events:none; z-index:5;
  background:
    repeating-linear-gradient(0deg,rgba(0,0,0,.10) 0 1px,transparent 1px 3px),
    radial-gradient(120% 90% at 50% 50%,transparent 45%,rgba(0,0,0,.55) 100%);
  mix-blend-mode:multiply; opacity:.55;
}
.scene-stars{ position:absolute; inset:0; z-index:1; }
.scene-inner{
  position:relative; z-index:6; height:100%; min-height:520px;
  display:flex; flex-direction:column; padding:clamp(24px,4vw,48px);
  overflow-y:auto; overflow-x:hidden;
}
.scene-hero{ flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:18px; padding:20px 0; }
.scene-kicker{
  font-size:12px; letter-spacing:.34em; text-transform:uppercase; opacity:.66;
}
.scene-name{
  font-size:clamp(34px,6.6vw,68px); font-weight:800; line-height:1.1; letter-spacing:-.01em;
  text-shadow:0 6px 40px rgba(0,0,0,.4);
}
.scene-name .hl{
  background:linear-gradient(100deg,var(--scene-accent),#fff 60%,var(--scene-accent));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.scene-relation{ font-size:13.5px; opacity:.72; letter-spacing:.1em; }
.scene-msg{
  max-width:640px; font-size:clamp(15px,1.5vw,18px); line-height:2; opacity:.95;
  white-space:pre-wrap; text-shadow:0 2px 20px rgba(0,0,0,.35);
}
.scene-msg .caret{ display:inline-block; width:2px; height:1em; background:var(--scene-accent); vertical-align:-2px; animation:blink 1s steps(1) infinite; }
.scene-meta{ display:flex; gap:14px; flex-wrap:wrap; justify-content:center; font-size:12.5px; opacity:.7; }
.scene-photo{
  width:clamp(130px,20vw,200px); height:clamp(130px,20vw,200px); border-radius:50%;
  overflow:hidden; border:4px solid rgba(255,255,255,.28); position:relative;
  box-shadow:0 20px 60px rgba(0,0,0,.45);
}
.scene-photo img{ width:100%; height:100%; object-fit:cover; }
.scene-photo.has-hat::after{
  content:"🎉"; position:absolute; top:-26px; left:50%; transform:translateX(-50%) rotate(-14deg);
  font-size:38px; filter:drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.scene-photo.film-frame{ border-radius:8px; width:clamp(180px,28vw,300px); height:clamp(130px,20vw,220px); border:8px solid #f4ead6; }
.scene-photo.film-frame img{ filter:sepia(.42) saturate(.9) contrast(1.05); }

.scene-cake{ display:grid; place-items:center; }
.scene-hint{ font-size:12.5px; opacity:.6; letter-spacing:.06em; }

/* 相册时间线 */
.scene-album{ width:100%; max-width:760px; }
.album-track{
  display:flex; gap:18px; overflow-x:auto; padding:10px 4px 20px;
  scroll-snap-type:x mandatory; scrollbar-width:thin;
}
.album-track::-webkit-scrollbar{ height:6px; }
.album-track::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.26); border-radius:9px; }
.album-item{
  scroll-snap-align:center; flex:0 0 auto; width:min(280px,72vw);
  border-radius:14px; overflow:hidden; background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16); backdrop-filter:blur(6px);
  transform:scale(.94); opacity:.6; transition:.5s var(--ease);
}
.album-item.is-focus{ transform:scale(1); opacity:1; box-shadow:0 20px 50px rgba(0,0,0,.45); }
.album-item .pic{ height:180px; overflow:hidden; background:#000; }
.album-item .pic img{ width:100%; height:100%; object-fit:cover; transition:transform 6s linear; }
.album-item.is-focus .pic img{ transform:scale(1.1); }
.album-item.film .pic img{ filter:sepia(.4) contrast(1.06) saturate(.92); }
.album-item .cap{ padding:10px 12px; font-size:12.5px; opacity:.9; display:flex; justify-content:space-between; gap:8px; }
.album-item .cap em{ font-style:normal; opacity:.62; }

/* 时光胶囊结尾弹窗 */
.capsule-pop{
  position:absolute; inset:0; z-index:20; display:grid; place-items:center; padding:24px;
  background:radial-gradient(closest-side,rgba(0,0,0,.55),rgba(0,0,0,.82));
  opacity:0; pointer-events:none; transition:opacity .7s var(--ease);
}
.capsule-pop.is-show{ opacity:1; pointer-events:auto; }
.capsule-paper{
  max-width:560px; width:100%; background:#f7edd9; color:#3b2d1d;
  border-radius:10px; padding:clamp(24px,4vw,40px); position:relative;
  box-shadow:0 30px 80px rgba(0,0,0,.6); transform:translateY(24px) scale(.96);
  transition:transform .8s var(--ease);
  background-image:repeating-linear-gradient(0deg,rgba(120,90,50,.05) 0 1px,transparent 1px 26px);
}
.capsule-pop.is-show .capsule-paper{ transform:none; }
.capsule-paper::before{
  content:""; position:absolute; top:-14px; left:50%; transform:translateX(-50%) rotate(-3deg);
  width:120px; height:28px; background:rgba(255,255,255,.6); border:1px solid rgba(0,0,0,.05);
}
.capsule-paper h3{ font-family:var(--font-hand); font-size:24px; margin-bottom:14px; }
.capsule-paper p{ font-family:var(--font-hand); font-size:17px; line-height:2.1; white-space:pre-wrap; }
.capsule-paper .sign{ margin-top:18px; text-align:right; font-family:var(--font-hand); font-size:15px; opacity:.75; }

/* 祝福墙 */
.wall{ width:100%; max-width:820px; }
.wall-title{ font-size:15px; letter-spacing:.16em; opacity:.72; margin-bottom:14px; text-align:center; }
.wall-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
.wall-note{
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
  border-radius:14px; padding:14px; backdrop-filter:blur(8px);
  transform:rotate(var(--rot,0deg)); transition:.3s var(--ease);
  animation:noteIn .6s var(--ease) both;
}
@keyframes noteIn{ from{ opacity:0; transform:translateY(16px) rotate(0deg) } to{ opacity:1 } }
.wall-note:hover{ transform:rotate(0) translateY(-4px); background:rgba(255,255,255,.15); }
.wall-note b{ display:block; font-size:12.5px; margin-bottom:6px; color:var(--scene-accent); }
.wall-note p{ font-size:13px; line-height:1.8; opacity:.95; white-space:pre-wrap; }

/* 语音条 */
.voice-bar{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.18);
  border-radius:999px; padding:10px 18px; backdrop-filter:blur(8px);
}
.voice-play{
  width:40px; height:40px; border-radius:50%; border:0; cursor:pointer; font-size:16px;
  background:var(--scene-accent); color:#2b1a12; display:grid; place-items:center; transition:.2s;
}
.voice-play:hover{ transform:scale(1.08); }
.voice-wave{ display:flex; align-items:center; gap:3px; height:26px; }
.voice-wave i{ display:block; width:3px; border-radius:9px; background:rgba(255,255,255,.5); }
.voice-wave.is-live i{ animation:wave .9s ease-in-out infinite; background:var(--scene-accent); }
@keyframes wave{ 0%,100%{ transform:scaleY(.4) } 50%{ transform:scaleY(1) } }
.voice-tip{ font-size:12.5px; opacity:.78; }

/* AI 插画 */
.scene-art{ width:100%; max-width:520px; }
.scene-art img{ width:100%; border-radius:16px; box-shadow:0 24px 60px rgba(0,0,0,.5); }
.art-loading{
  display:grid; place-items:center; gap:12px; padding:34px;
  border:1px dashed rgba(255,255,255,.3); border-radius:16px; text-align:center;
}
.spinner{
  width:26px; height:26px; border-radius:50%; border:3px solid rgba(255,255,255,.25);
  border-top-color:var(--scene-accent); animation:spin .9s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg) } }

/* 场景底部操作 */
.scene-actions{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top:18px; }
.scene-btn{
  border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.1); color:#fff;
  border-radius:999px; padding:10px 20px; font-size:13.5px; cursor:pointer; transition:.22s;
  backdrop-filter:blur(6px);
}
.scene-btn:hover{ background:rgba(255,255,255,.2); transform:translateY(-1px); }
.scene-btn.strong{ background:var(--scene-accent); color:#2b1a12; border-color:transparent; font-weight:700; }

/* ---------- 13. 海报 & 分享 ---------- */
.poster-wrap{ display:grid; place-items:center; gap:14px; }
.poster-wrap img{ max-height:58vh; border-radius:12px; box-shadow:var(--shadow-lg); }
.share-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px; }
.share-item{
  border:1px solid var(--line); background:var(--bg); border-radius:14px; padding:16px 10px;
  text-align:center; cursor:pointer; transition:.2s var(--ease); font-size:12.5px;
}
.share-item:hover{ transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--line-strong); }
.share-item i{ font-style:normal; display:block; font-size:24px; margin-bottom:8px; }
.link-row{ display:flex; gap:8px; }
.link-row input{
  flex:1; min-width:0; border:1px solid var(--line-strong); border-radius:11px;
  padding:11px 13px; font-size:12.5px; background:var(--bg); color:var(--text-2); outline:none;
}
/* 分享面板二维码 */
.qr-box{ display:flex; gap:16px; align-items:center; justify-content:center; margin:10px 0 4px; flex-wrap:wrap; }
.qr-box canvas{ border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:var(--shadow-sm); max-width:100%; height:auto; }
.qr-side{ max-width:260px; text-align:left; }
.code-box{
  width:100%; border:1px solid var(--line-strong); border-radius:12px; padding:12px;
  font-family:ui-monospace,Menlo,Consolas,monospace; font-size:11.5px; line-height:1.6;
  background:var(--bg); resize:vertical; min-height:96px; word-break:break-all;
}
.steps{ font-size:13px; color:var(--text-2); line-height:1.9; padding-left:18px; list-style:decimal; }
.steps li{ margin-bottom:6px; }

/* ---------- 14. 打印 ---------- */
@media print{ #topbar,.stage-bar,.drawer,.mask,#fx-layer{ display:none !important; } }

/* ---------- 15. 响应式（移动端优先） ---------- */
/* 顶部条高度由 JS 写入，避免写死像素导致移动端错位 */
#topbar{ padding-top:calc(12px + env(safe-area-inset-top,0px)); }
.stage-bar{ top:var(--topbar-h,57px); }
.toast-wrap-safe{ padding-bottom:env(safe-area-inset-bottom,0px); }
#toast-wrap{ bottom:calc(32px + env(safe-area-inset-bottom,0px)); }

@media (max-width:767.98px){
  body{ font-size:15px; }
  .brand-text em{ display:none; }
  .topnav .nav-btn{ padding:8px 9px; font-size:13px; }
  .stage-bar{ flex-wrap:wrap; padding:8px 12px; row-gap:8px; }
  .stage-bar-mid{ flex:1 1 100%; order:3; overflow-x:auto; padding-bottom:2px; }
  .scene{ aspect-ratio:auto; min-height:auto; }
  .modal{ padding:0; align-items:flex-end; }
  .modal-box{ max-height:94vh; border-radius:20px 20px 0 0; width:100%; }
  .modal-box.wide{ width:100%; }
  .modal-head{ border-radius:20px 20px 0 0; }
  .hero{ padding:clamp(32px,9vw,56px) 18px 24px; }
  .hero-sub{ font-size:15px; line-height:1.85; }
  .hero-tags{ margin-top:26px; gap:8px; }
  .hero-tags li{ font-size:12.5px; padding:6px 12px; }
  .hero-cta{ gap:10px; }
  .hero-cta .btn{ width:100%; }
  .mode-grid{ grid-template-columns:1fr; padding:0 16px; gap:16px; }
  .home-features{ grid-template-columns:1fr 1fr; gap:12px; padding:0 16px; margin-bottom:64px; }
  .feat{ padding:15px; }
  .feat p{ font-size:12.5px; }
  .wizard{ padding:16px 14px calc(28px + env(safe-area-inset-bottom,0px)); min-height:calc(100vh - 60px); }
  .wizard-head{ gap:10px; padding:10px 12px; margin-bottom:14px; }
  .wizard-head .btn{ padding:6px 10px; }
  .wizard-meta b{ font-size:13px; }
  .chat .bubble{ max-width:88%; font-size:14.5px; line-height:1.8; }
  .msg .avatar{ width:30px; height:30px; flex:0 0 30px; border-radius:10px; font-size:15px; }
  .composer{ padding:12px; gap:10px; }
  .chip{ padding:9px 14px; font-size:13.5px; }
  .input-row{ flex-wrap:wrap; }
  .input-row input[type=text],.input-row input[type=date],.input-row input[type=number],.input-row select{ width:100%; }
  .input-row .btn{ flex:1 1 auto; }
  .drawer{ width:min(440px,96vw); }
  .scene-inner{ min-height:auto; padding:22px 16px; }
  .scene-name{ font-size:clamp(30px,9vw,46px); }
  .scene-msg{ font-size:15.5px; line-height:1.95; }
  .scene-photo{ width:clamp(120px,38vw,170px); height:clamp(120px,38vw,170px); }
  .scene-photo.film-frame{ width:min(80vw,260px); height:auto; aspect-ratio:4/3; }
  .album-item{ width:min(230px,78vw); }
  .album-item .pic{ height:150px; }
  .capsule-paper{ padding:22px 18px; }
  .capsule-paper h3{ font-size:20px; }
  .capsule-paper p{ font-size:16px; line-height:2; }
  .wall-grid{ grid-template-columns:1fr 1fr; gap:10px; }
  .voice-bar{ padding:9px 14px; gap:9px; }
  .scene-btn{ padding:9px 16px; font-size:13px; }
  .share-grid{ grid-template-columns:repeat(3,1fr); gap:9px; }
  .share-item{ padding:12px 6px; font-size:11.5px; }
  .share-item i{ font-size:20px; }
  .link-row{ flex-wrap:wrap; }
  .link-row input{ width:100%; }
  .proj-grid{ grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); }
  #stage{ padding:0 10px; }
}
@media (max-width:380px){
  .home-features{ grid-template-columns:1fr; }
  .wall-grid{ grid-template-columns:1fr; }
  .share-grid{ grid-template-columns:repeat(2,1fr); }
}
/* 微信内置浏览器：标签栏 / 工具栏会吃掉高度，用 dvh 更准 */
@media (max-width:767.98px){
  @supports (height:100dvh){
    .wizard{ min-height:calc(100dvh - 60px); }
    .agent{ height:min(72dvh,560px); }
    .modal-box{ max-height:92dvh; }
  }
}
@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
  .scene-stars,#fx-layer{ display:none !important; }
}

/* ---------- 16. 智能体：小愿 ---------- */
.agent-fab{
  position:fixed; right:22px; bottom:22px; z-index:79;
  width:58px; height:58px; border:0; border-radius:50%; cursor:pointer;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff; display:grid; place-items:center;
  box-shadow:0 12px 30px rgba(232,84,124,.42);
  transition:.3s var(--ease);
}
.agent-fab:hover{ transform:translateY(-3px) scale(1.04); box-shadow:0 18px 40px rgba(232,84,124,.5); }
.agent-fab.is-active{ transform:scale(.9); }
.agent-fab-ico{ font-size:26px; line-height:1; position:relative; z-index:1; }
.agent-fab-ring{
  position:absolute; inset:-6px; border-radius:50%;
  border:2px solid rgba(232,84,124,.45); animation:fabPulse 2.6s var(--ease) infinite;
}
.agent-fab.is-active .agent-fab-ring{ display:none; }
@keyframes fabPulse{ 0%{ transform:scale(.86); opacity:.9 } 70%{ transform:scale(1.16); opacity:0 } 100%{ opacity:0 } }
.agent-fab-dot{
  position:absolute; top:3px; right:3px; width:12px; height:12px; border-radius:50%;
  background:#fff; border:2.5px solid var(--brand); opacity:0; transform:scale(.4);
  transition:.3s var(--ease);
}
.agent-fab-dot.is-show{ opacity:1; transform:none; }

.agent-tease{
  position:fixed; right:22px; bottom:92px; z-index:79; width:min(258px,74vw);
  background:var(--bg-soft); border:1px solid var(--line);
  border-radius:16px 16px 4px 16px; padding:14px 16px;
  box-shadow:var(--shadow-lg); cursor:pointer;
  opacity:0; transform:translateY(10px) scale(.96); pointer-events:none;
  transition:.4s var(--ease);
}
.agent-tease.is-show{ opacity:1; transform:none; pointer-events:auto; }
.agent-tease b{ display:block; font-size:13.5px; margin-bottom:5px; }
.agent-tease span{ font-size:12.5px; color:var(--text-2); line-height:1.7; }
.agent-tease-x{
  position:absolute; top:6px; right:7px; border:0; background:transparent; cursor:pointer;
  color:var(--text-3); font-size:15px; line-height:1; padding:2px 6px; border-radius:6px;
}
.agent-tease-x:hover{ background:var(--bg-sink); color:var(--text); }

.agent{
  position:fixed; right:22px; bottom:92px; z-index:78;
  width:min(392px,92vw); height:min(640px,calc(100vh - 128px));
  background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg); display:flex; flex-direction:column; overflow:hidden;
  opacity:0; transform:translateY(16px) scale(.97); pointer-events:none;
  transition:.36s var(--ease);
}
.agent.is-open{ opacity:1; transform:none; pointer-events:auto; }

.agent-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px; border-bottom:1px solid var(--line);
  background:linear-gradient(120deg,#fdeef2,#fff3ea);
}
.agent-who{ display:flex; align-items:center; gap:10px; min-width:0; }
.agent-ava{
  width:36px; height:36px; flex:0 0 36px; border-radius:12px; display:grid; place-items:center;
  font-size:19px; background:#fff; box-shadow:var(--shadow-sm);
}
.agent-who-txt{ min-width:0; }
.agent-who-txt b{ display:block; font-size:14px; line-height:1.3; }
.agent-who-txt em{ font-style:normal; font-size:11px; color:var(--text-3); }
.agent-head-btns{ display:flex; gap:6px; }

.agent-body{ flex:1; overflow-y:auto; padding:16px 14px 8px; display:flex; flex-direction:column; gap:12px; }
.am{ display:flex; gap:8px; align-items:flex-start; animation:msgIn .4s var(--ease) both; }
.am-av{
  width:28px; height:28px; flex:0 0 28px; border-radius:10px; display:grid; place-items:center;
  font-size:15px; background:var(--bg-sink);
}
.am-b{
  max-width:82%; background:var(--bg); border:1px solid var(--line);
  border-radius:14px 14px 14px 4px; padding:11px 13px; font-size:13.5px; line-height:1.8;
  white-space:pre-wrap; word-break:break-word;
}
.am.me{ flex-direction:row-reverse; }
.am.me .am-b{
  background:linear-gradient(120deg,var(--brand),var(--brand-2)); color:#fff;
  border-color:transparent; border-radius:14px 14px 4px 14px;
}
.am.me .am-av{ background:#2b2521; color:#fff; }
.am.is-typing .am-b{ display:flex; gap:4px; align-items:center; padding:14px 15px; }
.am.is-typing .am-b i{
  width:6px; height:6px; border-radius:50%; background:var(--text-3); display:block;
  animation:amBlink 1.1s infinite ease-in-out;
}
.am.is-typing .am-b i:nth-child(2){ animation-delay:.16s }
.am.is-typing .am-b i:nth-child(3){ animation-delay:.32s }
@keyframes amBlink{ 0%,80%,100%{ opacity:.28; transform:translateY(0) } 40%{ opacity:1; transform:translateY(-3px) } }

.am-list{ margin:8px 0 4px; padding-left:18px; list-style:decimal; }
.am-list li{ margin-bottom:6px; font-size:13px; line-height:1.75; }
.am-acts{ display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.am-chip{
  border:1px solid var(--line-strong); background:var(--bg-soft); border-radius:999px;
  padding:6px 12px; font-size:12.5px; cursor:pointer; color:var(--text-2);
  transition:.2s var(--ease); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.am-chip:hover{ border-color:var(--brand); color:var(--brand); background:var(--brand-soft); transform:translateY(-1px); }

.agent-quick{
  display:flex; gap:7px; overflow-x:auto; padding:8px 14px 2px;
  border-top:1px solid var(--line); scrollbar-width:none;
}
.agent-quick::-webkit-scrollbar{ display:none; }
.am-quick{
  flex:0 0 auto; border:1px dashed var(--line-strong); background:var(--bg); color:var(--text-2);
  border-radius:999px; padding:6px 12px; font-size:12px; cursor:pointer; transition:.2s;
}
.am-quick:hover{ border-style:solid; border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }

.agent-composer{ display:flex; gap:8px; align-items:flex-end; padding:10px 14px; }
.agent-composer textarea{
  flex:1; min-width:0; border:1px solid var(--line-strong); background:var(--bg); border-radius:12px;
  padding:10px 12px; font-size:13.5px; line-height:1.6; outline:none; resize:none;
  max-height:96px; transition:.2s;
}
.agent-composer textarea:focus{ border-color:var(--brand); background:#fff; box-shadow:0 0 0 4px rgba(232,84,124,.1); }
.agent-foot{ margin:0; padding:0 14px 12px; font-size:11px; color:var(--text-3); text-align:center; }

@media print{ .agent,.agent-fab,.agent-tease{ display:none !important; } }
@media (max-width:767.98px){
  .agent-fab{ right:16px; bottom:16px; width:52px; height:52px; }
  .agent-fab-ico{ font-size:23px; }
  .agent-tease{ right:16px; bottom:84px; }
  .agent{ left:12px; right:12px; bottom:74px; width:auto; height:min(72vh,560px); }
  .am-b{ max-width:86%; }
}

/* ---------- 17. 分段选择器（动画档位 / 通用） ---------- */
.seg{
  display:flex; gap:4px; padding:4px; border-radius:12px;
  background:var(--bg-sink); border:1px solid var(--line);
}
.seg-btn{
  flex:1; border:0; background:transparent; cursor:pointer;
  padding:9px 6px; border-radius:9px; font-size:13px; font-weight:600;
  color:var(--text-2); transition:.2s var(--ease); white-space:nowrap;
}
.seg-btn:hover{ color:var(--text); }
.seg-btn.is-on{
  background:var(--bg-soft); color:var(--brand);
  box-shadow:var(--shadow-sm);
}

/* ---------- 18. 向导：制作 ⇄ 实时预览 ---------- */
.wz-tabs{
  display:flex; gap:4px; padding:4px; margin-bottom:16px;
  background:var(--bg-sink); border:1px solid var(--line); border-radius:14px;
}
.wz-tab{
  flex:1; border:0; background:transparent; cursor:pointer;
  padding:10px 8px; border-radius:11px; font-size:13.5px; font-weight:600;
  color:var(--text-2); transition:.2s var(--ease);
}
.wz-tab.is-on{ background:var(--bg-soft); color:var(--brand); box-shadow:var(--shadow-sm); }
.wz-preview{ display:none; }
#screen-wizard.is-preview .wz-preview{ display:block; animation:screenIn .35s var(--ease) both; }
#screen-wizard.is-preview .chat,
#screen-wizard.is-preview .composer{ display:none; }
.wz-preview-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  flex-wrap:wrap; margin-bottom:12px;
  font-size:12.5px; color:var(--text-3);
}
.wz-stage-holder{
  border:1px solid var(--line); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow);
  background:var(--bg-soft); padding:8px;
}
#wz-stage{ border-radius:18px; overflow:hidden; }
#wz-stage.is-empty::after{
  content:"还没填内容，先回到制作里写两句吧 ✍️";
  display:grid; place-items:center; min-height:180px;
  font-size:13.5px; color:var(--text-3);
}
#wz-stage .scene{ box-shadow:none; min-height:360px; }
@media (max-width:767.98px){
  #wz-stage .scene{ min-height:300px; }
}
/* 批6① · 桌面（≥768）实时预览固定 375×667 手机框居中：
   演示口径与真机一致，讲台/大屏上看到的预览就是手机上的样子 */
@media (min-width:768px){
  .wz-stage-holder{
    width:397px; margin:0 auto; padding:11px;
    background:#241d2b; border:1px solid #3a2f45;
    border-radius:42px; box-shadow:var(--shadow-lg), 0 18px 50px rgba(40,20,60,.28);
  }
  #wz-stage{ width:375px; height:667px; margin:0 auto; border-radius:31px; }
  #wz-stage .scene{
    width:375px; height:667px; min-height:0; aspect-ratio:auto; border-radius:31px;
  }
  /* 手机框内藏滚动条：真机是 overlay 滚动条，桌面框里露出来很出戏 */
  #wz-stage .scene-inner{ scrollbar-width:none; }
  #wz-stage .scene-inner::-webkit-scrollbar{ width:0; height:0; }
}

/* ---------- 19. 背景音乐开关（不自动播放） ---------- */
.music-cta{
  position:fixed; left:22px; bottom:22px; z-index:79;
  display:none; align-items:center; gap:10px;
  border:0; cursor:pointer; border-radius:999px;
  padding:13px 22px 13px 18px;
  font-size:14px; font-weight:700; color:#fff;
  background:linear-gradient(120deg,#7c6cf0,#e8547c);
  box-shadow:0 14px 34px rgba(124,108,240,.42), 0 0 0 0 rgba(124,108,240,.5);
  animation:musicPulse 2.2s var(--ease) infinite;
  transition:transform .22s var(--ease), opacity .3s;
}
.music-cta.is-show{ display:inline-flex; }
.music-cta:hover{ transform:translateY(-2px); }
.music-cta:active{ transform:scale(.97); }
.music-cta.is-on{
  animation:none; background:var(--bg-soft); color:var(--text);
  border:1px solid var(--line-strong); box-shadow:var(--shadow);
  padding:10px 18px 10px 15px; font-weight:600;
}
.music-cta-ico{ font-size:19px; line-height:1; }
.music-cta.is-on .music-cta-ico{ animation:musicBeat 1.6s ease-in-out infinite; }
.music-cta-eq{ display:inline-flex; align-items:flex-end; gap:2.5px; height:16px; }
.music-cta-eq i{
  display:block; width:3px; height:6px; border-radius:9px; background:currentColor;
  opacity:.85; animation:eqBar .9s ease-in-out infinite;
}
.music-cta-eq i:nth-child(2){ animation-delay:.15s }
.music-cta-eq i:nth-child(3){ animation-delay:.3s }
.music-cta.is-on .music-cta-eq i{ animation-play-state:paused; height:4px; }
@keyframes musicPulse{
  0%{ box-shadow:0 14px 34px rgba(124,108,240,.42), 0 0 0 0 rgba(124,108,240,.42); }
  70%{ box-shadow:0 14px 34px rgba(124,108,240,.42), 0 0 0 14px rgba(124,108,240,0); }
  100%{ box-shadow:0 14px 34px rgba(124,108,240,.42), 0 0 0 0 rgba(124,108,240,0); }
}
@keyframes musicBeat{ 0%,100%{ transform:scale(1) } 50%{ transform:scale(1.18) rotate(-6deg) } }
@keyframes eqBar{ 0%,100%{ height:5px } 50%{ height:15px } }
/* 音乐按钮与智能体气泡在窄屏上避让 */
@media (max-width:767.98px){
  .music-cta{ left:16px; bottom:16px; max-width:calc(100vw - 100px); padding:11px 18px 11px 14px; font-size:13.5px; }
  .music-cta.is-on{ padding:9px 15px 9px 12px; }
}

/* ---------- 20. 成片实时编辑侧栏 ---------- */
.editor-drawer .drawer-body textarea{
  width:100%; min-height:150px; border:1px solid var(--line-strong); border-radius:12px;
  padding:12px; font-size:14px; line-height:1.8; resize:vertical; background:var(--bg); outline:none;
  transition:.2s;
}
.editor-drawer .drawer-body textarea:focus{ border-color:var(--brand); background:#fff; box-shadow:0 0 0 4px rgba(232,84,124,.1); }
.editor-drawer .drawer-body input[type=text],
.editor-drawer .drawer-body input[type=date]{
  width:100%; border:1px solid var(--line-strong); border-radius:11px; padding:11px 13px;
  font-size:14px; background:var(--bg); outline:none; transition:.2s;
}
.editor-drawer .drawer-body input[type=text]:focus,
.editor-drawer .drawer-body input[type=date]:focus{ border-color:var(--brand); background:#fff; box-shadow:0 0 0 4px rgba(232,84,124,.1); }

/* ---------- 21. 下拉选择框 ---------- */
select.select{
  -webkit-appearance:none; appearance:none;
  width:100%; border:1px solid var(--line-strong); border-radius:12px;
  padding:12px 40px 12px 14px; font-size:14.5px; background:var(--bg); outline:none;
  cursor:pointer; transition:.2s;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6259' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 13px center; background-size:17px;
}
select.select:focus{ border-color:var(--brand); background-color:#fff; box-shadow:0 0 0 4px rgba(232,84,124,.12); }
select.select:disabled{ opacity:.55; cursor:default; }
.input-row select.select{ flex:1; min-width:0; }

/* ---------- 22. 分享推荐文案 ---------- */
.copy-tips{ display:grid; gap:10px; }
.copy-tip{
  border:1px solid var(--line); border-radius:14px; padding:12px 14px; background:var(--bg);
}
.copy-tip-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px;
}
.copy-tip-head b{ font-size:13px; }
.copy-tip p{
  font-size:12.5px; line-height:1.8; color:var(--text-2);
  white-space:pre-wrap; word-break:break-word; margin:0;
}
/* 一键复制的语义命名（与 .btn 组合使用） */
.ai-again{ font-weight:700; }
textarea.is-busy{ opacity:.55; }

/* ---------- 23. Toast 变体 ---------- */
.toast{ display:inline-flex; align-items:center; gap:7px; max-width:min(560px,86vw); text-align:left; }
.toast .toast-ico{ font-style:normal; flex:0 0 auto; }
.toast-error{ background:#8c1f2c; }
.toast-warn{ background:#7a4a10; }
.toast-ok{ background:#1f5c46; }
@media (max-width:767.98px){
  #toast-wrap{ left:12px; right:12px; transform:none; bottom:calc(84px + env(safe-area-inset-bottom,0px)); justify-items:stretch; }
  .toast{ max-width:none; justify-content:center; }
}

/* ---------- 24. 打印 ---------- */
@media print{
  .music-cta,.editor-drawer,.wz-tabs,.wz-preview{ display:none !important; }
}

/* ==================================================================
   25. 星愿交互闭环（vibe）—— 开屏点灯 / 星星收集 / 吹蜡烛许愿 /
       滚动叙事 / 打字机 / 微交互 / 光晕跟随 / 分享反馈
   全部只用 transform 与 opacity，尊重 prefers-reduced-motion。
   ================================================================== */

/* ---------- 背景层：星星收集 / 光晕跟随 / 流星彩蛋 ----------
   本站内容容器全幅铺满，若星星放在内容层之下将永远点不到；
   故 bg-layer 为透明覆盖层（z:59，低于抽屉70+/弹窗90/粒子层60），
   层本身 pointer-events:none，只有星星单独可点，不拦截任何内容点击。 */
.bg-layer{ position:fixed; inset:0; z-index:59; pointer-events:none; overflow:hidden; }

/* ---------- 首屏开屏遮罩「点击点亮星愿」 ---------- */
body.is-gated{ overflow:hidden; }
.wish-gate{
  position:fixed; inset:0; z-index:999; cursor:pointer;
  background:radial-gradient(120% 100% at 50% 18%, #251b3d 0%, #110d1f 72%);
  display:grid; place-items:center;
  transition:opacity .6s var(--ease);
}
.wish-gate.is-out{ opacity:0; pointer-events:none; }
.wg-sky{ position:absolute; inset:0; overflow:hidden; }
.wg-dot{
  position:absolute; width:3px; height:3px; border-radius:50%;
  background:#fff; opacity:.35; animation:wgTwinkle 3s ease-in-out infinite;
}
.wg-dot:nth-child(3n){ width:2px; height:2px; }
@keyframes wgTwinkle{ 0%,100%{ opacity:.12 } 50%{ opacity:.85 } }
.wg-star{
  position:relative; font-size:54px; line-height:1; color:#ffd36e;
  text-shadow:0 0 24px rgba(255,211,110,.9), 0 0 64px rgba(255,211,110,.45);
  animation:wgPulse 1.8s ease-in-out infinite;
}
.wg-star::before{ content:'✦'; }
@keyframes wgPulse{ 0%,100%{ transform:scale(1); opacity:.92 } 50%{ transform:scale(1.2); opacity:1 } }
.wg-text{
  position:relative; margin-top:20px; color:#fff; font-size:19px; font-weight:700;
  letter-spacing:.35em; text-indent:.35em;
}
.wg-sub{ position:relative; margin-top:12px; color:rgba(255,255,255,.55); font-size:13px; letter-spacing:.12em; }
/* 开屏散开的星星 */
.wg-spark{
  position:absolute; width:6px; height:6px; border-radius:50%;
  background:#ffe9b0; box-shadow:0 0 10px #ffd36e; pointer-events:none;
  animation:sparkFly .9s var(--ease) forwards;
}
@keyframes sparkFly{
  0%{ opacity:1; transform:translate(0,0) scale(1); }
  100%{ opacity:0; transform:translate(var(--tx,60px),var(--ty,60px)) scale(.2); }
}
/* 开屏后 hero 逐个淡入上浮（主文案另走打字机） */
.hero.is-lit > *{ animation:vibeFadeUp .7s var(--ease) both; }
.hero.is-lit > *:nth-child(2){ animation-delay:.05s }
.hero.is-lit > *:nth-child(3){ animation-delay:.14s }
.hero.is-lit > *:nth-child(4){ animation-delay:.26s }
.hero.is-lit > *:nth-child(5){ animation-delay:.38s }
.hero.is-lit > *:nth-child(6){ animation-delay:.5s }
@keyframes vibeFadeUp{ from{ opacity:0; transform:translateY(16px) } to{ opacity:1; transform:none } }
/* 首页主文案打字机 */
.hero-sub.is-typing{ cursor:pointer; }
.vibe-caret{
  display:inline-block; width:2px; height:1em; margin-left:2px;
  background:var(--brand); vertical-align:-2px; animation:blink 1s steps(1) infinite;
}

/* ---------- 星星收集（命中区 ≥44×44） ---------- */
.wish-star{
  position:fixed; width:50px; height:50px; padding:0; border:0;
  background:transparent; cursor:pointer; display:none; place-items:center;
  color:#c9a052; font-size:20px; line-height:1; opacity:.55;
  filter:drop-shadow(0 0 6px rgba(255,211,110,.5));
  transition:transform .25s var(--ease), opacity .3s, filter .3s;
  animation:starTwinkle 2.8s ease-in-out infinite;
}
body.vibe-stars-on .wish-star{ display:grid; }
.wish-star i{ pointer-events:none; font-style:normal; }
.wish-star em{ position:absolute; inset:0; }
.wish-star:hover{ transform:scale(1.35); opacity:1; }
.wish-star.is-lit{
  color:#ffd36e; opacity:1; animation:none; transform:scale(1.14);
  filter:drop-shadow(0 0 12px rgba(255,211,110,.95));
}
@keyframes starTwinkle{ 0%,100%{ opacity:.42 } 50%{ opacity:.85 } }
/* 流星雨彩蛋 */
.wish-meteor{
  position:fixed; width:110px; height:2px; border-radius:2px; pointer-events:none;
  background:linear-gradient(90deg, rgba(255,255,255,0), #fff);
  filter:drop-shadow(0 0 6px rgba(255,211,110,.9));
  opacity:0; animation:meteorFly .95s ease-in forwards;
}
@keyframes meteorFly{
  0%{ opacity:0; transform:rotate(28deg) translateX(-12vw); }
  12%{ opacity:1; }
  100%{ opacity:0; transform:rotate(28deg) translateX(34vw); }
}
/* 光晕跟随的星点尾迹 */
.trail-dot{
  position:fixed; border-radius:50%; pointer-events:none; opacity:0;
  animation:trailFade .7s ease-out forwards;
}
@keyframes trailFade{
  0%{ opacity:.8; transform:scale(1); }
  100%{ opacity:0; transform:scale(.15) translateY(-12px); }
}

/* ---------- 滚动叙事淡入上浮（[data-reveal]） ---------- */
.rv{ opacity:0; transform:translateY(18px); }
.rv-in{
  opacity:1; transform:none;
  transition:opacity .65s var(--ease), transform .65s var(--ease);
}

/* ---------- 吹蜡烛许愿：按钮与星尘 ---------- */
.cake-actions{ margin-top:14px; }
.scene-btn.is-relight{ display:none; }
.scene-btn.is-relight.is-show{ display:inline-flex; }
.scene-btn.is-wish.is-done{
  background:linear-gradient(120deg,#ffd36e,#ff8fb1); color:#3a2a12;
  border-color:transparent;
}
.scene-cake{ position:relative; }
.cake-dust{
  position:absolute; bottom:64px; width:var(--s,4px); height:var(--s,4px);
  border-radius:50%; background:var(--scene-accent,#ffd36e);
  box-shadow:0 0 8px rgba(255,211,110,.9);
  opacity:0; pointer-events:none;
  animation:cakeRise 1.3s var(--ease) forwards;
}
@keyframes cakeRise{
  0%{ opacity:0; transform:translate(0,0) scale(.6); }
  15%{ opacity:.95; }
  100%{ opacity:0; transform:translate(var(--dx,0px),-130px) scale(1.1); }
}

/* ---------- 打字机（成片祝福语）：可点击跳过 ---------- */
.scene-msg.is-typing{ cursor:pointer; }

/* ---------- 寿星名字：点击直接编辑 ---------- */
.scene-name .hl.is-editable{
  cursor:text; border-bottom:1px dashed rgba(255,255,255,.4);
  transition:box-shadow .2s var(--ease), text-shadow .2s;
}
.scene-name .hl.is-editable:hover{ text-shadow:0 0 18px var(--scene-accent); }
.scene-name .hl[contenteditable="true"]{
  box-shadow:0 0 0 3px rgba(255,255,255,.16);
  border-radius:6px; padding:0 6px; margin:0 -6px;
}

/* ---------- 微交互：hover 放大发光 / 按下回弹 / 波纹 ---------- */
.btn,.chip-btn,.scene-btn,.seg-btn,.share-cta,.wish-star{
  position:relative; overflow:hidden;
}
.btn:hover,.chip-btn:hover,.scene-btn:hover,.seg-btn:hover,.share-cta:hover{
  transform:translateY(-1px) scale(1.03);
  box-shadow:0 10px 28px rgba(232,84,124,.28), 0 0 18px rgba(255,211,110,.22);
}
.chip-btn:active,.scene-btn:active,.seg-btn:active,.share-cta:active{ transform:scale(.96); }
.vibe-ripple{
  position:absolute; border-radius:50%; pointer-events:none;
  background:rgba(255,255,255,.35);
  animation:vibeRipple .5s ease-out forwards;
}
@keyframes vibeRipple{
  0%{ opacity:.5; transform:scale(0); }
  100%{ opacity:0; transform:scale(1); }
}

/* ---------- 固定音乐按钮（右下角）+ 固定分享按钮（左下角） ----------
   音乐按钮按需求移到右下角（原左下角），智能体悬浮球整体上移避让。 */
.music-cta{ left:auto; right:20px; bottom:20px; z-index:1000; }
.share-cta{
  position:fixed; left:20px; bottom:20px; z-index:1000;
  display:none; align-items:center; gap:8px;
  border:1px solid var(--line-strong); cursor:pointer; border-radius:999px;
  padding:12px 18px 12px 14px; font-size:14px; font-weight:700;
  color:var(--text); background:var(--bg-soft); box-shadow:var(--shadow);
  transition:transform .22s var(--ease), opacity .3s, background .3s, color .3s;
}
.share-cta.is-show{ display:inline-flex; }
.share-cta.is-done{
  background:linear-gradient(120deg,#1f5c46,#2c7a5f); color:#fff;
  border-color:transparent; box-shadow:0 10px 26px rgba(31,92,70,.35);
}
.share-cta-ico{ font-size:17px; line-height:1; }
.agent-fab{ bottom:84px; }
.agent-tease{ bottom:150px; }
.agent{ bottom:150px; height:min(640px, calc(100vh - 186px)); }
/* 路由隐藏类：向导页让位选项区、成片页让位底部按钮区；
   仅 <768 生效（见 §26），桌面端向导/成片页小愿照常显示 */

@media (max-width:767.98px){
  .music-cta{ left:auto; right:16px; bottom:16px; max-width:calc(100vw - 90px); }
  .share-cta{ left:16px; bottom:16px; padding:10px 15px 10px 12px; font-size:13px; }
  .wish-star{ width:48px; height:48px; font-size:18px; }
  .agent-fab{ bottom:156px; }
  .agent-tease{ bottom:222px; }
  .agent{ bottom:222px; height:min(640px, calc(100vh - 244px)); }
}

/* ---------- 减少动态效果：关粒子/打字/位移，只留淡入 ---------- */
@media (prefers-reduced-motion: reduce){
  .trail-dot,.wish-meteor,.wg-spark,.cake-dust,.vibe-ripple{ display:none !important; }
  .wish-star,.wg-star{ animation:none !important; }
  .rv{ transform:none !important; }
  .rv,.rv-in{ transition:opacity .3s ease !important; }
  .hero.is-lit > *{ animation:none !important; }
  .wish-gate{ transition:opacity .2s ease; }
  .btn:hover,.chip-btn:hover,.scene-btn:hover,.seg-btn:hover,.share-cta:hover{ transform:none; }
}

/* ---------- 打印 ---------- */
@media print{
  .bg-layer,.share-cta,.wish-gate,.wish-star,.music-cta{ display:none !important; }
}

/* ==================================================================
   26. 批 B 移动端适配（<768px）
   单列布局 / 9:16 竖版预览 / 44px 点击区 / 16px 输入字号防 iOS 缩放 /
   safe-area 安全区 / 底部悬浮操作条不遮挡内容
   ================================================================== */
@media (max-width:767.98px){
  /* --- 44px 最小点击区（触屏）--- */
  .btn,.btn-sm,.chip-btn,.chip,.seg-btn,.nav-btn,.icon-btn,
  .wz-tab,.am-chip,.am-quick,.scene-btn,.wish-card{
    min-height:44px;
  }
  .icon-btn{ min-width:44px; }
  .seg-btn{ padding:12px 6px; }
  .chip{ padding:12px 16px; }
  .btn-sm{ padding:10px 16px; }
  .nav-btn{ padding:10px 12px; }
  .wz-tab{ padding:12px 8px; }
  .scene-btn{ padding:12px 20px; }
  .wish-card{ padding:12px 16px; }
  /* 上传占位里的小删除按钮走视觉小、命中区大 */
  .preview-grid .ph button{
    width:28px; height:28px;
    background:rgba(0,0,0,.45);
  }
  .preview-grid .ph button::after{
    content:""; position:absolute; inset:-8px;
  }

  /* --- 9:16 竖版：制作预览与成片在手机上按故事比例呈现 ---
     （scene-inner 自带滚动，内容超出时在场景内滚动） */
  #wz-stage .scene,#stage .scene{
    aspect-ratio:9/16; min-height:0;
  }
  #wz-stage{ border-radius:18px; }
  .wz-stage-holder{ padding:6px; }
  /* 成片页整屏自适应：场景精确吃掉「视口 − 顶栏 − 操作条 − 底部按钮区」，
     不出现纵向滚动；场景底部的「再看一次/重新生成」永远落在固定按钮区上方 */
  #screen-stage{
    display:flex; flex-direction:column;
    height:calc(100vh - var(--topbar-h,57px));
    height:calc(100dvh - var(--topbar-h,57px));
  }
  .stage-bar{ position:static; flex:0 0 auto; }
  #stage{ flex:1 1 auto; min-height:0; display:flex; justify-content:center; }
  #stage .scene{ width:auto; height:100%; }
  /* QQ / 微信 WebView（MQQBrowser TBS 内核）里，flex 项的 min-width:auto 会被算成
     内容最小宽度，实测 #stage 被撑到 786px（视口才 364），场景随后被
     justify-content:center 推到屏幕外。锁死最小宽度即可对齐各内核行为。 */
  #screen-stage{ min-width:0; overflow-x:hidden; }
  #stage{ min-width:0; max-width:100%; overflow-x:hidden; }
  #stage .scene{ min-width:0; }
  #stage .scene .scene-inner,#wz-stage .scene .scene-inner{ min-height:0; }
  /* 成片工具条收纳：四个操作收成一行 40px 图标按钮（文案收进 aria-label），
     stage-bar 由两行 ~118px 压到一行 ~53px，375×667 下场景宽 ≥260px */
  .stage-bar{ flex-wrap:nowrap; padding:4px 10px; row-gap:0; }
  .stage-bar-mid{ flex:0 1 auto; order:0; gap:6px; overflow-x:auto; padding-bottom:0; }
  .stage-bar .chip-btn{
    display:inline-flex; align-items:center; justify-content:center;
    flex:0 0 auto; width:40px; height:40px; min-height:40px; min-width:40px;
    padding:0; gap:0; border-radius:12px; font-size:17px;
  }
  .stage-bar .chip-btn .chip-txt{ display:none; }
  #stage{ margin-top:4px; }

  /* --- safe-area 安全区（刘海屏 / 底部横条）--- */
  .composer{ padding-bottom:calc(14px + env(safe-area-inset-bottom,0px)); }
  .drawer-body{ padding-bottom:calc(20px + env(safe-area-inset-bottom,0px)); }
  .modal{ padding-bottom:env(safe-area-inset-bottom,0px); }
  .agent-foot{ padding-bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
  .music-cta,.share-cta{ bottom:calc(16px + env(safe-area-inset-bottom,0px)); }
  .agent-fab{ bottom:calc(156px + env(safe-area-inset-bottom,0px)); }
  .agent-tease{ bottom:calc(222px + env(safe-area-inset-bottom,0px)); }
  .agent{ bottom:calc(222px + env(safe-area-inset-bottom,0px)); height:min(640px, calc(100vh - 244px)); }
  /* 小愿路由隐藏只在移动端生效：向导页让位选项区、成片页让位底部按钮区，
     只保留首页显示（桌面端向导/成片页照常显示） */
  .agent-fab.is-hide,.agent-tease.is-hide{ display:none; }

  /* --- 底部悬浮操作条不遮挡内容 ---
     成片页压到 76px（固定按钮实测占位 ~60px，余量 16px），为 375×667 场景宽 ≥260 让路 */
  #screen-stage{ padding-bottom:calc(76px + env(safe-area-inset-bottom,0px)); }
  #screen-home{ padding-bottom:calc(88px + env(safe-area-inset-bottom,0px)); }

  /* --- 表单细节：输入字号 16px 由 §2 全局规则保障（防 iOS 聚焦放大）--- */
  .field input,.editor-drawer .drawer-body input[type=text],
  .editor-drawer .drawer-body input[type=date],
  .editor-drawer .drawer-body textarea,
  select.select,.code-box{
    font-size:16px;
  }
  /* 时间线相册在竖屏下占据更大视口 */
  .album-item .pic{ height:clamp(140px,32vw,190px); }
}

/* =====================================================================
   长辈模式（body.elder-mode）：大字 · 高对比 · 少动效
   - 只放大文字与点击区，不改布局结构
   - 动效由 JS 把动画档位压到「低」实现，这里只兜底关掉装饰层
   ===================================================================== */
body.elder-mode{
  --text:#171210;
  --text-2:#3b332d;
  --text-3:#5c534b;
  --line:#bcae9f;
  --line-strong:#9d8e7d;
}
body.elder-mode .hero-sub,
body.elder-mode .bubble,
body.elder-mode .mode-card p,
body.elder-mode .modal-body p{
  font-size:17.5px; line-height:1.9;
}
body.elder-mode .hint{ font-size:15.5px; line-height:1.8; }
body.elder-mode .hint.tiny{ font-size:14.5px; line-height:1.75; }
body.elder-mode .btn,
body.elder-mode .chip-btn,
body.elder-mode .nav-btn,
body.elder-mode .share-cta,
body.elder-mode .music-cta{
  font-size:16.5px; min-height:52px; padding:14px 22px;
}
body.elder-mode .nav-btn{ padding:10px 14px; }
body.elder-mode .chip{ font-size:15.5px; padding:12px 20px; }
body.elder-mode .field > span{ font-size:15.5px; }
body.elder-mode input,
body.elder-mode textarea,
body.elder-mode select{ font-size:17px; }
body.elder-mode .scene-name{ font-size:clamp(56px,12vw,96px); }
body.elder-mode .scene-msg{ font-size:clamp(20px,3.4vw,30px); line-height:1.95; }
body.elder-mode .scene-meta,
body.elder-mode .wall-note p{ font-size:15.5px; }
/* 装饰层：星空 / 粒子 / 飘落，全部关掉，减少视觉噪音 */
body.elder-mode .bg-layer,
body.elder-mode #fx-layer,
body.elder-mode .snow-layer{ display:none !important; }
