:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-softer: #fbfbfe;
  --text: #1a1c2e;
  --text-soft: #5a5f73;
  --text-faint: #8b90a3;
  --border: #e7e8f0;
  --brand: #6c5ce7;
  --brand-2: #a66bff;
  --brand-ink: #5038d6;
  --accent: #ff7eb3;
  --ok: #18b884;
  --warn: #f5a623;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(40, 30, 90, 0.08);
  --shadow-lg: 0 24px 60px rgba(40, 30, 90, 0.14);
  --maxw: 1140px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.logo {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo .dot {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 15px;
  transition: color .15s;
}
.nav a:hover { color: var(--text); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(108, 92, 231, 0.34);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(108, 92, 231, 0.42); }
.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  padding: 66px 0 40px;
  text-align: center;
  background:
    radial-gradient(900px 400px at 50% -120px, rgba(166, 107, 255, 0.16), transparent 70%),
    var(--bg);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-ink);
  background: rgba(108, 92, 231, 0.1);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-soft);
  max-width: 660px;
  margin: 0 auto 28px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.trust-row {
  margin-top: 26px;
  display: flex;
  gap: 26px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 13.5px;
  font-weight: 600;
}
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Section ---------- */
.section { padding: 58px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 38px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.8px; margin: 0 0 12px; font-weight: 800; }
.section-head p { color: var(--text-soft); margin: 0; font-size: 17px; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d9d7f3; }
.card .ic {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(108,92,231,.14), rgba(166,107,255,.14));
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.3px; }
.card p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* tool tile */
.tile {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg);
  transition: transform .14s, box-shadow .15s, border-color .14s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d9d7f3; }
.tile .thumb {
  height: 132px;
  border-radius: 12px;
  background: linear-gradient(135deg, #efeaff, #fbe9f4);
  margin-bottom: 14px;
  display: grid; place-items: center;
  font-size: 30px;
}
.tile h3 { margin: 0 0 5px; font-size: 16.5px; }
.tile p { margin: 0; color: var(--text-faint); font-size: 13.5px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { text-align: center; }
.step .num {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(108,92,231,.32);
}
.step h4 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

/* ---------- Examples gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery .item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, #efeaff, #fbe9f4);
  display: grid; place-items: center;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  position: relative;
}
.gallery .item .tag {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(255,255,255,.9); color: var(--text);
  font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 700;
}

/* ---------- Tool widget ---------- */
.tool-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.tool-wrap > * { min-width: 0; }
.uploader {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-softer);
  padding: 26px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.uploader:hover { border-color: var(--brand); background: #faf8ff; }
.uploader.has-file { border-style: solid; border-color: var(--brand); }
.uploader .preview {
  width: 120px; height: 120px; border-radius: 14px; object-fit: cover; margin: 0 auto 12px;
  display: none; box-shadow: var(--shadow);
}
.uploader .upload-ic { font-size: 38px; margin-bottom: 8px; }
.uploader .hint { color: var(--text-faint); font-size: 13px; margin-top: 6px; }
.field-title { font-weight: 700; font-size: 14px; margin: 0 0 10px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-soft);
  transition: all .14s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
textarea.prompt, input.url {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--text);
  resize: vertical;
  background: #fff;
}
textarea.prompt:focus, input.url:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(108,92,231,.15); }
.gen-btn { width: 100%; margin-top: 14px; }
.result-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-softer);
  min-height: 320px;
  padding: 18px;
  text-align: center;
  color: var(--text-faint);
}
.result-box:has(.placeholder),
.result-box:has(.spinner) { display: grid; place-items: center; }
.result-box img { border-radius: 10px 10px 0 0; max-width: 100%; }
.result-box .placeholder { font-size: 14px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--brand);
  animation: spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.api-note {
  font-size: 12.5px; color: var(--text-faint);
  margin-top: 12px; text-align: center;
}
.api-note a { color: var(--brand-ink); text-decoration: underline; }
.api-note code {
  background: #f0eff8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--brand-ink);
}
.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  text-align: left;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.45;
}
.consent-row input { margin-top: 3px; accent-color: var(--brand); }
.policy-mini {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #ece8d5;
  background: #fffaf0;
  border-radius: 12px;
  color: #725622;
  font-size: 12.8px;
  text-align: left;
}
.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  text-align: left;
}
.result-toolbar strong,
.result-toolbar span { display: block; }
.result-toolbar strong { color: var(--text); font-size: 15px; }
.result-toolbar span { font-size: 12px; }
.download-all-btn,
.download-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-ink);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.download-all-btn:hover,
.download-btn:hover { border-color: var(--brand); background: #faf8ff; }
.download-all-btn:disabled,
.download-btn:disabled { cursor: wait; opacity: .65; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  align-items: start;
}
.result-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.result-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #f1f2f6;
}
.result-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  font-size: 11px;
  color: var(--text-soft);
  text-align: left;
}
.result-caption {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.seasonal-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #f3d4a5;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff8ed, #fff2df);
  box-shadow: var(--shadow);
}
.seasonal-band h3 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.4px; }
.seasonal-band p { margin: 0; color: var(--text-soft); max-width: 680px; }
.halloween-hero {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,138,31,.16), transparent 26%),
    radial-gradient(circle at 78% 12%, rgba(115,87,211,.13), transparent 26%);
}

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--brand); box-shadow: 0 22px 50px rgba(108,92,231,.22); position: relative; }
.price-card .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; font-size:12px; font-weight:700; padding:5px 14px; border-radius:999px; }
.price-card h3 { margin: 0 0 4px; font-size: 19px; }
.price-card .price { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 12px 0 2px; }
.price-card .price small { font-size: 15px; font-weight: 600; color: var(--text-faint); }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 22px; flex: 1; }
.price-card li { padding: 8px 0 8px 26px; position: relative; color: var(--text-soft); font-size: 14.5px; border-bottom: 1px dashed var(--border); }
.price-card li:before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.faq-q { padding: 16px 18px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q .plus { color: var(--brand); font-size: 20px; transition: transform .2s; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a div { padding: 0 18px 16px; color: var(--text-soft); font-size: 14.5px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, #221c4a, #4a2f8f);
  color: #fff;
  border-radius: 22px;
  padding: 52px 30px;
  text-align: center;
}
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 12px; letter-spacing: -0.6px; }
.cta-band p { color: rgba(255,255,255,.8); margin: 0 0 24px; font-size: 17px; }

/* ---------- Footer ---------- */
.site-footer { background: #14152b; color: #c9cbe0; padding: 54px 0 28px; margin-top: 40px; }
.site-footer a { color: #c9cbe0; }
.site-footer a:hover { color: #fff; }
.foot-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.foot-cols h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { padding: 5px 0; font-size: 14px; }
.foot-brand p { color: #9a9cc0; font-size: 14px; max-width: 300px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #8b8db0; }

/* ---------- Tool page hero ---------- */
.page-hero { padding: 50px 0 26px; text-align: center; }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -1px; margin: 0 0 12px; font-weight: 800; }
.page-hero p { color: var(--text-soft); max-width: 620px; margin: 0 auto; font-size: 17px; }

/* breadcrumb */
.crumb { font-size: 13px; color: var(--text-faint); padding: 16px 0 0; }
.crumb a { color: var(--text-faint); }
.crumb a:hover { color: var(--brand-ink); }

/* settings modal */
.modal-mask { position: fixed; inset: 0; background: rgba(20,18,40,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 6px; }
.modal p { color: var(--text-soft); font-size: 14px; margin: 0 0 16px; }
.modal label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 6px; }
.modal .row { display: flex; gap: 10px; margin-top: 18px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #221c4a; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: all .25s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4, .gallery { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .steps, .price-grid { grid-template-columns: 1fr; }
  .tool-wrap { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .seasonal-band { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .site-header .container { height: 58px; }
  .nav { display: none; }
  .nav.show { display: flex; position: absolute; top: 58px; left: 0; right: 0; max-height: calc(100vh - 58px); overflow-y: auto; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px 18px; gap: 4px; }
  .nav.show a { padding: 10px 8px; }
  .nav-toggle { display: block; min-width: 44px; min-height: 44px; }
  .hero { padding: 38px 0 28px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .section { padding: 42px 0; }
  .page-hero { padding: 34px 0 18px; }
  .grid-2, .grid-4, .gallery { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr; }
  .uploader { padding: 20px 14px; min-height: 178px; display: flex; flex-direction: column; justify-content: center; }
  .uploader .preview { width: 112px; height: 140px; object-fit: contain; background: #f1f2f6; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .chip { flex: 0 0 auto; min-height: 42px; scroll-snap-align: start; }
  .gen-btn { min-height: 52px; position: sticky; bottom: 10px; z-index: 10; }
  .api-note { padding: 0 6px; }
  .result-box { min-height: 260px; padding: 12px; }
  .result-toolbar { align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr; }
  .result-card figcaption { padding: 10px; }
  .download-btn { min-width: 100px; }
  .seasonal-band { padding: 18px; }
  .cta-band { padding: 36px 18px; }
}

@media (max-width: 360px) {
  .result-toolbar { flex-direction: column; }
  .download-all-btn { width: 100%; }
}
