:root {
  --ink: #17332f;
  --muted: #5f6f6b;
  --paper: #fffdf7;
  --cream: #f5f1e6;
  --line: #d9e0db;
  --green: #176f5c;
  --green-dark: #0f5143;
  --gold: #e7a940;
  --rose: #b65258;
  --blue: #3e6f86;
  --focus: #005fcc;
  --shadow: 0 18px 48px rgba(23, 51, 47, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, input, textarea { border-radius: 12px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  color: white;
  background: #111;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.hero {
  background:
    radial-gradient(circle at 82% 10%, rgba(231, 169, 64, 0.3), transparent 22rem),
    linear-gradient(135deg, #123f37 0%, #1d6555 62%, #2b7965 100%);
  color: white;
  padding: 48px 22px 52px;
}
.hero__inner, main, footer { width: min(1120px, 100%); margin: 0 auto; }
.eyebrow, .kicker { margin: 0; font-weight: 800; letter-spacing: 0.08em; }
.eyebrow { color: #f8dca7; }
.hero h1 { margin: 10px 0 4px; font-size: clamp(2.5rem, 8vw, 5.2rem); line-height: 1.08; letter-spacing: 0.04em; }
.hero__lead { margin: 0; font-size: clamp(1.15rem, 3vw, 1.55rem); }
.open-badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 22px;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-weight: 700;
}

main { padding: 34px 22px 80px; }
.steps { margin-top: -72px; padding: 24px; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.steps h2 { margin: 0 0 18px; font-size: 1.2rem; }
.steps ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.steps strong { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 50%; color: white; background: var(--green); }
.steps span { font-weight: 750; }

.cases, .results { padding-top: 62px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 24px; }
.section-heading h2 { margin: 2px 0 0; font-size: clamp(1.65rem, 5vw, 2.3rem); line-height: 1.25; }
.section-heading > p { max-width: 30rem; margin: 0; color: var(--muted); }
.kicker { color: var(--rose); font-size: 0.83rem; }

.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.case-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 10px 30px rgba(23, 51, 47, 0.1);
  text-align: left;
  cursor: pointer;
}
.case-card__image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--cream); }
.case-card__body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.case-card__subject { margin: 0; color: var(--rose); font-weight: 800; }
.case-card__title { margin: 4px 0 8px; font-size: 1.45rem; font-weight: 850; line-height: 1.35; }
.case-card__promise { margin: 0 0 18px; color: var(--muted); }
.case-card__action { margin-top: auto; color: var(--green-dark); font-weight: 850; }
@media (hover: hover) {
  .case-card:hover { border-color: var(--gold); transform: translateY(-2px); }
}
.case-card[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 4px rgba(23,111,92,0.16); }
.skeleton { min-height: 390px; border-radius: 22px; background: linear-gradient(100deg, #eee 20%, #f8f8f8 40%, #eee 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

.creator {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.35fr);
  overflow: hidden;
  margin-top: 44px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}
.creator__visual { min-height: 100%; background: #dfe9e3; }
.creator__visual img { width: 100%; height: 100%; min-height: 480px; object-fit: cover; }
.creator__body { padding: clamp(24px, 5vw, 44px); }
.creator__body h2 { margin: 2px 0 6px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.creator__promise { margin: 0 0 28px; color: var(--muted); }
.choice-group { margin: 0 0 28px; padding: 0; border: 0; }
.choice-group legend, .field-block > label { display: block; margin-bottom: 10px; font-size: 1.05rem; font-weight: 850; }
.choice-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-option { position: relative; }
.choice-option input { position: absolute; opacity: 0; pointer-events: none; }
.choice-option label {
  display: grid;
  min-height: 54px;
  place-items: center;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
}
.choice-option input:checked + label { border-color: var(--green); color: white; background: var(--green); }
.choice-option input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.field-block span, .field-hint { color: var(--muted); font-weight: 500; }
textarea, .lock-card input {
  width: 100%;
  border: 2px solid var(--line);
  padding: 13px 14px;
  color: var(--ink);
  background: white;
  font-size: 1rem;
}
textarea { resize: vertical; }
.field-hint { margin: 5px 0 0; font-size: 0.85rem; }
.action-row { display: flex; gap: 12px; margin-top: 24px; }
.button {
  min-height: 52px;
  padding: 12px 20px;
  border: 2px solid transparent;
  font-weight: 850;
  cursor: pointer;
}
.button--primary { color: white; background: var(--green); }
.button--primary:hover { background: var(--green-dark); }
.button--quiet { color: var(--green-dark); border-color: var(--line); background: white; }
.button:disabled { cursor: wait; opacity: 0.65; }
.form-error { min-height: 1.7em; margin: 10px 0 0; color: #9b1c1c; font-weight: 700; }

.job-list { display: grid; gap: 18px; }
.job-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 8px 24px rgba(23, 51, 47, 0.08); }
.job-card__head { display: flex; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.job-card__head h3 { margin: 0; font-size: 1.25rem; }
.job-id { display: inline-block; margin-top: 4px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 0.85rem; }
.status-pill { align-self: flex-start; white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-weight: 850; }
.status-queued { color: #6b4300; background: #fff0c7; }
.status-running { color: #0a4c68; background: #d9f1fb; }
.status-succeeded { color: #0c5c3e; background: #d9f2e5; }
.status-failed { color: #8a1d25; background: #f9dfe1; }
.job-card__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 0.75fr); gap: 22px; padding: 22px; }
.job-card__prompt { margin: 0; color: var(--muted); }
.queue-box { padding: 18px; border-radius: 16px; background: var(--cream); }
.queue-box strong { display: block; font-size: 1.25rem; }
.queue-box p { margin: 4px 0 0; }
.result-media { width: 100%; max-height: 560px; border-radius: 16px; object-fit: contain; background: #eee; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.result-actions a { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 16px; border-radius: 12px; color: var(--green-dark); border: 2px solid var(--green); font-weight: 800; text-decoration: none; }
.empty-state { display: grid; min-height: 220px; place-items: center; padding: 28px; border: 2px dashed var(--line); border-radius: 22px; color: var(--muted); text-align: center; }
.empty-state span { font-size: 2.5rem; }
.empty-state p { margin: -48px 0 0; }

.paper-tip { display: flex; align-items: center; gap: 22px; margin-top: 56px; padding: 24px; border-radius: 20px; color: #3f3218; background: #fff1c9; }
.paper-tip__icon { display: grid; flex: 0 0 64px; height: 64px; place-items: center; border-radius: 50%; color: white; background: var(--rose); font-size: 2rem; }
.paper-tip h2 { margin: 0 0 4px; font-size: 1.3rem; }
.paper-tip p { margin: 0; }

footer { padding: 26px 22px 52px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
footer p { margin: 3px 0; }

.lock-screen { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; overflow-y: auto; padding: 22px; background: rgba(14, 40, 35, 0.94); }
.lock-card { width: min(470px, 100%); padding: 34px; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.lock-mark { display: grid; width: 64px; height: 64px; margin-bottom: 18px; place-items: center; border-radius: 18px; color: white; background: var(--green); font-weight: 900; }
.lock-card h2 { margin: 2px 0 6px; font-size: 2rem; }
.lock-card label { display: block; margin: 22px 0 8px; font-weight: 850; }
.lock-card button { width: 100%; margin-top: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
[hidden] { display: none !important; }

@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skeleton { animation: none; }
}

@media (max-width: 820px) {
  body { font-size: 17px; }
  .hero { padding-bottom: 88px; }
  .steps ol { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .case-card { display: grid; grid-template-columns: 38% 1fr; }
  .case-card__image { height: 100%; aspect-ratio: auto; }
  .creator { grid-template-columns: 1fr; }
  .creator__visual img { min-height: 220px; max-height: 360px; }
  .job-card__body { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero { padding: 34px 18px 86px; }
  main { padding-inline: 16px; }
  .steps { padding: 18px; }
  .steps li { gap: 7px; }
  .steps strong { flex-basis: 34px; height: 34px; }
  .steps span { font-size: 0.92rem; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 8px; }
  .case-card { grid-template-columns: 1fr; }
  .case-card__image { aspect-ratio: 16 / 8; }
  .choice-list { grid-template-columns: 1fr; }
  .choice-option label { min-height: 52px; }
  .action-row { flex-direction: column; }
  .button { width: 100%; }
  .job-card__head { display: block; }
  .status-pill { display: inline-block; margin-top: 10px; }
  .paper-tip { align-items: flex-start; }
  .paper-tip__icon { flex-basis: 48px; height: 48px; }
}
