/* Brand tokens shared by the home page and creator tools. */
:root {
  --brand-bg: #111218;
  --brand-header: #15161e;
  --brand-surface: #1a1c25;
  --brand-raised: #212330;
  --brand-input: #14151d;
  --brand-line: #393b4c;
  --brand-text: #f4f1fa;
  --brand-muted: #b4b7c9;
  --brand-accent: #c5b2ff;
  --brand-active: #352a4c;
  --brand-on-accent: #221636;
  --brand-danger: #ffacba;
  --brand-radius: 16px;
  --brand-font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root:has(.workspace-theme,.home-theme,.studio-theme) { background: var(--brand-bg); }
body.workspace-theme, body.home-theme, body.studio-theme {
  min-height: 100vh;
  color-scheme: dark;
  background: var(--brand-bg);
  color: var(--brand-text);
  font-family: var(--brand-font);
}
.workspace-theme > header {
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: var(--brand-header);
  border-color: var(--brand-line);
  flex-wrap: wrap;
  gap: 8px 20px;
}
.workspace-theme > header a { display: inline-flex; align-items: center; gap: 9px; color: var(--brand-text); }
.workspace-theme > header a::before {
  content: ""; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg,var(--brand-accent) 0 48%,#8b74ed 49% 100%);
}
.workspace-theme > header span,
.workspace-theme :is(p,small) { color: var(--brand-muted); }
.shell { display: grid; grid-template-columns: 202px minmax(0,1fr); max-width: 1500px; margin: auto; }
.shell nav { display: grid; align-content: start; gap: 5px; padding: 28px 12px; border-inline-end: 1px solid var(--brand-line); }
.shell nav a { color: var(--brand-muted); padding: 9px 12px; border-radius: 9px; text-decoration: none; }
.shell nav a:hover { background: var(--brand-raised); color: var(--brand-text); }
.shell nav a[aria-current=page] { background: var(--brand-active); color: var(--brand-text); font-weight: 700; }
.shell main, .creative-dark .shell main.workspace { width: 100%; min-width: 0; max-width: 1320px; margin: 0 auto; padding: clamp(22px, 3vw, 38px) clamp(14px, 3vw, 34px) 48px; }
.shell main .intro { margin: 0 0 24px; }
.shell main .intro h1 { font-size: clamp(2rem, 3.5vw, 3.25rem); line-height: 1.12; letter-spacing: -.035em; }
.shell .eyebrow, .shell main a { color: var(--brand-accent); }
.shell .panel, .shell .tile, .shell :is(.job,.shot) {
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius);
  min-width: 0;
}
.shell .panel { padding: clamp(15px, 2vw, 22px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 12px; }
.shell .tile { display: grid; gap: 8px; padding: 14px; background: var(--brand-raised); text-decoration: none; }
.shell a.tile:hover { border-color: var(--brand-accent); }
.tile p { margin: 0; }
.tile small, pre { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; font: inherit; }
.tile img,.tile video { width: 100%; max-height: 180px; object-fit: contain; }
.stack { display: grid; gap: 12px; margin-bottom: 18px; }
.stack label { display: grid; gap: 5px; }
.shell .card-role { border-top-color: #b896ff; }
.shell .card-shot { border-top-color: #82aeed; }
.shell .card-scene { border-top-color: #7bc6a9; }
.shell :is(input:not([type=file]),select,textarea) {
  font: inherit; min-width: 0; border: 1px solid var(--brand-line); border-radius: 9px;
  background: var(--brand-input); color: var(--brand-text); padding: 8px 10px;
}
.shell textarea { width: 100%; min-height: 105px; resize: vertical; }
.shell textarea.prompt { padding: 14px; }
.shell input[type=file] { max-width: 100%; }
.shell fieldset { min-width: 0; border: 1px solid var(--brand-line); border-radius: 12px; }
.shell :is(button,.upload,#download) {
  background: var(--brand-raised); border: 1px solid var(--brand-line); color: var(--brand-text);
  border-radius: 9px; font-weight: 600;
}
.shell :is(button,.upload,#download):hover:not(:disabled) { border-color: var(--brand-accent); }
.shell :is(#send,#submit,#export), .shell form > button:not([type=button]), .shell form > div > button:not([type=button]):first-child {
  background: var(--brand-accent); color: var(--brand-on-accent); border-color: transparent;
}
.shell button:disabled { opacity: .55; cursor: default; }
:is(.workspace-theme,.home-theme,.studio-theme) :focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.row { margin-bottom: 8px; }
.shell .error { color: var(--brand-danger); }
@media (max-width: 750px) {
  .shell { display: block; }
  .shell nav { display: flex; overflow-x: auto; padding: 8px 14px; white-space: nowrap; background: var(--brand-header); border-inline-end: 0; border-bottom: 1px solid var(--brand-line); }
}

/* The home page keeps its illustrated sections and uses the same chrome and controls. */
.home-theme :is(.site-header,.site-footer,.site-header.menu-open .site-nav,.site-header.menu-open .header-actions) {
  background: var(--brand-header); border-color: var(--brand-line);
}
.home-theme :is(.platform,.compute,.intro-strip) { background: var(--brand-bg); border-color: var(--brand-line); }
.home-theme :is(.product-card,.plan-card) { background: var(--brand-surface); border-color: var(--brand-line); border-radius: var(--brand-radius); }
.home-theme :is(.section-heading h2,.compute h2,.intro-strip p,.product-info h3,.plan-card h3) { color: var(--brand-text); }
.home-theme :is(.section-heading p,.section-heading h2 span,.compute h2 span,.compute p,.compute-stats small,.compute-stats b,.intro-strip div,.product-info p,.product-tag,.card-index,.dark-eye,.plan-card p,.plan-card li) { color: var(--brand-muted); }
.home-theme :is(.button-light,.button-dark,.button-violet) { background: var(--brand-accent); color: var(--brand-on-accent); border-radius: 9px; }
.home-theme :is(.text-link,.card-open) { color: var(--brand-accent); }
.home-theme .card-open { border-color: var(--brand-line); }

/* The original studio uses its own layout with the shared brand palette. */
:root:has(.studio-theme) {
  --bg: var(--brand-bg);
  --panel: var(--brand-surface);
  --panel2: var(--brand-raised);
  --line: var(--brand-line);
  --text: var(--brand-text);
  --muted: var(--brand-muted);
  --subtle: #a3a6b9;
  --purple: var(--brand-accent);
  --radius: var(--brand-radius);
}
.studio-theme :is(.sidebar,.topbar) { background: var(--brand-header); }
