:root{ --pink:#FF8FAB; --orange:#FFB25A; --blue:#59B7FF; --green:#4CC96D; --ink:#5b4636; --bg:#FFF6EA; }
*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body{ font-family:-apple-system,"PingFang SC","Hiragino Sans GB",sans-serif; background:var(--bg); color:var(--ink); }
header{ position:sticky; top:0; z-index:10; background:linear-gradient(135deg,#FFE9C7,#FFD9E4); padding:14px 16px 10px; box-shadow:0 2px 10px rgba(200,150,80,.15); }
.logo{ font-size:20px; font-weight:800; }
.logo span{ font-size:12px; font-weight:500; margin-left:8px; opacity:.7; }
.steps{ display:flex; gap:6px; margin-top:10px; }
.steps i{ flex:1; height:5px; border-radius:3px; background:#fff; opacity:.6; font-style:normal; }
.steps i.on{ background:linear-gradient(90deg,var(--orange),var(--pink)); opacity:1; }
main{ max-width:560px; margin:0 auto; padding:18px 16px 60px; }
.panel h2{ font-size:18px; margin-bottom:12px; }
.tip{ font-size:12px; opacity:.7; line-height:1.6; margin-bottom:10px; }
label{ display:block; font-size:14px; margin-bottom:12px; }
label input, label textarea{ width:100%; margin-top:5px; border:1.5px solid #EFD9B8; border-radius:10px; padding:10px 12px; font-size:15px; background:#fff; font-family:inherit; }
label input:focus, label textarea:focus{ outline:none; border-color:var(--orange); }
button{ border:none; border-radius:24px; padding:12px 22px; font-size:15px; font-weight:700; cursor:pointer; }
.next,.ai{ background:linear-gradient(90deg,var(--orange),var(--pink)); color:#fff; box-shadow:0 4px 12px rgba(255,143,171,.35); }
.prev,.ghost{ background:#fff; color:var(--ink); border:1.5px solid #E8D5B5; }
.ai{ width:100%; margin-bottom:12px; }
.nav{ display:flex; gap:10px; margin-top:18px; }
.nav .next{ flex:1; } .nav .prev{ flex:0 0 auto; }
.tpl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.tpl-card{ background:#fff; border-radius:14px; overflow:hidden; border:2.5px solid transparent; box-shadow:0 3px 10px rgba(180,140,80,.12); cursor:pointer; }
.tpl-card.sel{ border-color:var(--pink); }
.tpl-card img{ width:100%; aspect-ratio:210/297; object-fit:cover; object-position:top; display:block; background:#f6efe2; }
.tpl-card b{ display:block; font-size:14px; padding:8px 10px 2px; }
.tpl-card i{ display:block; font-size:11px; opacity:.65; padding:0 10px 8px; font-style:normal; }
.cand{ background:#fff; border:2px solid #EFD9B8; border-radius:12px; padding:10px 12px; margin-bottom:10px; cursor:pointer; }
.cand.sel{ border-color:var(--green); background:#F4FFF4; }
.cand b{ font-size:12px; color:var(--green); }
.cand p{ font-size:14px; line-height:1.6; margin-top:4px; }
.cand textarea{ width:100%; margin-top:6px; border:1px dashed #ccc; border-radius:8px; padding:8px; font-size:14px; font-family:inherit; display:none; }
.cand.sel.edit textarea{ display:block; }
details{ background:#fff; border-radius:12px; padding:10px 14px; margin-bottom:12px; }
details summary{ font-size:14px; cursor:pointer; color:#B8863B; }
details label{ margin-top:10px; }
.crop-stage{ position:relative; width:min(360px,86vw); margin:0 auto; }
.crop-stage canvas{ width:100%; display:block; border-radius:16px; background:#222; touch-action:none; }
.crop-mask{ position:absolute; inset:0; pointer-events:none; }
.crop-mask::before{ content:''; position:absolute; inset:0; border-radius:16px;
  background:radial-gradient(circle closest-side at 50% 50%, transparent 0 98.2%, rgba(30,20,10,.52) 100%); }
.crop-mask::after{ content:''; position:absolute; inset:0; border-radius:50%; border:3px dashed #fff; }
.photo-actions{ display:flex; gap:10px; margin-top:14px; justify-content:center; }
.file-btn{ background:var(--blue); color:#fff; border-radius:24px; padding:12px 22px; font-weight:700; font-size:15px; }
.preview-box{ position:relative; background:#fff; border-radius:14px; padding:8px; box-shadow:0 3px 12px rgba(180,140,80,.15); }
.preview-box img{ width:100%; display:block; border-radius:8px; }
.loading{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.8); font-size:16px; border-radius:14px; }
.hide{ display:none !important; }
.files a{ display:block; background:#fff; border-radius:12px; padding:14px 16px; margin-bottom:10px; text-decoration:none; color:var(--ink); font-weight:700; box-shadow:0 2px 8px rgba(180,140,80,.12); }
.files a span{ float:right; color:var(--blue); }
footer{ text-align:center; font-size:11px; opacity:.55; padding:20px 10px 30px; display:flex; flex-direction:column; gap:6px; align-items:center; }
footer .beian{ color:inherit; text-decoration:none; border-bottom:1px dotted currentColor; }
footer .beian:hover{ color:#B0863B; }
/* 点选 chips */
.chipgroup{ background:#fff; border-radius:14px; padding:12px 14px; margin-bottom:12px; box-shadow:0 2px 8px rgba(180,140,80,.10); }
.cg-title{ font-size:14px; font-weight:700; margin-bottom:8px; }
.cg-title i{ font-size:11px; font-weight:400; color:#b09a7a; font-style:normal; }
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ font-size:13px; padding:7px 14px; border-radius:18px; background:#FFF3DE; color:#8a6d4b; border:1.5px solid transparent; cursor:pointer; user-select:none; }
.chip.on{ background:linear-gradient(90deg,var(--orange),var(--pink)); color:#fff; border-color:#fff; box-shadow:0 2px 8px rgba(255,143,171,.4); }
.chip.story{ background:#EAF6FF; color:#3a6d9e; }
.chip.story.on{ background:linear-gradient(90deg,#59B7FF,#4CC96D); color:#fff; }
.cg-custom{ margin-top:10px; }
.cg-custom input{ width:100%; border:1.5px dashed #E0C9A4; border-radius:18px; padding:8px 14px; font-size:13px; background:#FFFDF7; }
.cg-custom input:focus{ outline:none; border-color:var(--orange); }

.src{ display:inline-block; font-size:12px; padding:4px 12px; border-radius:12px; font-weight:700; }
.src.sp{ background:#E8F6E8; color:#2E7D32; }
.src.sa{ background:#E7F1FF; color:#1565C0; }
/* 第③步 照片卡片 */
.photo-choice{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.pc-card{ background:#fff; border:2px dashed #E0C9A4; border-radius:16px; padding:18px 12px; text-align:center; cursor:pointer; transition:.15s; }
.pc-card b{ display:block; font-size:15px; margin-top:6px; }
.pc-card i{ display:block; font-size:11px; color:#a08b6a; font-style:normal; margin-top:4px; line-height:1.5; }
.pc-ico{ font-size:30px; }
.pc-card.on{ border-style:solid; border-color:#FF8FAB; background:#FFF3F7; box-shadow:0 3px 10px rgba(255,143,171,.25); position:relative; }
.pc-card.on::after{ content:'✓'; position:absolute; right:10px; top:8px; width:22px; height:22px; border-radius:50%; background:#FF8FAB; color:#fff; font-size:14px; line-height:22px; font-weight:900; }
#zoom{ width:min(360px,86vw); display:block; margin:12px auto 0; }
.crop-actions{ text-align:center; margin-top:10px; }
.skip-hint{ background:#E8F6E8; color:#2E7D32; border-radius:12px; padding:12px 14px; font-size:13px; line-height:1.6; }
button.next:disabled{ background:#E5DED2; color:#B0A794; box-shadow:none; cursor:not-allowed; }
.hintline{ text-align:center; font-size:12px; color:#B0863B; margin-top:8px; }

/* ④ 确认页 */
.confirm-card{ background:#fff; border-radius:14px; padding:14px; box-shadow:0 2px 10px rgba(180,140,80,.12); }
.cf-row{ display:flex; gap:10px; font-size:14px; padding:6px 0; border-bottom:1px dashed #F0E4CC; }
.cf-row b{ color:#B0863B; flex:0 0 auto; }
.cf-story{ margin:10px 0; }
.cf-tag{ font-size:12px; color:#2E7D32; background:#E8F6E8; display:inline-block; padding:3px 10px; border-radius:10px; margin-bottom:6px; }
.cf-story p{ font-size:14px; line-height:1.7; }
.cf-field{ display:block; font-size:13px; font-weight:700; color:#8a6d4b; margin:12px 0 0; }
.confirm-card textarea,.confirm-card input{ width:100%; border:1.5px solid #EFD9B8; border-radius:10px; padding:9px 11px; font-size:14px; font-family:inherit; margin-top:6px; }

/* 预览页换模板 */
.tpl-switch{ display:flex; gap:8px; overflow-x:auto; padding:4px 2px 10px; }
.tpl-switch img{ width:52px; aspect-ratio:210/297; object-fit:cover; object-position:top; border-radius:6px; border:2px solid transparent; cursor:pointer; flex:0 0 auto; box-shadow:0 2px 6px rgba(150,110,60,.18); }
.tpl-switch img.on{ border-color:#FF8FAB; box-shadow:0 0 0 2px rgba(255,143,171,.35); }

/* 页内 toast 提示 */
#toast{ position:fixed; left:50%; bottom:12vh; transform:translateX(-50%) translateY(10px); background:rgba(50,38,26,.92); color:#fff; font-size:14px; padding:11px 18px; border-radius:22px; max-width:80vw; text-align:center; line-height:1.5; opacity:0; pointer-events:none; transition:.25s; z-index:9998; box-shadow:0 6px 20px rgba(0,0,0,.25); }
#toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

.shuffle-row{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.tpl-selected{ font-size:13px; color:#B0863B; font-weight:700; }

/* 登录页 */
.login-card{ background:#fff; border-radius:18px; padding:28px 22px 20px; margin-top:12vh; box-shadow:0 6px 24px rgba(180,140,80,.18); text-align:center; }
.login-card h2{ font-size:19px; margin:6px 0 10px; }
.login-logo{ font-size:44px; }
.login-card label{ text-align:left; }
.login-err{ color:#D9455B; font-size:13px; min-height:18px; margin-top:8px; }
