:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --ink: #19231f;
  --muted: #66746d;
  --line: #d3ddd7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --panel-soft: #eff5f1;
  --accent: #0f6958;
  --accent-strong: #0a4d40;
  --warm: #a8512f;
  --danger: #a33c2d;
  --shadow: 0 26px 58px rgba(22, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 105, 88, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(168, 81, 47, 0.14), transparent 25%),
    linear-gradient(180deg, #edf2ee 0%, var(--bg) 100%);
  color: var(--ink);
  font-family:
    "Avenir Next", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.workspace {
  display: grid;
  gap: 20px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 26px 28px;
}

.eyebrow,
.phase-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-text,
.hero-status p,
.panel-head p,
.phase-head p,
.result-head p {
  color: var(--muted);
}

.hero-text {
  max-width: 58ch;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.hero-status {
  display: grid;
  align-content: space-between;
  gap: 16px;
  justify-items: end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 105, 88, 0.12), rgba(15, 105, 88, 0.03));
  border: 1px solid rgba(15, 105, 88, 0.2);
  color: var(--accent-strong);
  font-weight: 800;
}

.hero-status p {
  max-width: 34ch;
  text-align: right;
  line-height: 1.7;
  font-size: 13px;
}

.panel {
  padding: 22px;
}

.panel-head,
.phase-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-head h2,
.phase-head h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.panel-head p,
.phase-head p {
  font-size: 13px;
  line-height: 1.7;
}

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

.span-2 {
  grid-column: span 2;
}

.phase-stack {
  display: grid;
  gap: 18px;
}

.phase-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr);
  gap: 18px;
}

.phase-col.outputs {
  min-width: 0;
}

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

.bt-connect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.field span {
  color: #33423c;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 252, 251, 0.96);
  color: var(--ink);
  padding: 13px 15px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 105, 88, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 105, 88, 0.1);
  transform: translateY(-1px);
}

textarea {
  min-height: 148px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}

.inline-status {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  overflow: hidden;
}

.result-card.error {
  border-color: rgba(163, 60, 45, 0.3);
}

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-soft), rgba(239, 245, 241, 0.54));
}

.result-head h3 {
  font-size: 15px;
  line-height: 1.25;
}

.result-head p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.copy {
  flex: 0 0 auto;
  min-width: 56px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 105, 88, 0.28);
  border-radius: 12px;
  background: white;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.secondary-button {
  flex: 0 0 auto;
  min-width: 84px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(15, 105, 88, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, #fdfefd, #eef7f3);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.secondary-button:hover,
.copy:hover {
  background: #eef7f3;
}

.copy:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

pre {
  min-height: 52px;
  padding: 14px 16px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.result-card.error pre,
.result-card.error h3 {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .hero,
  .phase-layout,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .hero-status {
    justify-items: start;
  }

  .hero-status p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .hero,
  .panel {
    border-radius: 20px;
    padding: 18px;
  }

  h1 {
    font-size: 32px;
  }
}
