:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --ink: #17201b;
  --muted: #657168;
  --panel: #ffffff;
  --line: #d8ddd5;
  --accent: #0f7b6c;
  --accent-strong: #075f55;
  --accent-soft: #dff3ef;
  --warn: #a15110;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.11);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 123, 108, 0.16), transparent 32rem),
    linear-gradient(135deg, #f7f3ea 0%, #eef5f3 46%, #f5f7fb 100%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.intro-copy {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(216, 221, 213, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 58px;
  margin-bottom: 22px;
}

.panel-head p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.step {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 760;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

textarea {
  min-height: 128px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.55;
}

input {
  height: 46px;
  padding: 0 14px;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 123, 108, 0.14);
}

.primary-action,
.ghost-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 123, 108, 0.22);
}

.primary-action:hover {
  background: var(--accent-strong);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-action {
  min-width: 72px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.ghost-action:hover {
  background: #cae9e3;
}

.result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.note {
  margin-top: 8px;
  color: var(--warn);
  font-size: 0.88rem;
  line-height: 1.5;
}

.counter {
  justify-self: end;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.counter.is-error {
  color: var(--danger);
}

pre {
  max-height: 360px;
  min-height: 148px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  line-height: 1.55;
}

.status {
  min-height: 28px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--accent-strong);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding: 28px 0;
  }

  .intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.4rem);
  }

  .panel {
    padding: 18px;
  }
}
