:root {
  --ink: #201e32;
  --canvas: #f8f7fb;
  --paper: #ffffff;
  --muted: #777483;
  --line: #dedbe8;
  --accent: #ee91ad;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app-shell {
  width: min(1200px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(272px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding-block: 48px;
}

.editor {
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgb(32 30 50 / 8%);
}

.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; line-height: 1.25; letter-spacing: 0; }
.intro { margin: 12px 0 32px; color: var(--muted); font-size: 15px; line-height: 1.65 }

.field-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  padding: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 18px;
  line-height: 1.55;
  outline: none;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(32 30 50 / 12%); }
.counter { margin: 8px 0 24px; color: var(--muted); font-size: 13px; text-align: right; }

.export-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}
.export-button:hover { opacity: .9; }
.export-button:active { transform: translateY(1px); }
.export-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.preview-area { min-width: 0; }
.preview-frame { width: min(100%, 720px); margin-inline: auto; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgb(32 30 50 / 8%); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 960 / 912; }

@media (max-width: 800px) {
  .app-shell { width: min(100% - 32px, 560px); grid-template-columns: 1fr; padding-block: 24px 40px; gap: 24px; }
  .editor { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; } }
