/* ============================================================
   NovaCanvas — design system (native CSS, zero dependencies)
   Dark-first premium theme + light mode, fluid & responsive
   ============================================================ */

:root {
  --bg: #07080d;
  --bg-soft: #0c0e17;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f4f8;
  --text-2: #a7adbd;
  --text-3: #6b7180;
  --brand: #6d5cff;
  --brand-2: #b44cff;
  --brand-3: #21d4fd;
  --accent: #ffb86b;
  --ok: #34d399;
  --err: #f87171;
  --grad-brand: linear-gradient(120deg, #21d4fd 0%, #6d5cff 45%, #b44cff 100%);
  --grad-soft: linear-gradient(120deg, rgba(33, 212, 253, 0.14), rgba(109, 92, 255, 0.18), rgba(180, 76, 255, 0.14));
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --container: 1180px;
  --header-h: 64px;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --panel: rgba(15, 18, 35, 0.035);
  --panel-strong: rgba(15, 18, 35, 0.06);
  --border: rgba(15, 18, 35, 0.1);
  --border-strong: rgba(15, 18, 35, 0.18);
  --text: #14172a;
  --text-2: #4c5266;
  --text-3: #868da3;
  --shadow: 0 18px 45px rgba(30, 35, 70, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(109, 92, 255, 0.4); }

.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
@media (max-width: 640px) { .container { width: calc(100% - 32px); } }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.35;
}
.aurora::before { background: radial-gradient(circle, #4f3dff 0%, transparent 60%); top: -25vmax; right: -15vmax; animation: drift 26s ease-in-out infinite alternate; }
.aurora::after { background: radial-gradient(circle, #0ea5c9 0%, transparent 60%); bottom: -30vmax; left: -18vmax; animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-8vmax, 6vmax) scale(1.15); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.2px; flex-shrink: 0; }
.logo svg { width: 28px; height: 28px; }
.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav > a {
  padding: 8px 13px; border-radius: 10px; color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  white-space: nowrap; transition: color 0.2s, background 0.2s;
}
.main-nav > a:hover, .main-nav > a[aria-current="true"] { color: var(--text); background: var(--panel-strong); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text-2); transition: all 0.2s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* language pill */
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.lang-switch a { padding: 7px 11px; font-size: 0.83rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.lang-switch a[aria-current="true"] { background: var(--grad-brand); color: #fff; }

.nav-toggle { display: none; }

/* mobile-only extras inside the nav drawer */
.nav-extra { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 14px; font-weight: 700; font-size: 0.98rem;
  border: 1px solid transparent; transition: transform 0.18s, box-shadow 0.18s, background 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 30px rgba(109, 92, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(109, 92, 255, 0.5); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--panel-strong); transform: translateY(-1px); }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 16px; }

/* ---------- hero (split: copy + visual) ---------- */
.hero {
  padding: clamp(48px, 7vw, 96px) 0 clamp(36px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 1100px; height: 620px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(109, 92, 255, 0.16), transparent 62%);
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-2);
  font-size: 0.83rem; font-weight: 600; margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.14; font-weight: 800; letter-spacing: -0.02em;
}
.hero .lead { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--text-2); max-width: 540px; margin: 20px 0 30px; }
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 26px; margin-top: 36px; flex-wrap: wrap; }
.hero-trust .stat b { display: block; font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 800; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-trust .stat span { font-size: 0.82rem; color: var(--text-3); }

/* hero visual — CSS-only "mini studio" */
.hero-visual { position: relative; min-height: 420px; }
.hv-card {
  position: absolute; border-radius: 18px; border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--panel-strong), var(--panel));
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-12px); } }
.hv-main {
  top: 4%; left: 4%; right: 14%; bottom: 12%; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; animation-delay: 0.6s;
}
.hv-line { display: flex; align-items: center; gap: 8px; }
.hv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); opacity: 0.85; }
.hv-dot:nth-child(2) { background: var(--accent); }
.hv-dot:nth-child(3) { background: var(--ok); }
.hv-prompt {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft);
  padding: 12px 14px; font-size: 0.82rem; color: var(--text-2); line-height: 1.6;
}
.hv-prompt b { color: var(--text); }
.hv-cursor { display: inline-block; width: 2px; height: 0.95em; background: var(--brand-3); vertical-align: text-bottom; animation: pulse 1.1s infinite; }
.hv-canvas {
  flex: 1; border-radius: 14px; border: 1px solid var(--border); position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(33, 212, 253, 0.4), transparent 46%),
    radial-gradient(circle at 78% 30%, rgba(109, 92, 255, 0.5), transparent 52%),
    radial-gradient(circle at 50% 88%, rgba(180, 76, 255, 0.42), transparent 55%),
    var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}
.hv-canvas::after {
  content: "✦"; font-size: 2rem; color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 26px rgba(180, 76, 255, 0.9); animation: pulse 2.4s infinite;
}
.hv-bar { height: 7px; border-radius: 99px; background: var(--panel-strong); overflow: hidden; }
.hv-bar i { display: block; height: 100%; width: 72%; border-radius: 99px; background: var(--grad-brand); }
.hv-chip {
  position: absolute; z-index: 2; padding: 9px 16px; border-radius: 12px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--border-strong); background: var(--bg-soft); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.hv-chip .k { width: 8px; height: 8px; border-radius: 3px; background: var(--grad-brand); }
.hv-1 { top: 0; right: 0; animation: floaty 6s ease-in-out infinite; }
.hv-2 { bottom: 4%; left: 0; animation: floaty 8s ease-in-out infinite; animation-delay: 1.2s; }
.hv-3 { bottom: 22%; right: 2%; animation: floaty 7.5s ease-in-out infinite; animation-delay: 2s; }
[data-theme="light"] .hv-canvas::after { color: rgba(255,255,255,.95); }

/* ---------- section scaffolding ---------- */
.section { padding: clamp(56px, 8vw, 100px) 0; }
.section-head { text-align: center; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head .eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: transparent; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
  margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.015em; }
.section-head p { color: var(--text-2); max-width: 560px; margin: 14px auto 0; }

/* ---------- studio ---------- */
.studio {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  backdrop-filter: blur(12px); box-shadow: var(--shadow); overflow: hidden;
}
.studio-grid { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 520px; }
.studio-left { padding: clamp(22px, 3.4vw, 36px); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 20px; }
.studio-right { padding: clamp(22px, 3.4vw, 36px); display: flex; flex-direction: column; }

.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.field-label .count { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
textarea#prompt {
  width: 100%; min-height: 120px; resize: vertical; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-family: inherit; font-size: 0.98rem; line-height: 1.55; transition: border 0.2s, box-shadow 0.2s;
}
textarea#prompt:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 92, 255, 0.22); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text-2); font-size: 0.86rem; font-weight: 600; transition: all 0.18s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(109, 92, 255, 0.35); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- graphical ratio picker ---------- */
.ratio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ratio-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px 9px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); transition: all 0.18s; min-width: 0;
}
.ratio-btn:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.ratio-btn.active {
  background: linear-gradient(160deg, rgba(109, 92, 255, 0.22), rgba(33, 212, 253, 0.12));
  border-color: var(--brand); color: var(--text);
  box-shadow: 0 6px 18px rgba(109, 92, 255, 0.3);
}
.ratio-shape { display: flex; align-items: center; justify-content: center; height: 26px; }
.ratio-shape i {
  display: block; border: 2px solid currentColor; border-radius: 4px; opacity: 0.9;
  transition: background 0.18s;
}
.ratio-btn.active .ratio-shape i { background: var(--grad-brand); border-color: transparent; }
.ratio-btn.dashed .ratio-shape i { border-style: dashed; }
.ratio-name { font-size: 0.82rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ratio-note { font-size: 0.68rem; color: var(--text-3); line-height: 1; white-space: nowrap; }
.ratio-btn.active .ratio-note { color: var(--text-2); }
.ratio-btn.locked { opacity: 0.55; }
.ratio-btn.locked .ratio-name::after { content: " 🔒"; font-size: 0.72em; }

.ref-drop {
  border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 18px; text-align: center;
  color: var(--text-3); font-size: 0.88rem; cursor: pointer; transition: all 0.2s; background: var(--panel);
}
.ref-drop:hover, .ref-drop.drag { border-color: var(--brand); color: var(--text-2); background: var(--panel-strong); }
.ref-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ref-thumbs .ref-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); }
.ref-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumbs button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* result canvas */
.result-stage {
  flex: 1; border-radius: 16px; border: 1px solid var(--border); background:
    radial-gradient(circle at 30% 20%, rgba(109, 92, 255, 0.12), transparent 50%),
    radial-gradient(circle at 75% 80%, rgba(33, 212, 253, 0.1), transparent 50%),
    var(--bg-soft);
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 320px; overflow: hidden;
}
.result-stage img.result-img { max-width: 100%; max-height: 480px; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: popIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes popIn { from { opacity: 0; transform: scale(0.94); } }

.result-empty { text-align: center; color: var(--text-3); padding: 30px; }
.result-empty svg { width: 52px; height: 52px; margin: 0 auto 14px; opacity: 0.5; }

/* progress */
.progress-wrap { margin-top: 16px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--panel-strong); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--grad-brand); transition: width 0.5s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-3); margin-top: 8px; }

.result-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.msg { padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; margin-top: 14px; display: none; }
.msg.error { display: block; background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: var(--err); }
.msg.ok { display: block; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--ok); }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px;
  background: var(--panel); transition: transform 0.25s, border 0.25s, background 0.25s;
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--panel-strong); }
.feature-card .f-icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 18px; color: var(--brand-3);
}
.feature-card .f-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.92rem; color: var(--text-2); }

/* ---------- inspiration ---------- */
.insp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.insp-card {
  border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; cursor: pointer;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel)); text-align: left; color: var(--text);
  transition: all 0.25s; position: relative; overflow: hidden;
}
.insp-card::after { content: ""; position: absolute; inset: 0; background: var(--grad-soft); opacity: 0; transition: opacity 0.25s; }
.insp-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.insp-card:hover::after { opacity: 1; }
.insp-card .i-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; position: relative; z-index: 1; }
.insp-card p { font-size: 0.9rem; color: var(--text-2); position: relative; z-index: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.insp-card .i-go { margin-top: 14px; font-size: 0.82rem; font-weight: 700; color: var(--brand-3); position: relative; z-index: 1; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.price-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 28px; background: var(--panel); display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: transparent; background: linear-gradient(var(--bg-soft), var(--bg-soft)) padding-box, var(--grad-brand) border-box; border: 1.6px solid transparent; box-shadow: var(--shadow); }
.price-card .p-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 999px; background: var(--grad-brand); color: #fff; font-size: 0.74rem; font-weight: 700; }
.price-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-2); }
.price-card .p-price { font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 800; margin: 10px 0 2px; }
.price-card .p-price small { font-size: 0.9rem; font-weight: 500; color: var(--text-3); }
.price-card .p-desc { font-size: 0.88rem; color: var(--text-3); margin-bottom: 20px; }
.price-card ul { list-style: none; display: grid; gap: 10px; font-size: 0.92rem; color: var(--text-2); margin-bottom: 26px; flex: 1; }
.price-card ul li::before { content: "✓"; color: var(--ok); margin-right: 9px; font-weight: 700; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); overflow: hidden; }
.faq-item summary {
  padding: 18px 22px; cursor: pointer; font-weight: 700; font-size: 0.98rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; transition: color 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--text-3); transition: transform 0.25s; flex-shrink: 0; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--brand-3); }
.faq-item .faq-a { padding: 0 22px 20px; color: var(--text-2); font-size: 0.92rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 56px 0 34px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.footer-brand p { font-size: 0.88rem; color: var(--text-3); margin-top: 12px; max-width: 300px; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; }
.footer-col a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--text-2); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-3); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- responsive: header & layout ---------- */
@media (max-width: 1120px) {
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 14px 5vw 20px; gap: 4px; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav > a { padding: 12px 14px; font-size: 0.98rem; }
  .nav-toggle { display: inline-flex; }
  .nav-extra {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border);
  }
  .header-actions { margin-left: auto; }
  .header-actions .lang-switch, .header-actions .theme-toggle-desktop { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 960px) {
  .studio-grid { grid-template-columns: 1fr; }
  .studio-left { border-right: none; border-bottom: 1px solid var(--border); }
  .feature-grid, .insp-grid, .price-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .feature-grid, .insp-grid, .price-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .logo span { display: none; }
  .ratio-grid { grid-template-columns: repeat(3, 1fr); }
}

/* skip link (a11y) */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 10px; }
.skip-link:focus { left: 8px; }

/* ============================================================
   Auth / account / commercial UI
   ============================================================ */

/* user area in header */
.user-area { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  font-size: 0.85rem; font-weight: 600; color: var(--text); cursor: pointer; transition: all .2s;
}
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; font-weight: 800;
}
.plan-badge { font-size: 0.66rem; padding: 2px 8px; border-radius: 999px; font-weight: 800; letter-spacing: .04em; }
.plan-badge.free { background: rgba(255,255,255,.1); color: var(--text-2); }
.plan-badge.pro { background: var(--grad-brand); color: #fff; }
[data-theme="light"] .plan-badge.free { background: rgba(15,18,35,.08); }

.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; z-index: 60;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; display: none;
}
.user-menu.open { display: block; }
.user-menu .u-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .u-head b { display: block; font-size: .9rem; }
.user-menu .u-head span { font-size: .76rem; color: var(--text-3); }
.user-menu a, .user-menu button.um-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 9px; font-size: .88rem; color: var(--text-2);
  background: none; border: none; text-align: left; transition: all .15s;
}
.user-menu a:hover, .user-menu button.um-item:hover { background: var(--panel-strong); color: var(--text); }
.user-menu .quota-line { padding: 8px 12px 4px; font-size: .78rem; color: var(--text-3); }
.user-menu .quota-line .qbar { height: 5px; border-radius: 99px; background: var(--panel-strong); margin-top: 6px; overflow: hidden; }
.user-menu .quota-line .qfill { height: 100%; background: var(--grad-brand); border-radius: 99px; }

/* auth modal */
.modal-mask {
  position: fixed; inset: 0; z-index: 120; background: rgba(4,5,10,.7);
  backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 400px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); position: relative;
  animation: popIn .3s cubic-bezier(.2,.9,.3,1.15);
}
.modal h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.modal .m-sub { font-size: .85rem; color: var(--text-3); margin-bottom: 20px; }
.modal .m-close { position: absolute; top: 14px; right: 16px; font-size: 22px; background: none; border: none; color: var(--text-3); }
.modal input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: .93rem; margin-bottom: 12px;
  transition: border .2s, box-shadow .2s;
}
.modal input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,92,255,.2); }
.modal .m-switch { text-align: center; font-size: .84rem; color: var(--text-3); margin-top: 14px; }
.modal .m-switch a { color: var(--brand-3); font-weight: 700; cursor: pointer; }
.modal .m-error { display: none; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: .84rem; background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); color: var(--err); }
.modal .m-error.show { display: block; }
.modal .btn { width: 100%; margin-top: 4px; }

/* locked chips & upgrade prompts */
.chip.locked { opacity: .55; position: relative; }
.chip.locked::after { content: "🔒"; font-size: .72em; margin-left: 5px; }
.chip.locked:hover { border-color: var(--accent); color: var(--accent); }
.upgrade-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 12px; margin-top: 14px;
  background: linear-gradient(90deg, rgba(255,184,107,.12), rgba(109,92,255,.12));
  border: 1px solid rgba(255,184,107,.35); font-size: .85rem; color: var(--text-2);
}
.upgrade-strip b { color: var(--accent); }
.upgrade-strip a { color: var(--brand-3); font-weight: 700; white-space: nowrap; }

/* resolution selector */
.res-group { display: flex; gap: 8px; }
.res-chip {
  flex: 1; text-align: center; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); font-size: .84rem; font-weight: 700; transition: all .18s;
}
.res-chip small { display: block; font-size: .68rem; font-weight: 500; color: var(--text-3); margin-top: 2px; }
.res-chip.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(109,92,255,.35); }
.res-chip.active small { color: rgba(255,255,255,.75); }
.res-chip.locked { opacity: .55; }
.res-chip.locked::after { content: " 🔒"; }
.res-chip:hover:not(.active) { border-color: var(--border-strong); color: var(--text); }

/* account page */
.account-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.account-side { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; background: var(--panel); text-align: center; }
.account-side .big-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 1.6rem; font-weight: 800; color: #fff; }
.account-side h2 { font-size: 1.15rem; }
.account-side .email { font-size: .84rem; color: var(--text-3); margin-bottom: 14px; word-break: break-all; }
.quota-box { text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 16px 0; font-size: .84rem; color: var(--text-2); }
.my-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.my-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); }
.my-card img { aspect-ratio: 1; width: 100%; object-fit: cover; cursor: zoom-in; }
.my-card .mc-body { padding: 10px 12px; font-size: .76rem; color: var(--text-3); }
.my-card .mc-body .p { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Prompt library page
   ============================================================ */
.page-hero { padding: clamp(44px, 6vw, 80px) 0 clamp(20px, 3vw, 36px); text-align: center; position: relative; }
.page-hero::before {
  content: ""; position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 480px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(109, 92, 255, 0.14), transparent 62%);
}
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
.page-hero .ph-sub { color: var(--text-2); max-width: 640px; margin: 16px auto 0; font-size: 1.02rem; }
.ph-stats { display: flex; justify-content: center; gap: clamp(18px, 4vw, 44px); margin-top: 28px; flex-wrap: wrap; }
.ph-stats .stat { display: flex; align-items: baseline; gap: 8px; }
.ph-stats .stat b { font-size: 1.25rem; font-weight: 800; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-stats .stat span { font-size: 0.82rem; color: var(--text-3); }

.pl-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: clamp(18px, 3vw, 30px) 0 22px; }
.pl-search { position: relative; flex: 1; min-width: 240px; }
.pl-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.pl-search input {
  width: 100%; padding: 13px 16px 13px 42px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 0.94rem; font-family: inherit;
  transition: border .2s, box-shadow .2s;
}
.pl-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 92, 255, 0.22); }

.pl-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.pl-cat {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text-2); font-size: 0.87rem; font-weight: 600; transition: all 0.18s;
}
.pl-cat:hover { border-color: var(--border-strong); color: var(--text); }
.pl-cat.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(109, 92, 255, 0.35); }

.pl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.pl-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.22s, border 0.22s, background 0.22s;
}
.pl-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--panel-strong); }
.pl-card.hidden { display: none; }
.pl-card .pl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pl-tag {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; padding: 4px 11px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand-3);
}
.pl-card h3 { font-size: 1.02rem; font-weight: 700; }
.pl-text {
  font-size: 0.88rem; color: var(--text-2); line-height: 1.7;
  border-left: 3px solid var(--brand); padding: 4px 0 4px 14px;
}
.pl-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.pl-ratio-hint { font-size: 0.76rem; color: var(--text-3); }
.pl-actions { display: flex; gap: 8px; }
.pl-actions .btn { padding: 7px 14px; font-size: 0.8rem; border-radius: 10px; }
.pl-copy-btn.copied { background: var(--grad-brand); border-color: transparent; color: #fff; }
.pl-empty { text-align: center; color: var(--text-3); padding: 50px 0; display: none; }
.pl-empty.show { display: block; }

@media (max-width: 900px) { .pl-grid { grid-template-columns: 1fr; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 10, 0.88); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; padding: 4vmin; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 14px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); }
.lightbox .lb-close { position: absolute; top: 18px; right: 22px; font-size: 30px; color: #fff; background: none; border: none; }

/* ============================================================
   AI 学院 / Blog — 长文排版、目录、卡片
   ============================================================ */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-3); padding: 26px 0 0; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--brand-3); }
.crumbs span[aria-current] { color: var(--text-2); }

/* ---- hub ---- */
.blog-hero { padding: 0 0 10px; }
.blog-hero .eyebrow { display: inline-block; margin: 18px 0 14px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-3); }
.blog-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; max-width: 15em; }
.blog-hero .lead { margin-top: 16px; max-width: 62ch; color: var(--text-2); font-size: clamp(0.95rem, 1.4vw, 1.06rem); line-height: 1.85; }
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.blog-topics span { font-size: 0.76rem; font-weight: 600; color: var(--text-2); border: 1px solid var(--border); background: var(--panel); padding: 6px 13px; border-radius: 999px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.blog-card { display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 22px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--panel); transition: transform .22s, border-color .22s, background .22s; }
.blog-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--panel-strong); }
.bc-cat { align-self: flex-start; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; padding: 4px 11px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand-3); }
.blog-card h3 { font-size: 1.16rem; line-height: 1.45; font-weight: 750; }
.blog-card p { font-size: 0.9rem; color: var(--text-2); line-height: 1.75; }
.bc-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; font-size: 0.76rem; color: var(--text-3); }
.bc-meta i { margin-left: auto; font-style: normal; font-weight: 700; color: var(--brand-3); }
.blog-note { margin-top: 30px; padding: 28px 30px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--panel); }
.blog-note h2 { font-size: 1.2rem; font-weight: 750; margin-bottom: 10px; }
.blog-note p { color: var(--text-2); font-size: 0.92rem; line-height: 1.85; margin-bottom: 8px; }
.blog-note a { color: var(--brand-3); }

/* ---- article ---- */
.post-wrap { padding-bottom: 40px; }
.post { display: block; padding: 22px 0 0; }
.post-head { max-width: 52em; }
.post-cat { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--brand-3); }
.post-head h1 { margin: 16px 0 14px; font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.22; font-weight: 800; letter-spacing: -0.02em; }
.post-lead { font-size: clamp(0.96rem, 1.5vw, 1.08rem); line-height: 1.85; color: var(--text-2); }
.post-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--border); font-size: 0.78rem; color: var(--text-3); }

.post-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 46px; align-items: start; margin-top: 30px; }
.post-toc { position: sticky; top: calc(var(--header-h) + 22px); border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 18px 20px; }
.post-toc b { display: block; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.post-toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 9px; }
.post-toc li { counter-increment: toc; font-size: 0.84rem; line-height: 1.5; }
.post-toc li::before { content: counter(toc) ". "; color: var(--text-3); }
.post-toc a { color: var(--text-2); }
.post-toc a:hover { color: var(--brand-3); }

.post-body { max-width: 46em; font-size: 1rem; line-height: 1.92; color: var(--text-2); }
.post-body h2 { margin: 46px 0 14px; font-size: clamp(1.22rem, 2.1vw, 1.46rem); line-height: 1.35; font-weight: 750; color: var(--text); scroll-margin-top: calc(var(--header-h) + 20px); }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { margin: 28px 0 10px; font-size: 1.04rem; font-weight: 700; color: var(--text); }
.post-body p { margin-bottom: 16px; }
.post-body strong { color: var(--text); font-weight: 700; }
.post-body a { color: var(--brand-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { color: var(--brand); }
.post-body ul, .post-body ol { margin: 0 0 18px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.post-body ul li { list-style: none; position: relative; padding-left: 6px; }
.post-body ul li::before { content: ""; position: absolute; left: -12px; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.post-body pre { margin: 0 0 20px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-soft); overflow-x: auto; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; }
.post-body p code { background: var(--panel-strong); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border); border-radius: 14px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 520px; }
.post-body th, .post-body td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.post-body th { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--panel); font-weight: 700; }
.post-body tr:last-child td { border-bottom: none; }
.callout { margin: 0 0 22px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); border-left: 3px solid var(--brand-3); background: var(--grad-soft); font-size: 0.92rem; line-height: 1.8; color: var(--text-2); }
.callout b { color: var(--text); }

.post-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 54px 0 0; padding: 30px 32px; border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--grad-soft); }
.post-cta b { display: block; font-size: 1.18rem; font-weight: 780; margin-bottom: 8px; }
.post-cta p { font-size: 0.9rem; color: var(--text-2); line-height: 1.75; max-width: 46ch; }
.related { margin-top: 40px; }
.related h2 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.related-card { display: flex; flex-direction: column; gap: 7px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); margin-bottom: 12px; transition: border-color .2s, background .2s; }
.related-card:hover { border-color: var(--border-strong); background: var(--panel-strong); }
.related-card span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: var(--brand-3); text-transform: uppercase; }
.related-card b { font-size: 1rem; font-weight: 700; line-height: 1.5; }
.related-card i { font-style: normal; font-size: 0.8rem; color: var(--text-3); }

@media (max-width: 980px) {
  .post-layout { grid-template-columns: 1fr; gap: 24px; }
  .post-toc { position: static; order: -1; }
  .post-toc ol { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .post-body { max-width: none; }
}
@media (max-width: 640px) {
  .blog-card { padding: 22px 20px; }
  .post-cta { padding: 24px 22px; }
  .post-body { font-size: 0.96rem; }
}

/* ============================================================
   全站公告条（后台「网站设置 → 公告」控制）
   ============================================================ */
.nc-announce {
  position: relative; z-index: 60;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.18), rgba(75, 214, 255, 0.14));
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  font-size: 0.82rem;
}
.nc-announce-in {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; color: var(--text-2, #9aa4ba);
}
.nc-announce-in .dot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-3, #7c5cff); box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}
.nc-announce-in a { color: var(--brand-3, #9c8bff); font-weight: 600; white-space: nowrap; }
.nc-announce-x {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-3, #6a7488); font-size: 0.9rem; padding: 2px 6px; border-radius: 6px;
}
.nc-announce-x:hover { color: var(--text, #e9edf7); background: rgba(255,255,255,.06); }
@media (max-width: 640px) {
  .nc-announce-in { font-size: 0.76rem; gap: 8px; }
  .nc-announce-in a { display: none; }
}
