:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #15181d;
  --surface-2: #1d222a;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #9aa7b5;
  --text: #f4f7fb;
  --blue: #4c8dff;
  --cyan: #39d8d0;
  --lime: #b9f264;
  --amber: #ffc35a;
  --coral: #ff6f61;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 22% 4%, rgba(76, 141, 255, 0.2), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(255, 195, 90, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(16, 19, 24, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--cyan) 48%, var(--lime));
  color: #071014;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d5dce6;
  text-align: left;
}

.nav-item span {
  display: grid;
  width: 22px;
  place-items: center;
  color: var(--muted);
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-card {
  position: absolute;
  right: 18px;
  bottom: 24px;
  left: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(76, 141, 255, 0.18), rgba(255, 255, 255, 0.05));
}

.sidebar-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-card strong {
  display: block;
  margin-bottom: 14px;
  line-height: 1.45;
}

.main {
  padding: 26px clamp(20px, 3vw, 44px) 42px;
}

.topbar,
.section-heading,
.preview-header,
.model-route,
.compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  max-width: 880px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  color: #fff;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), #6b5cff);
  box-shadow: 0 12px 30px rgba(76, 141, 255, 0.28);
}

.ghost-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(21, 24, 29, 0.82);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 20px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.mode-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.mode-tab.active {
  border-color: rgba(76, 141, 255, 0.7);
  background: rgba(76, 141, 255, 0.18);
  color: #fff;
}

.field-label,
.select-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.7);
  color: var(--text);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(57, 216, 208, 0.75);
}

textarea {
  min-height: 142px;
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

.compose-row {
  margin: 14px 0;
}

.select-field {
  flex: 1;
}

.model-route {
  align-items: flex-end;
  padding: 16px;
  border: 1px solid rgba(57, 216, 208, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(57, 216, 208, 0.16), transparent),
    rgba(255, 255, 255, 0.04);
}

.route-label {
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
}

.model-route strong {
  display: block;
  margin: 6px 0;
  font-size: 18px;
}

.model-route p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.preview-panel {
  overflow: hidden;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(185, 242, 100, 0.14);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
}

.preview-canvas {
  position: relative;
  display: grid;
  min-height: 310px;
  margin: 18px 0;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(255, 195, 90, 0.2), transparent 30%),
    linear-gradient(235deg, rgba(57, 216, 208, 0.22), transparent 38%),
    linear-gradient(180deg, #27313a, #11151a 62%, #0b0d10);
}

.preview-canvas::before,
.preview-canvas::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
}

.preview-canvas::before {
  width: 78%;
  height: 34%;
  bottom: 34px;
  background: rgba(255, 255, 255, 0.08);
  transform: perspective(420px) rotateX(58deg);
}

.preview-canvas::after {
  width: 180px;
  height: 180px;
  top: 42px;
  right: 52px;
  background: radial-gradient(circle, rgba(255, 195, 90, 0.72), transparent 64%);
}

.product-visual {
  position: relative;
  z-index: 1;
  width: 230px;
  height: 250px;
}

.cup {
  position: absolute;
  right: 42px;
  bottom: 18px;
  width: 116px;
  height: 170px;
  border-radius: 22px 22px 36px 36px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent 24%),
    linear-gradient(160deg, #d9f7ff, #5fa9c9 46%, #1b4459);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.32);
}

.cup::after {
  content: "";
  position: absolute;
  top: 45px;
  right: -40px;
  width: 58px;
  height: 70px;
  border: 13px solid #80c8dd;
  border-left: 0;
  border-radius: 0 40px 40px 0;
}

.steam {
  position: absolute;
  top: 8px;
  width: 42px;
  height: 86px;
  border-left: 3px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.steam-a {
  left: 72px;
}

.steam-b {
  left: 112px;
  height: 66px;
  opacity: 0.7;
}

.badge {
  position: absolute;
  left: 18px;
  bottom: 56px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: rgba(11, 13, 16, 0.8);
  border: 1px solid var(--line);
  color: var(--lime);
  font-weight: 900;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-meta span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.preview-meta strong {
  color: #fff;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
}

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

.section-heading.compact {
  align-items: flex-start;
}

.section-heading input {
  max-width: 360px;
}

.prompt-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.prompt-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.prompt-art {
  position: relative;
  min-height: 124px;
  overflow: hidden;
}

.prompt-art::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(16px);
}

.art-ecommerce {
  background:
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, 0.82), transparent 10%),
    linear-gradient(135deg, #2c5c72, #e8b86d);
}

.art-ad {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #2b2148, #ff6f61 52%, #ffc35a);
}

.art-game {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 8px, transparent 8px 18px),
    linear-gradient(135deg, #16284f, #36c4a6);
}

.art-beauty {
  background:
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.75), transparent 11%),
    linear-gradient(135deg, #6c375e, #f3a2aa 58%, #f7d4b2);
}

.art-pet {
  background:
    radial-gradient(circle at 52% 38%, rgba(255, 255, 255, 0.75), transparent 13%),
    linear-gradient(135deg, #25394f, #77c58c 54%, #ffcf6a);
}

.art-fashion {
  background:
    linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.45) 37% 43%, transparent 44%),
    linear-gradient(135deg, #111, #4c8dff 48%, #d8e4ff);
}

.prompt-body {
  padding: 12px;
}

.prompt-body strong {
  display: block;
  margin-bottom: 6px;
}

.prompt-body p {
  min-height: 42px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span,
.skill-stack span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce5ef;
  font-size: 12px;
}

.github-import {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.github-import input {
  min-width: 0;
}

.skill-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.5;
}

.pulse {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 8px rgba(57, 216, 208, 0.1);
  flex-shrink: 0;
}

.skill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.workflow-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.workflow-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workflow-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 10px;
  color: #071014;
  font-weight: 900;
}

.workflow-icon.coral {
  background: var(--coral);
}

.workflow-icon.blue {
  background: var(--blue);
  color: #fff;
}

.workflow-icon.lime {
  background: var(--lime);
}

.workflow-icon.amber {
  background: var(--amber);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-card {
    position: static;
    margin-top: 18px;
  }

  .hero-grid,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .prompt-results,
  .workflow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main {
    padding: 20px 14px 30px;
  }

  .topbar,
  .section-heading,
  .preview-header,
  .model-route,
  .compose-row,
  .github-import {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .mode-tabs {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
    width: 100%;
  }

  .section-heading input {
    max-width: none;
  }

  .prompt-results,
  .workflow-list {
    grid-template-columns: 1fr;
  }
}
