:root {
  color-scheme: light;
  --ink: #17211e;
  --muted: #66706c;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --line: #cfd8d3;
  --forest: #173f36;
  --forest-hover: #0f3029;
  --coral: #ef6548;
  --cyan: #b8e7ec;
  --shadow: 0 18px 50px rgba(23, 33, 30, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 245, 0.94);
}

.header-inner {
  width: min(1120px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
}

.version {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.generator {
  padding: 76px 0 68px;
}

.generator-heading {
  max-width: 820px;
  margin-bottom: 42px;
}

.kicker {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
  font-size: 50px;
  line-height: 1.13;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.controls {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.field {
  min-width: 0;
}

.field-wide {
  margin-bottom: 30px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label,
.label-row {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row label {
  margin: 0;
}

output {
  color: var(--forest);
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

input[type="text"],
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

input[type="text"] {
  min-width: 0;
  padding: 0 16px;
  border-radius: 6px 0 0 6px;
}

select {
  padding: 0 38px 0 14px;
}

.text-button {
  min-width: 82px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--forest);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  color: var(--surface);
  background: var(--forest);
  font-size: 14px;
  font-weight: 700;
}

.text-button:hover {
  background: var(--forest-hover);
}

input[type="range"] {
  width: 100%;
  height: 48px;
  margin: 0;
  accent-color: var(--coral);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 34px;
}

.button {
  min-height: 48px;
  padding: 0 17px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.button-primary {
  border: 1px solid var(--forest);
  color: var(--surface);
  background: var(--forest);
}

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

.button-secondary {
  border: 1px solid var(--forest);
  color: var(--forest);
  background: var(--surface);
}

.button-secondary:hover,
.button-quiet:hover {
  background: #edf3f0;
}

.button-quiet {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status {
  min-height: 22px;
  margin: 12px 0 -34px;
  color: var(--muted);
  font-size: 13px;
}

.preview-column {
  min-width: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #e8efeb;
}

.preview-frame {
  width: min(100%, 400px);
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(23, 63, 54, 0.16);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--cyan), -10px -10px 0 #ffd8ce;
}

.preview-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-meta {
  width: min(100%, 400px);
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts > div {
  min-width: 0;
  padding: 30px 28px;
}

.facts > div + div {
  border-left: 1px solid var(--line);
}

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

.facts strong {
  margin-bottom: 6px;
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
  font-size: 18px;
}

.facts span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 12px;
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .generator {
    padding-top: 54px;
  }

  h1 {
    font-size: 40px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-column {
    min-height: 480px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .header-inner,
  main,
  footer {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    height: 66px;
  }

  .generator {
    padding: 40px 0 48px;
  }

  .generator-heading {
    margin-bottom: 28px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.18;
  }

  .controls,
  .preview-column {
    padding: 28px 20px;
  }

  .field-row,
  .actions {
    grid-template-columns: 1fr;
  }

  .button-quiet {
    grid-column: auto;
  }

  .status {
    margin-bottom: -16px;
  }

  .preview-column {
    min-height: 380px;
  }

  .preview-frame {
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
