/* ============================================================
   PosterGen — shared site styles
   Light theme · mobile-first · indigo/purple accent
   ============================================================ */
:root{
  --bg:#ffffff;
  --soft:#f6f7fb;
  --soft2:#eef1f9;
  --ink:#191c2b;
  --muted:#5a6078;
  --line:#e6e9f3;
  --accent:#5b46d6;
  --accent2:#8b5cf6;
  --accent-soft:#efeafe;
  --radius:16px;
  --shadow:0 10px 30px rgba(38,30,90,.08);
  --maxw:1120px;
}
*{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--ink);line-height:1.65;-webkit-font-smoothing:antialiased;
  font-size:16px;
}
a{color:var(--accent);text-decoration:none;}
a:hover{text-decoration:underline;}
img{max-width:100%;display:block;}
.container{max-width:var(--maxw);margin:0 auto;padding:0 20px;}

/* ---------- Nav ---------- */
.nav{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);}
.nav-inner{display:flex;align-items:center;gap:18px;height:64px;}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;color:var(--ink);}
.brand:hover{text-decoration:none;}
.brand .logo{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;}
.nav-links{display:flex;gap:6px;margin-left:8px;}
.nav-links a{color:var(--muted);font-weight:600;font-size:15px;padding:8px 12px;border-radius:9px;}
.nav-links a:hover{background:var(--soft);color:var(--ink);text-decoration:none;}
.nav-links a.active{color:var(--accent);background:var(--accent-soft);}
.nav-right{margin-left:auto;display:flex;align-items:center;gap:8px;}
.lang{display:flex;border:1px solid var(--line);border-radius:10px;overflow:hidden;}
.lang a{padding:7px 12px;font-size:13px;font-weight:700;color:var(--muted);}
.lang a.on{background:var(--accent);color:#fff;}
.lang a:hover{text-decoration:none;}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:none;cursor:pointer;
  font-weight:700;font-size:15px;color:#fff;background:linear-gradient(135deg,var(--accent),var(--accent2));
  padding:13px 20px;border-radius:12px;font-family:inherit;transition:transform .08s ease,box-shadow .2s ease;min-height:46px;}
.btn:hover{text-decoration:none;box-shadow:0 8px 20px rgba(91,70,214,.25);}
.btn:active{transform:translateY(1px);}
.btn.ghost{background:#fff;border:1px solid var(--line);color:var(--ink);}
.btn.ghost:hover{background:var(--soft);box-shadow:none;}
.btn.block{width:100%;}

/* small inline control (e.g. fit-width toggle) */
.mini{margin-left:10px;font:inherit;font-size:12px;font-weight:500;line-height:1;padding:6px 10px;
  border:1px solid var(--line);background:#fff;border-radius:8px;color:var(--muted);cursor:pointer;}
.mini:hover{background:var(--soft);color:var(--ink);}
.mini[aria-pressed="true"]{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-soft);}

/* ---------- Hero ---------- */
.hero{padding:56px 0 28px;text-align:center;}
.hero .eyebrow{display:inline-block;font-size:13px;font-weight:700;letter-spacing:1px;color:var(--accent);
  background:var(--accent-soft);padding:6px 14px;border-radius:20px;margin-bottom:18px;}
.hero h1{font-size:clamp(28px,5vw,46px);line-height:1.15;letter-spacing:-.5px;margin-bottom:16px;font-weight:800;}
.hero p.lead{font-size:clamp(16px,2.2vw,19px);color:var(--muted);max-width:680px;margin:0 auto 24px;}
.hero .cta{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;}

/* ---------- Section ---------- */
section{padding:44px 0;}
.section-head{text-align:center;max-width:720px;margin:0 auto 30px;}
.section-head h2{font-size:clamp(22px,3.4vw,32px);font-weight:800;margin-bottom:10px;letter-spacing:-.3px;}
.section-head p{color:var(--muted);font-size:17px;}
.bg-soft{background:var(--soft);}
/* homepage use-case grid, grouped by category */
.group-head{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:1.3px;
  color:var(--muted);margin:30px 0 14px;padding-bottom:8px;border-bottom:1px solid var(--line);}
.group-head:first-of-type{margin-top:6px;}
.uc-index{text-align:center;margin-top:28px;}
.uc-index a{color:var(--accent);font-weight:700;font-size:16px;text-decoration:none;}
.uc-index a:hover{text-decoration:underline;}

/* ---------- Generator ---------- */
.generator{display:grid;grid-template-columns:380px 1fr;gap:22px;align-items:start;}
.generator > *{min-width:0;}   /* allow grid items to shrink so the 760px poster scrolls inside .stage */
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);}
.card h3{font-size:13px;text-transform:uppercase;letter-spacing:1.4px;color:var(--muted);margin-bottom:16px;}
.field{margin-bottom:14px;}
.field label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px;font-weight:600;}
.field input,.field textarea,.field select{width:100%;background:var(--soft);border:1px solid var(--line);color:var(--ink);
  border-radius:11px;padding:11px 13px;font-size:15px;font-family:inherit;outline:none;}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--accent);background:#fff;box-shadow:0 0 0 3px var(--accent-soft);}
.field textarea{resize:vertical;min-height:190px;line-height:1.55;}
.row{display:flex;gap:12px;}
.row .field{flex:1;}
.hint{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.5;}
.preview-wrap{position:sticky;top:84px;}
.preview-head{display:flex;align-items:center;margin-bottom:12px;}
.preview-head h3{margin:0;}
.preview-head .scale{margin-left:auto;font-size:12px;color:var(--muted);}
.stage{background:var(--soft2);border:1px solid var(--line);border-radius:12px;padding:16px;overflow:auto;max-height:76vh;min-width:0;}
#poster{margin:0 auto;width:max-content;max-width:none;}

/* ---------- Ad slots ---------- */
.ad-slot{margin:26px 0;background:var(--soft);border:1px dashed #cfd5ea;border-radius:12px;padding:12px;text-align:center;}
.ad-label{font-size:10px;letter-spacing:2px;color:var(--muted);text-transform:uppercase;margin-bottom:8px;}
.ad-placeholder{min-height:90px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px;
  border-radius:8px;background:repeating-linear-gradient(45deg,#eef0f8,#eef0f8 10px,#e8ebf6 10px,#e8ebf6 20px);}

/* Ad slots: hidden until an ad network is enabled (remove this rule to show them). */
.ad-slot{display:none !important;}

/* ---------- Feature grid ---------- */
.grid{display:grid;gap:18px;}
.grid.cols-3{grid-template-columns:repeat(3,1fr);}
.grid.cols-2{grid-template-columns:repeat(2,1fr);}
.feature{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px;}
.feature .ico{width:42px;height:42px;border-radius:11px;background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;font-size:20px;margin-bottom:14px;}
.feature h3{font-size:17px;margin-bottom:8px;text-transform:none;letter-spacing:0;color:var(--ink);}
.feature p{color:var(--muted);font-size:15px;}

/* ---------- Steps ---------- */
.steps{counter-reset:step;display:grid;gap:16px;grid-template-columns:repeat(3,1fr);}
.step{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px;position:relative;}
.step .n{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:800;margin-bottom:14px;}
.step h3{font-size:17px;margin-bottom:8px;}
.step p{color:var(--muted);font-size:15px;}

/* ---------- Gallery ---------- */
.gallery-grid{display:grid;gap:22px;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));}
.gallery-item{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column;}
.gallery-preview{background:var(--soft2);padding:14px;display:flex;justify-content:center;overflow:hidden;height:300px;align-items:flex-start;}
.gallery-preview .pq{transform-origin:top center;}
.gallery-body{padding:18px 20px 22px;}
.gallery-body .kind{font-size:12px;font-weight:700;color:var(--accent);text-transform:uppercase;letter-spacing:1px;}
.gallery-body h3{font-size:18px;margin:6px 0 8px;}
.gallery-body p{color:var(--muted);font-size:14.5px;}
.gallery-body .more{margin-top:12px;}
.gallery-body .more a{color:var(--accent);font-weight:600;font-size:14px;text-decoration:none;}
.gallery-body .more a:hover{text-decoration:underline;}

/* ---------- Article / Guide ---------- */
.article{max-width:760px;margin:0 auto;}
.article h2{font-size:clamp(21px,3vw,27px);margin:34px 0 12px;letter-spacing:-.2px;}
.article h3{font-size:19px;margin:24px 0 10px;}
.article p{margin:12px 0;color:#33384d;}
.article ul,.article ol{margin:12px 0 12px 22px;}
.article li{margin:7px 0;color:#33384d;}
.article .callout{background:var(--accent-soft);border-left:4px solid var(--accent);border-radius:8px;padding:14px 18px;margin:18px 0;color:#3a2f6b;font-size:15px;}
.article code{background:var(--soft2);padding:2px 7px;border-radius:6px;font-size:14px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}

/* ---------- FAQ ---------- */
.faq{max-width:820px;margin:0 auto;}
.faq details{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin-bottom:12px;}
.faq summary{font-weight:700;cursor:pointer;font-size:16px;list-style:none;display:flex;justify-content:space-between;gap:12px;}
.faq summary::-webkit-details-marker{display:none;}
.faq summary::after{content:"+";color:var(--accent);font-weight:800;font-size:20px;line-height:1;}
.faq details[open] summary::after{content:"–";}
.faq details p{margin-top:12px;color:var(--muted);font-size:15px;}

/* ---------- CTA band ---------- */
.cta-band{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;border-radius:20px;padding:46px 30px;text-align:center;}
.cta-band h2{font-size:clamp(22px,3.4vw,30px);margin-bottom:10px;}
.cta-band p{opacity:.92;margin-bottom:22px;font-size:16px;}
.cta-band .btn{background:#fff;color:var(--accent);}

/* ---------- Footer ---------- */
footer{background:var(--soft);border-top:1px solid var(--line);padding:44px 0 30px;margin-top:40px;}
.foot-grid{display:grid;grid-template-columns:1.6fr 1.1fr 1.1fr 1.1fr;gap:28px;}
.foot-grid h4{font-size:14px;margin-bottom:12px;}
.foot-grid a{display:block;color:var(--muted);font-size:14px;padding:4px 0;}
.foot-brand p{color:var(--muted);font-size:14px;max-width:320px;margin-top:10px;}
.foot-bottom{border-top:1px solid var(--line);margin-top:28px;padding-top:18px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:13px;}

/* ---------- Responsive ---------- */
@media(max-width:960px){
  .generator{grid-template-columns:1fr;}
  .preview-wrap{position:static;}
  .grid.cols-3,.steps{grid-template-columns:1fr;}
  .grid.cols-2{grid-template-columns:1fr;}
  .foot-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:640px){
  body{font-size:15px;}
  .nav-inner{gap:8px;height:58px;}
  .brand span.name{display:none;}
  .nav-links a{padding:8px 9px;font-size:14px;}
  .hero{padding:38px 0 20px;}
  .row{flex-direction:column;gap:0;}
  .foot-grid{grid-template-columns:1fr;}
  .stage{padding:10px;}
  .gallery-preview{height:250px;}
  section{padding:34px 0;}
}

/* ---------- Print: only the poster ---------- */
@media print{
  body{background:#fff;}
  .nav,footer,.hero,.section-head,.feature,.steps,.faq,.cta-band,.ad-slot,.card:first-child,.preview-head{display:none !important;}
  .generator{display:block;}
  .preview-wrap{position:static;}
  .stage{border:none;background:none;padding:0;max-height:none;overflow:visible;display:block;}
  #poster{transform:none !important;}
  .p-poster{box-shadow:none;}
}

/* ---------- Poster (generated) layout ---------- */
.p-poster{width:760px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#1f2433;overflow:hidden;}
.p-header{padding:44px 44px 38px;color:#fff;position:relative;}
.p-eyebrow{font-size:14px;letter-spacing:4px;opacity:.85;margin-bottom:12px;font-weight:500;}
.p-title{font-size:42px;font-weight:800;letter-spacing:1px;line-height:1.15;margin-bottom:14px;}
.p-sub{font-size:15px;opacity:.92;margin-bottom:18px;}
.p-chips{display:flex;gap:8px;flex-wrap:wrap;}
.p-chip{font-size:12px;padding:6px 12px;border-radius:18px;}
.p-body{padding:32px 40px 12px;}
.p-sec-title-only{font-size:21px;font-weight:800;margin:18px 0 8px;display:flex;align-items:center;gap:10px;}
.p-sec-title-only::before{content:"";width:6px;height:22px;border-radius:3px;background:var(--bar);display:inline-block;}
.p-item{display:flex;gap:12px;padding:10px 0;border-bottom:1px dashed #eceef5;}
.p-item:last-child{border-bottom:none;}
.p-num{flex:0 0 24px;height:24px;border-radius:50%;color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:2px;}
.p-text{font-size:14px;line-height:1.62;color:#3a4060;}
.p-footer{padding:24px 40px 30px;color:#fff;}
.p-footer-title{font-size:18px;font-weight:800;margin-bottom:8px;}
.p-contact{background:rgba(255,255,255,.10);border:1px dashed rgba(255,255,255,.4);border-radius:8px;padding:12px 14px;font-size:14px;line-height:1.7;}
