:root {
  color-scheme: light;
  --bg: #f7faf2;
  --ink: #14221b;
  --muted: #68726a;
  --line: #d8e1d2;
  --panel: #fffefa;
  --panel-soft: rgba(255, 254, 250, 0.76);
  --green: #0f5132;
  --green-soft: #edf6e9;
  --mint: #8be0b0;
  --watermelon: #ff5f6d;
  --watermelon-deep: #d9364a;
  --rind: #0d6b43;
  --blue: #4b78d8;
  --soft-line: rgba(15, 81, 50, 0.095);
  --soft-panel: rgba(255, 254, 250, 0.5);
  --shadow: 0 22px 70px rgba(19, 42, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='960' height='620' viewBox='0 0 960 620' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke-linejoin='round' stroke-linecap='round'%3E%3Cg opacity='.52' transform='translate(76 78) rotate(-8)'%3E%3Cpath d='M60 0 124 150Q66 174 8 150Z' fill='%23ff5f6d' fill-opacity='.34'/%3E%3Cpath d='M8 150Q66 174 124 150' stroke='%230d6b43' stroke-width='13' stroke-opacity='.45'/%3E%3Cpath d='M14 148Q66 166 118 148' stroke='%23dcefd9' stroke-width='7' stroke-opacity='.55'/%3E%3Cellipse cx='58' cy='70' rx='5' ry='9' fill='%2314221b' fill-opacity='.15' transform='rotate(-18 58 70)'/%3E%3Cellipse cx='82' cy='92' rx='5' ry='9' fill='%2314221b' fill-opacity='.12' transform='rotate(14 82 92)'/%3E%3C/g%3E%3Cg opacity='.34' transform='translate(724 96) scale(.72) rotate(10)'%3E%3Cpath d='M60 0 124 150Q66 174 8 150Z' fill='%23ff5f6d' fill-opacity='.28'/%3E%3Cpath d='M8 150Q66 174 124 150' stroke='%230d6b43' stroke-width='13' stroke-opacity='.38'/%3E%3Cpath d='M14 148Q66 166 118 148' stroke='%23dcefd9' stroke-width='7' stroke-opacity='.5'/%3E%3C/g%3E%3Cg opacity='.28' transform='translate(582 456) scale(.62) rotate(-16)'%3E%3Cpath d='M60 0 124 150Q66 174 8 150Z' fill='%23ff5f6d' fill-opacity='.25'/%3E%3Cpath d='M8 150Q66 174 124 150' stroke='%230d6b43' stroke-width='13' stroke-opacity='.35'/%3E%3Cpath d='M14 148Q66 166 118 148' stroke='%23dcefd9' stroke-width='7' stroke-opacity='.46'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-position: center 34px;
  background-size: 1280px 827px;
  opacity: 0.14;
  content: "";
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(15, 81, 50, 0.036) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 81, 50, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 18% 14%, rgba(255, 95, 109, 0.12), transparent 28%),
    radial-gradient(circle at 84% 20%, rgba(139, 224, 176, 0.18), transparent 30%);
  background-size:
    34px 34px,
    34px 34px,
    auto,
    auto;
  content: "";
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(139, 224, 176, 0.78);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 70px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(17, 17, 15, 0.08);
  background: rgba(247, 250, 242, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-word {
  margin-left: -2px;
  font-size: 18px;
  line-height: 1;
}

.brand-product {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(15, 81, 50, 0.2);
  color: var(--green);
  font-size: 14px;
}

.logo-mark {
  display: inline-grid;
  width: 35px;
  height: 34px;
  place-items: center;
}

.logo-mark svg {
  width: 36px;
  height: 31px;
}

.logo-w-body {
  fill: var(--green);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72));
}

.logo-watermelon-flesh,
.logo-watermelon-rind,
.logo-circuit {
  fill: none;
  stroke-linecap: round;
}

.logo-watermelon-flesh {
  stroke: var(--watermelon);
  stroke-width: 2.5;
  opacity: 0.76;
}

.logo-watermelon-rind {
  stroke: var(--rind);
  stroke-width: 1.2;
  opacity: 0.45;
}

.logo-circuit {
  stroke: rgba(139, 224, 176, 0.9);
  stroke-width: 1.2;
  opacity: 0.36;
}

.studio-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.studio-nav a:hover {
  color: var(--ink);
}

.env-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(15, 81, 50, 0.16);
  background: rgba(255, 254, 250, 0.72);
  color: var(--green);
  font-size: 13px;
  font-weight: 680;
}

.builder-section,
.catalog-section {
  width: min(1324px, calc(100% - 40px));
  margin: 0 auto;
}

.builder-section {
  padding: 52px 0 18px;
}

.builder-card {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.82), rgba(247, 250, 242, 0.62)),
    var(--panel);
  box-shadow: 0 18px 70px rgba(19, 42, 31, 0.07);
}

.builder-card::before {
  position: absolute;
  top: -28%;
  bottom: -28%;
  left: -46%;
  width: 36%;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0%, rgba(139, 224, 176, 0.22) 48%, rgba(255, 95, 109, 0.12) 54%, transparent 100%);
  opacity: 0.62;
  transform: skewX(-16deg);
  animation: studio-scan 8s ease-in-out infinite;
  content: "";
}

.builder-heading,
.builder-form {
  position: relative;
  z-index: 1;
}

.builder-heading {
  max-width: 980px;
  padding: 34px 34px 18px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.16;
}

.builder-heading p,
.section-heading p {
  max-width: none;
  color: #6f776f;
  font-size: 14px;
  line-height: 1.55;
}

.builder-heading p {
  white-space: nowrap;
}

.builder-form {
  display: grid;
  gap: 18px;
  padding: 0 34px 34px;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.62fr);
  gap: 22px;
  align-items: stretch;
}

.builder-fields {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  gap: 8px;
}

.field-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.58);
  color: var(--ink);
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 138px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

.blueprint {
  display: grid;
  align-content: space-between;
  gap: 20px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 81, 50, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 81, 50, 0.04) 1px, transparent 1px),
    rgba(255, 254, 250, 0.42);
  background-size: 24px 24px;
}

.blueprint-map {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 52px 1fr 52px 1fr;
  align-items: center;
  min-height: 92px;
}

.map-node {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(15, 81, 50, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.64);
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
}

.node-agent {
  background: #10231a;
  border-color: #10231a;
  color: #fffaf0;
}

.map-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 81, 50, 0.18), var(--watermelon), rgba(15, 81, 50, 0.18));
  transform-origin: center;
  animation: line-pulse 2.8s ease-in-out infinite;
}

.line-b {
  animation-delay: 500ms;
}

.blueprint dl,
.app-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.app-card dl div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
}

.blueprint dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.app-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.app-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.blueprint dt {
  color: #7c857e;
  font-size: 11px;
  font-weight: 680;
}

.blueprint dd {
  margin: 0;
  color: #243128;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.capability-module {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.34);
}

.capability-module span {
  color: var(--watermelon-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h2 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.capability-module p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(15, 81, 50, 0.14);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.48);
  color: var(--green);
  font-weight: 720;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--panel);
}

.button.ghost {
  border-color: rgba(15, 81, 50, 0.12);
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-chip,
.option-card {
  min-height: 32px;
  border: 1px solid rgba(15, 81, 50, 0.1);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.36);
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.tool-chip {
  padding: 0 10px;
}

.tool-chip.selected,
.option-card.active {
  border-color: rgba(15, 81, 50, 0.14);
  background: var(--green-soft);
  color: var(--green);
}

.knowledge-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.option-card {
  width: 100%;
  padding: 0 10px;
  text-align: left;
}

.inline-input {
  min-height: 36px;
  font-size: 13px;
}

.policy-list {
  display: grid;
  gap: 9px;
}

.policy-list label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.policy-list input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
  accent-color: var(--green);
}

.builder-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-top: 2px;
}

.builder-footer p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.catalog-section {
  padding: 28px 0 18px;
}

.apps-section {
  padding-bottom: 64px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h2 {
  display: none;
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
}

.section-heading p {
  display: none;
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.template-grid,
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.template-card,
.app-card {
  display: grid;
  gap: 14px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.38);
}

.template-card {
  align-content: space-between;
}

.template-card > span {
  color: var(--watermelon-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.template-card h3,
.app-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.template-card p,
.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-card {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.5fr) auto;
  align-items: center;
  min-height: 136px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 0 8px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 800;
}

.status.running {
  color: var(--green);
  background: rgba(220, 239, 217, 0.72);
}

.status.draft {
  color: var(--blue);
  background: rgba(75, 120, 216, 0.1);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 81, 50, 0.18);
  background: var(--green);
  color: var(--panel);
  font-size: 14px;
  font-weight: 720;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes studio-scan {
  0%,
  100% {
    transform: translateX(0) skewX(-16deg);
  }

  50% {
    transform: translateX(390%) skewX(-16deg);
  }
}

@keyframes line-pulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scaleX(0.72);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1120px) {
  .builder-grid,
  .capability-grid,
  .template-grid,
  .app-grid,
  .app-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blueprint {
    min-height: 260px;
  }

  .app-card .button {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .studio-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 14px;
  }

  .studio-nav {
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
  }

  .env-chip,
  .brand-product {
    display: none;
  }

  .builder-section,
  .catalog-section {
    width: calc(100% - 28px);
  }

  .builder-section {
    padding-top: 30px;
  }

  .builder-heading,
  .builder-form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .builder-heading {
    padding-top: 24px;
  }

  .builder-heading p {
    white-space: normal;
  }

  .builder-form {
    padding-bottom: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .builder-grid,
  .capability-grid,
  .template-grid,
  .app-grid,
  .app-card {
    grid-template-columns: 1fr;
  }

  .blueprint-map {
    grid-template-columns: 1fr 36px 1fr 36px 1fr;
  }

  .capability-module {
    min-height: auto;
  }

  .builder-footer,
  .section-heading {
    display: grid;
    align-items: start;
  }

  .button.primary {
    width: 100%;
  }
}
