:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --soft: #e9f7f5;
  --warning: #b45309;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  padding: 0.72rem 1rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: var(--soft);
  color: var(--primary-dark);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.full {
  width: 100%;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1220px;
  padding: 2rem 1.2rem 1rem;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

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

h1 {
  font-size: 2rem;
  letter-spacing: 0;
  margin-bottom: 0;
}

h2 {
  font-size: 1rem;
  margin-bottom: 0;
}

.status {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
}

.status span {
  background: #22c55e;
  border-radius: 50%;
  height: 0.65rem;
  width: 0.65rem;
}

.workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: 320px minmax(420px, 1fr);
  margin: 0 auto;
  max-width: 1220px;
  padding: 0 1.2rem 1.4rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem;
}

.builder-panel,
.result-panel {
  grid-column: 2;
}

.settings-panel {
  grid-row: span 2;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 0.42rem;
  margin-bottom: 0.85rem;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  padding: 0.78rem 0.85rem;
  width: 100%;
}

input:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.toggle {
  align-items: flex-start;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: var(--warning);
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem;
}

.toggle.slim {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}

.toggle input {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  width: auto;
}

.toggle small {
  display: block;
  font-weight: 600;
  line-height: 1.55;
  margin-top: 0.2rem;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
  margin: 0.9rem 0 0;
}

.notice {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.3rem;
}

pre {
  background: #0f172a;
  border-radius: 8px;
  color: #dbeafe;
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 0;
  min-height: 340px;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.toast {
  background: #172033;
  border-radius: 999px;
  bottom: 18px;
  color: #fff;
  padding: 0.75rem 1rem;
  position: fixed;
  right: 18px;
  z-index: 20;
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .workspace,
  .builder-panel,
  .result-panel {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .settings-panel {
    grid-row: auto;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}
