💻 源码
:root {
  --bg: #f4f6fb;
  --bg-accent-1: #e8eefc;
  --bg-accent-2: #e7f6f1;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-ring: rgba(79, 70, 229, 0.18);
  --prompt: #2563eb;
  --prompt-soft: #eff6ff;
  --result: #059669;
  --result-soft: #ecfdf5;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, var(--bg-accent-1) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--bg-accent-2) 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  margin-bottom: 28px;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.subtitle {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.hero-tag {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-card:nth-child(2) {
  animation-delay: 0.05s;
}

.step-card:nth-child(3) {
  animation-delay: 0.1s;
}

.step-card {
  padding: 24px;
  margin-bottom: 20px;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.step-header-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-header.row-between {
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.step-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.step-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.task-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-md);
}

.task-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-soft) 100%);
  box-shadow:
    0 0 0 4px var(--primary-ring),
    var(--shadow-md);
}

.task-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.classify-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.extract-icon {
  background: #d1fae5;
  color: #047857;
}

.match-icon {
  background: #fef3c7;
  color: #b45309;
}

.task-copy {
  display: grid;
  gap: 4px;
}

.task-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.task-copy span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  gap: 4px;
}

.segmented-wide {
  width: 100%;
  max-width: 320px;
}

.segment-btn {
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.segmented-wide .segment-btn {
  flex: 1;
  text-align: center;
}

.segment-btn:hover {
  color: var(--text);
}

.segment-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.control-deck {
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  flex-wrap: wrap;
}

.control-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.control-block-grow {
  flex: 1;
}

.control-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.generate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  cursor: pointer;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.34);
}

.btn-generate:disabled {
  cursor: wait;
  opacity: 0.72;
}

.btn-generate:disabled .btn-generate-icon {
  animation: spin 0.9s linear infinite;
}

.btn-generate-icon {
  font-size: 14px;
  opacity: 0.9;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-idle {
  background: #f1f5f9;
  color: var(--text-muted);
}

.status-generating {
  background: var(--primary-soft);
  color: var(--primary);
  animation: breathe 1.4s ease-in-out infinite;
}

.status-done {
  background: var(--result-soft);
  color: var(--result);
}

.status-error {
  background: #fef2f2;
  color: var(--danger);
}

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

.hint-text {
  margin: 14px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.sample-list {
  display: grid;
  gap: 12px;
}

.sample-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-left-width: 4px;
  border-left-color: transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.sample-card:hover {
  border-color: #c7d2fe;
  box-shadow: var(--shadow-sm);
}

.sample-card.active {
  border-color: #c7d2fe;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, var(--primary-soft) 0%, #ffffff 28%);
  box-shadow: var(--shadow-md);
}

.sample-card.generated {
  background: linear-gradient(90deg, #faf5ff 0%, #ffffff 32%);
}

.generating-card {
  border-style: dashed;
  border-left-color: var(--primary);
  background: var(--primary-soft);
  cursor: default;
}

.sample-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-id {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, "Cascadia Code", monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.badge-easy {
  background: #ecfdf5;
  color: #047857;
}

.badge-medium {
  background: #fffbeb;
  color: #b45309;
}

.badge-hard {
  background: #fef2f2;
  color: #b91c1c;
}

.badge-generated {
  background: #f3e8ff;
  color: #7c3aed;
}

.sample-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.sample-text strong {
  color: var(--text);
}

.sample-text + .sample-text {
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.manual-fields {
  display: grid;
  gap: 8px;
}

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

.field-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 14px 16px;
  line-height: 1.65;
  resize: vertical;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

textarea:focus {
  outline: none;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.preview-box {
  min-height: 96px;
  padding: 18px 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.preview-box.is-empty {
  border-style: dashed;
  background: #f8fafc;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.empty-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 8px;
  animation: fadeUp 0.45s ease both;
  animation-delay: 0.15s;
}

.compare-card {
  padding: 0;
  overflow: hidden;
}

.compare-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.prompt-card .compare-header {
  background: linear-gradient(180deg, var(--prompt-soft) 0%, #ffffff 100%);
}

.result-card .compare-header {
  background: linear-gradient(180deg, var(--result-soft) 0%, #ffffff 100%);
}

.compare-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prompt-dot {
  background: var(--prompt);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.result-dot {
  background: var(--result);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}

.compare-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.compare-header p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

pre {
  min-height: 340px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 18px 20px;
  font-family: Consolas, "Cascadia Code", "SF Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-placeholder {
  display: block;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.result-success {
  background: var(--result-soft);
  color: var(--result);
}

.result-error {
  background: #fef2f2;
  color: var(--danger);
}

.result-correct {
  background: #ecfdf5;
  color: #047857;
}

.result-wrong {
  background: #fef2f2;
  color: #b91c1c;
}

.result-json {
  display: block;
  font-family: Consolas, "Cascadia Code", "SF Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-card pre {
  background: #fbfdff;
  color: #1e3a8a;
}

.result-card pre {
  background: #fbfefc;
  color: #065f46;
}

.action-bar {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.btn-primary {
  min-width: 240px;
  border: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #fff;
  cursor: pointer;
  padding: 15px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
}

.btn-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100%, calc(100% - 24px));
    padding-top: 24px;
  }

  .task-cards,
  .compare-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .step-header.row-between {
    flex-direction: column;
    align-items: stretch;
  }

  .control-deck {
    flex-direction: column;
  }

  .control-divider {
    width: 100%;
    height: 1px;
  }

  .segmented-wide {
    max-width: none;
  }
}