/* Public palettes. Scope is installed only on public routes by frontend-theme.js. */
.model-square{height:calc(100dvh - 68px - var(--announcement-banner-height,0px));overflow-y:auto;min-width:0;padding:32px clamp(16px,3vw,40px);color:var(--foreground)}
.model-square-heading,.model-square-toolbar,.model-square-count,.model-square-grid,.model-square-empty{max-width:1240px;margin-left:auto;margin-right:auto}
.model-square-heading h1{font-size:28px;font-weight:700;margin:8px 0}.model-square-heading>p{color:var(--muted-foreground);font-size:14px;line-height:1.7}.model-square-eyebrow{letter-spacing:.12em;font-size:10px!important;color:var(--primary)!important;font-weight:700}
.model-square-toolbar{display:flex;flex-wrap:wrap;gap:16px;align-items:center;margin-top:28px}.model-square-toolbar input{flex:1;min-width:180px;max-width:520px;height:44px;border:1px solid var(--border);border-radius:10px;background:var(--card);padding:0 14px;color:var(--foreground);outline:none}.model-square-toolbar input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 15%,transparent)}
.model-square-tabs{display:flex;flex-wrap:wrap;gap:6px}.model-square-tabs button{padding:9px 12px;border-radius:8px;font-size:12px;border:1px solid var(--border);background:var(--card);cursor:pointer}.model-square-tabs button[aria-pressed=true]{color:var(--primary-foreground);background:var(--primary);border-color:var(--primary)}
.model-square-count{font-size:12px;color:var(--muted-foreground);margin-top:20px;margin-bottom:12px}.model-square-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:16px;padding-bottom:28px}.model-square-card{min-width:0;border:1px solid var(--border);border-radius:16px;padding:22px;background:var(--card);box-shadow:0 3px 18px #00000004}.model-square-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.model-square-kind{font-size:11px;font-weight:600;color:var(--primary);background:color-mix(in srgb,var(--primary) 8%,transparent);border-radius:6px;padding:4px 8px}.model-square-status{font-size:11px;color:var(--muted-foreground)}.model-square-status:before{content:'●';margin-right:5px;color:#94a3b8}.model-square-status.open:before{color:#10b981}.model-square-card h2{font-size:17px;font-weight:650;line-height:1.5;margin:18px 0 4px;overflow-wrap:anywhere}.model-square-id{font-family:monospace;font-size:11px;color:var(--muted-foreground);overflow-wrap:anywhere}.model-square-price{font-size:16px;font-weight:650;margin:22px 0 12px;color:var(--primary);overflow-wrap:anywhere}.model-square-description{font-size:12px;line-height:1.7;color:var(--muted-foreground);overflow-wrap:anywhere}.model-square-capabilities{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}.model-square-capabilities span{font-size:10px;padding:3px 7px;border:1px solid var(--border);border-radius:5px;color:var(--muted-foreground);overflow-wrap:anywhere;max-width:100%}.model-square-empty{text-align:center;border:1px dashed var(--border);padding:48px 16px;border-radius:14px;color:var(--muted-foreground)}.model-square-empty button{margin-top:16px}
@media(max-width:767px){.model-square{height:calc(100dvh - 56px - var(--announcement-banner-height,0px));padding:24px 16px}.model-square-toolbar{gap:12px;margin-top:22px}.model-square-toolbar input{flex-basis:100%;max-width:100%}.model-square-heading h1{font-size:25px}.model-square-card{padding:20px}}

html[data-frontend-theme="light"] {
  color-scheme: light;
  --background: #f4f6fa;
  --foreground: #202938;
  --card: #fff;
  --card-foreground: #202938;
  --popover: #fff;
  --popover-foreground: #202938;
  --primary: #3730a3;
  --primary-foreground: #fff;
  --secondary: #eef1f6;
  --secondary-foreground: #374256;
  --muted: #eef1f6;
  --muted-foreground: #697386;
  --accent: #eeedf9;
  --accent-foreground: #3730a3;
  --border: #dfe3eb;
  --input: #d7dce6;
  --ring: #7772c6;
  --destructive: #b42332;
  --chart-1: #3730a3;
  --chart-2: #287448;
  --chart-3: #b7791f;
  --chart-4: #b42332;
  --chart-5: #8056b8;
  --sidebar: #fff;
  --sidebar-foreground: #4b566b;
  --sidebar-primary: #3730a3;
  --sidebar-primary-foreground: #fff;
  --sidebar-accent: #eeedf9;
  --sidebar-accent-foreground: #3730a3;
  --sidebar-border: #dfe3eb;
  --sidebar-ring: #7772c6;
  --workspace-backdrop: #f4f6fa;
  --workspace-pattern: transparent;
  --workspace-pattern-major: transparent;
  --ui-control-shadow: 0 1px 2px #20293808;
  --ui-control-shadow-hover: 0 3px 10px #20293810;
  --ui-panel-shadow: 0 2px 8px #20293808;
  --ui-panel-shadow-hover: 0 5px 16px #20293810;
  --ui-overlay-shadow: 0 24px 70px #20293826;
  --ui-overlay-shadow-hover: 0 28px 80px #20293830;
}
html[data-frontend-theme] body { background: var(--background); color: var(--foreground); }
html[data-frontend-theme] .app-workspace-backdrop { background: var(--background); }
/* Auth pages originally define an independent green palette in inline styles. */
html[data-frontend-theme="light"] section[style*="--auth-brand-panel"] {
  --auth-brand-panel: #eeedf9 !important;
  --auth-brand-muted: #697386 !important;
  --background: #fff !important;
  --foreground: #202938 !important;
  --primary: #3730a3 !important;
  --primary-foreground: #fff !important;
  --muted-foreground: #697386 !important;
  --border: #dfe3eb !important;
  --input: #d7dce6 !important;
  --ring: #7772c6 !important;
}
html[data-frontend-theme] section[style*="--auth-brand-panel"] aside { color: #fff; --auth-brand-muted: #fff; }
/* The image studio uses explicit neutral utility classes for its primary actions. */
html[data-frontend-theme] :is(button,a[data-slot="button"]):is(.bg-stone-950,.bg-stone-900,.bg-zinc-950,.bg-black) {
  background-color: var(--primary); color: var(--primary-foreground);
}
html[data-frontend-theme] :is(button,a[data-slot="button"]):is(.bg-stone-950,.bg-stone-900,.bg-zinc-950,.bg-black):hover { background-color: #2e278d; }
/* Only the coordinator owns the public toggle. Keep any obsolete captured control hidden. */
html[data-frontend-theme] button:is([aria-label="切换到浅色主题"],[aria-label="切换到深色主题"]):not(#site-theme-toggle) { display: none; }
/* Landing module has a separate captured stylesheet. Preserve photo overlays. */
html[data-frontend-theme] :is([class*="__canvas"],[class*="__loading"]) { background-color: var(--background); color: var(--foreground); }
html[data-frontend-theme] :is([class*="__nav"],[class*="__mobileNav"]) { border-color: var(--border); }
html[data-frontend-theme] :is([class$="__nav"],[class$="__mobileNav"]) { background: #ffffffed; }
html[data-frontend-theme] :is([class$="__brand"],[class$="__mobileMenuButton"]) { color: var(--foreground); }
html[data-frontend-theme] :is([class$="__navLink"],[class$="__mobileNav"] a,[class$="__featureCopy"] p,[class$="__flowIntro"] p,[class$="__sources"] p,[class$="__closing"] p,[class$="__sourceLine"] small) { color: var(--muted-foreground); }
html[data-frontend-theme] :is([class$="__flowIntro"] small,[class$="__featureCopy"]>small,[class$="__galleryLink"],[class$="__sourceLine"] strong) { color: var(--primary); }
html[data-frontend-theme] :is([class$="__join"],[class$="__createButton"],[class$="__closingActions"] a:first-child) { color: #fff; background: var(--primary); border-color: var(--primary); }
html[data-frontend-theme] :is([class$="__join"],[class$="__createButton"],[class$="__closingActions"] a:first-child):hover { background: #2e278d; border-color: #2e278d; }
html[data-frontend-theme] :is([class$="__login"],[class$="__closingActions"] a) { color: var(--foreground); border-color: var(--border); }
html[data-frontend-theme] :is([class$="__altFeature"],[class$="__sources"],[class$="__closing"],[class$="__bubble"]) { background: var(--secondary); color: var(--foreground); border-color: var(--border); }
html[data-frontend-theme] [class$="__marquee"]::before { background: linear-gradient(90deg,var(--background),transparent); }
html[data-frontend-theme] [class$="__marquee"]::after { background: linear-gradient(-90deg,var(--background),transparent); }
html[data-frontend-theme] :is(input[type="checkbox"],input[type="radio"]) { accent-color: var(--primary); }
/* Standalone account points history uses plain HTML rather than Tailwind. */
html[data-frontend-theme] body:has(#rows) section { border-color: var(--border); }
html[data-frontend-theme] body:has(#rows) :is(th,td) { border-color: var(--border); }
html[data-frontend-theme] body:has(#rows) th { background: var(--muted); color: var(--muted-foreground); }
html[data-frontend-theme] body:has(#rows) :is(#prev,#next,#refresh) { border: 1px solid var(--border); border-radius: 7px; background: var(--card); color: var(--foreground); }
html[data-frontend-theme] body:has(#rows) #refresh { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
html[data-frontend-theme] body:has(#rows) button:disabled { opacity: .45; }
html[data-frontend-theme] body:has(#rows)>a { color: var(--primary); }

html[data-frontend-theme="dark"] {
  color-scheme: dark;
  --background: #111827; --foreground: #edf2f9;
  --card: #1b2230; --card-foreground: #edf2f9;
  --popover: #1b2230; --popover-foreground: #edf2f9;
  --primary: #6253c7; --primary-foreground: #fff;
  --secondary: #242e40; --secondary-foreground: #e2e8f0;
  --muted: #242e40; --muted-foreground: #adb9cc;
  --accent: #302c50; --accent-foreground: #bdb7ff;
  --border: #334155; --input: #41516a; --ring: #9b95ff;
  --destructive: #b42332;
  --sidebar: #1b2230; --sidebar-foreground: #d9e2ef;
  --sidebar-primary: #bdb7ff; --sidebar-primary-foreground: #111827;
  --sidebar-accent: #302c50; --sidebar-accent-foreground: #d9d5ff;
  --sidebar-border: #334155; --sidebar-ring: #9b95ff;
  --workspace-backdrop: #111827; --workspace-pattern: transparent; --workspace-pattern-major: transparent;
  --ui-control-shadow: 0 1px 2px #0003; --ui-control-shadow-hover: 0 3px 10px #0004;
  --ui-panel-shadow: 0 2px 8px #0003; --ui-panel-shadow-hover: 0 5px 16px #0004;
  --ui-overlay-shadow: 0 24px 70px #0007; --ui-overlay-shadow-hover: 0 28px 80px #0008;
}
html[data-frontend-theme="dark"] section[style*="--auth-brand-panel"] {
  --auth-brand-panel: #24243b !important; --auth-brand-muted: #adb9cc !important;
  --background: #1b2230 !important; --foreground: #edf2f9 !important;
  --primary: #6253c7 !important; --primary-foreground: #fff !important;
  --muted-foreground: #adb9cc !important; --border: #334155 !important;
  --input: #41516a !important; --ring: #9b95ff !important;
}
html[data-frontend-theme="dark"] :is([class$="__nav"],[class$="__mobileNav"]) { background: #1b2230f2; }
html[data-frontend-theme="dark"] :is([class$="__hero"],[class$="__flow"],[class$="__feature"],[class$="__gallery"]) { color: var(--foreground); }
/* Explicit neutral utilities in the image workspace and captured public pages.
   Match tokens, not image elements or status colors. */
html[data-frontend-theme="dark"] :is(.bg-white,[class~="bg-white/92"],[class~="bg-white/95"],[class~="bg-white/90"],[class~="bg-white/80"],.bg-stone-50,.bg-gray-50,.bg-zinc-50,.bg-slate-50,[class~="bg-[#fff]"],[class~="bg-[#ffffff]"]) { background-color: var(--card) !important; }
html[data-frontend-theme="dark"] :is(.bg-stone-100,.bg-gray-100,.bg-zinc-100,.bg-slate-100,[class~="bg-stone-50/80"]) { background-color: var(--muted) !important; }
html[data-frontend-theme="dark"] :is(.text-stone-950,.text-stone-900,.text-stone-800,.text-stone-700,.text-gray-950,.text-gray-900,.text-gray-800,.text-gray-700,.text-zinc-900,.text-slate-900,.text-black) { color: var(--foreground) !important; }
html[data-frontend-theme="dark"] :is(.text-stone-600,.text-stone-500,.text-stone-400,.text-gray-600,.text-gray-500,.text-zinc-500,.text-slate-500) { color: var(--muted-foreground) !important; }
html[data-frontend-theme="dark"] :is(.border-stone-200,.border-gray-200,.border-zinc-200,.border-slate-200,[class~="border-stone-200/90"],[class~="border-[#e5e9ed]"]) { border-color: var(--border) !important; }
html[data-frontend-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) { background-color: var(--card); color: var(--foreground); border-color: var(--input); }
html[data-frontend-theme="dark"] :is(dialog,[role="dialog"],[data-slot="dialog-content"],table) { background-color: var(--card); color: var(--foreground); border-color: var(--border); }
html[data-frontend-theme="dark"] .text-primary { color: #bdb7ff; }
html[data-frontend-theme="dark"] :is(button,a[data-slot="button"]):is(.bg-stone-950,.bg-stone-900,.bg-zinc-950,.bg-black):hover { background-color: #5545b6; }
html[data-frontend-theme] #site-theme-toggle {
  display: inline-flex !important; align-items: center; justify-content: center;
  flex-shrink: 0; gap: 4px; min-height: 34px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--foreground); font: 500 12px/1.2 system-ui,sans-serif; white-space: nowrap;
  cursor: pointer; pointer-events: auto; box-shadow: var(--ui-control-shadow);
}
html[data-frontend-theme] #site-theme-toggle:hover { background: var(--accent); color: var(--accent-foreground); }
html[data-frontend-theme] #site-theme-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
html[data-frontend-theme] #site-theme-toggle[data-position="inline"] { margin-left: 8px; }
html[data-frontend-theme] #site-theme-toggle[data-position="auth"] { position: fixed; top: max(16px,env(safe-area-inset-top)); right: 18px; z-index: 60; }
html[data-frontend-theme] #site-theme-toggle[data-position="floating"] { position: fixed; bottom: max(16px,env(safe-area-inset-bottom)); left: 16px; z-index: 40; }
@media(max-width: 640px) {
  html[data-frontend-theme] #site-theme-toggle { min-height: 36px; padding: 6px 8px; font-size: 11px; }
  html[data-frontend-theme] #site-theme-toggle[data-position="inline"] { margin-left: 0; }
}
/* Tailwind's uncoloured border utilities fall back to currentColor (nearly white).
   Only neutral UI borders are retokenized; media pixels and semantic borders are untouched. */
html[data-frontend-theme="dark"] :is(.border,.border-t,.border-r,.border-b,.border-l,.border-x,.border-y,.border-2):not([class*="border-border"]):not([class*="border-input"]):not([class*="border-primary"]):not([class*="border-destructive"]):not([class*="border-warning"]):not([class*="border-success"]):not([class*="border-red"]):not([class*="border-green"]):not([class*="border-amber"]):not([class*="border-transparent"]):not([class*="border-current"]):not([class*="border-foreground"]):not([class*="border-[#"]):not(img):not(video):not(canvas) { border-color: var(--border); }
html[data-frontend-theme="dark"] :is(.border-white,.border-stone-100,.border-stone-300,.border-gray-100,.border-gray-300,.border-zinc-100,.border-zinc-300,[class~="border-white/10"],[class~="border-white/20"],[class~="border-stone-200/80"],[class~="border-stone-300/70"]) { border-color: var(--border) !important; }
html[data-frontend-theme="dark"] :is([data-slot="dialog-content"],[data-slot="alert-dialog-content"],[data-slot="select-content"],[data-slot="dropdown-menu-content"],[data-slot="popover-content"],[role="listbox"],.react-flow__node,[data-testid="rf__wrapper"] .react-flow__controls) { border-color: var(--border); }
html[data-frontend-theme="dark"] :is(input,textarea,select)[aria-invalid="true"] { border-color: var(--destructive); }
html[data-frontend-theme="dark"] :is(input,textarea,select):focus-visible:not([aria-invalid="true"]) { border-color: var(--ring); --tw-ring-color: color-mix(in srgb,var(--ring) 45%,transparent); }
html[data-frontend-theme="dark"] :is([class~="ring-stone-200"],[class~="ring-stone-300/70"]) { --tw-ring-color: var(--border); }
html[data-frontend-theme="dark"] :is([class~="focus-visible:ring-stone-200/80"],[class~="focus-visible:ring-stone-200"],[class~="focus-visible:border-stone-300"]):focus-visible { border-color: var(--ring); --tw-ring-color: color-mix(in srgb,var(--ring) 45%,transparent); }
/* Short feedback only on actual controls; nested labels/icons never scale separately. */
html[data-frontend-theme] :is(button[data-slot="button"],a[data-slot="button"],nav[aria-label="产品导航"] a,#site-theme-toggle) {
  transition-property: transform, color, background-color, border-color, box-shadow;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}
html[data-frontend-theme] :is(button[data-slot="button"],a[data-slot="button"],nav[aria-label="产品导航"] a,#site-theme-toggle):not(:disabled):not([aria-disabled="true"]):active {
  transform: scale(.98);
}
@media (prefers-reduced-motion: reduce) {
  html[data-frontend-theme] :is(button[data-slot="button"],a[data-slot="button"],nav[aria-label="产品导航"] a,#site-theme-toggle) {
    transition: none;
    transform: none !important;
  }
  /* The exported route progress strip is a direct, aria-hidden body child. */
  body > div[aria-hidden="true"].pointer-events-none.fixed.inset-x-0.top-0,
  body > div[aria-hidden="true"].pointer-events-none.fixed.inset-x-0.top-0 > div { transition: none !important; }
}
/* Auth fields must resolve their foreground again after a live dark-to-light switch. */
html[data-frontend-theme="light"] section[style*="--auth-brand-panel"] :is(input,textarea,select) { color: #202938; }

/* Authentication sky: decorative layers remain behind the form and never capture input. */
html:has(section[style*="--auth-brand-panel"]){background:#050a19!important;color-scheme:dark}
body:has(section[style*="--auth-brand-panel"]){background:radial-gradient(ellipse at 18% 25%,#152747 0,transparent 48%),radial-gradient(ellipse at 85% 85%,#181431 0,transparent 50%),#050a19!important;isolation:isolate;min-height:100svh}
body:has(section[style*="--auth-brand-panel"])::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background-image:radial-gradient(1.5px 1.5px at 12% 18%,#fff 95%,transparent),radial-gradient(1px 1px at 46% 32%,#b5d8ff 95%,transparent),radial-gradient(1px 1px at 78% 72%,#fff 95%,transparent),radial-gradient(1.2px 1.2px at 30% 80%,#a9c8ff 95%,transparent),radial-gradient(1px 1px at 83% 20%,#dfeaff 95%,transparent);background-size:263px 229px,173px 197px,307px 283px,353px 311px,419px 367px;opacity:.8;animation:auth-sky-twinkle 7s ease-in-out infinite alternate,auth-sky-drift 65s linear infinite}
body:has(section[style*="--auth-brand-panel"])::after{content:"";position:fixed;top:10%;left:-220px;width:210px;height:2px;z-index:-1;pointer-events:none;border-radius:100%;background:linear-gradient(90deg,transparent,#b7d9ff 80%,#fff);box-shadow:0 0 8px #8bc6ff,180px 210px 2px #b6dbff,-350px 440px 1px #91baff,430px -180px 1px #b5dbff;opacity:0;transform:rotate(18deg);animation:auth-sky-meteor 5.8s linear infinite}
body:has(section[style*="--auth-brand-panel"]) main[data-variant="auth"]{background:transparent!important}
@keyframes auth-sky-twinkle{from{opacity:.45}to{opacity:.9}}
@keyframes auth-sky-drift{from{background-position:0 0,0 0,0 0,0 0,0 0}to{background-position:263px 50px,173px 28px,307px 65px,353px 42px,419px 80px}}
@keyframes auth-sky-meteor{0%,6%{opacity:0;transform:translate(-20vw,-12vh) rotate(18deg)}10%{opacity:.95}38%{opacity:.85}48%,100%{opacity:0;transform:translate(135vw,38vh) rotate(18deg)}}
body:has(section[style*="--auth-brand-panel"]) main::before{content:"";position:fixed;inset:-15%;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 25% 35%,#284c9233,transparent 45%),radial-gradient(ellipse at 75% 60%,#7656a326,transparent 42%);animation:auth-sky-nebula 24s ease-in-out infinite alternate}
body:has(section[style*="--auth-brand-panel"]) main::after{content:"";position:fixed;left:-170px;top:46%;width:145px;height:1px;z-index:-1;pointer-events:none;border-radius:100%;background:linear-gradient(90deg,transparent,#c6e8ff);box-shadow:0 0 7px #b5dfff,-220px 240px 1px #9dcaff,330px -300px 1px #aacbff;opacity:0;animation:auth-sky-meteor-soft 7.4s 2.1s linear infinite}
@keyframes auth-sky-meteor-soft{0%,12%{opacity:0;transform:translate(-15vw,-15vh) rotate(12deg)}16%,40%{opacity:.65}55%,100%{opacity:0;transform:translate(135vw,23vh) rotate(12deg)}}
@keyframes auth-sky-nebula{from{opacity:.4;transform:translate3d(-3%,-2%,0) scale(1)}to{opacity:.85;transform:translate3d(4%,3%,0) scale(1.08)}}
@media(prefers-reduced-motion:reduce){body:has(section[style*="--auth-brand-panel"]) main::before{animation:none;opacity:.35}body:has(section[style*="--auth-brand-panel"]) main::after{display:none;animation:none}}
@media(max-width:767px){body:has(section[style*="--auth-brand-panel"])::after{width:125px;animation-duration:9s}}
@media(prefers-reduced-motion:reduce){body:has(section[style*="--auth-brand-panel"])::before{animation:none;opacity:.65}body:has(section[style*="--auth-brand-panel"])::after{display:none;animation:none}}

body:has(section[style*="--auth-brand-panel"]) main{background:transparent!important}
