*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #d0d7de;
  --text: #1f2328;
  --text-secondary: #656d76;
  --primary: #0969da;
  --primary-hover: #0860ca;
  --danger: #cf222e;
  --danger-hover: #a40e1a;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}

header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}

header .subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 8px;
}

header .value-prop {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
}

header .desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

.btn-start {
  margin-top: 16px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
}

.info-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.info-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.info-card ul,
.info-card ol {
  margin: 0;
  padding-left: 18px;
}

.info-card li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.examples-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.examples-header {
  margin-bottom: 16px;
}

.examples-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.examples-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.example-card:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 6px rgba(9, 105, 218, 0.12);
}

.example-card-header {
  margin-bottom: 10px;
}

.example-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.example-tag {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.example-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.example-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.btn-example {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary);
  font-size: 13px;
  padding: 6px 16px;
  align-self: flex-start;
}

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

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.form-section,
.output-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
}

textarea {
  resize: vertical;
}

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

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-download {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-download:hover {
  background: #e8f4fd;
  border-color: var(--primary);
  color: var(--primary);
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.output-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.output-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

#output {
  width: 100%;
  height: calc(100vh - 300px);
  min-height: 400px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  resize: none;
}

.toast {
  margin-top: 8px;
  padding: 8px 14px;
  background: #dafbe1;
  border: 1px solid #acf2bd;
  border-radius: var(--radius);
  color: #116329;
  font-size: 13px;
  text-align: center;
  transition: opacity 0.2s;
}

.toast.hidden {
  display: none;
}

.download-hint {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  color: #8d6e00;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.download-hint.hidden {
  display: none;
}

@media (max-width: 768px) {
  header {
    padding: 24px 16px 16px;
  }

  .info-panel {
    grid-template-columns: 1fr;
    padding: 0 16px 20px;
  }

  .examples-section {
    padding: 0 16px 20px;
  }

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

  main {
    grid-template-columns: 1fr;
    padding: 0 16px 32px;
  }

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

  #output {
    height: 300px;
    min-height: 200px;
  }
}
