:root {
  --green-900: #173e34;
  --green-700: #285a4a;
  --green-100: #eaf3ef;
  --gold-500: #d8a13a;
  --ink: #23312c;
  --muted: #66716d;
  --line: #d7ddda;
  --surface: #ffffff;
  --background: #eef1ef;
  --danger: #a23f38;
  --shadow: 0 18px 50px rgba(24, 48, 40, 0.09);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
  background: var(--surface);
  border: 1px solid rgba(40, 90, 74, 0.14);
  box-shadow: var(--shadow);
}

.app-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.title-group { display: flex; align-items: center; gap: 14px; min-width: 0; }

.document-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  background: var(--green-900);
  border-bottom: 4px solid var(--gold-500);
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.title-group h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: 0; }
.title-group p { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; }

.delivery-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.delivery-status span { width: 8px; height: 8px; border-radius: 50%; background: #3e8c65; box-shadow: 0 0 0 4px #e5f3eb; }

.step-nav { display: grid; grid-template-columns: repeat(4, 1fr); background: #f8faf9; border-bottom: 1px solid var(--line); }

.step-tab {
  appearance: none;
  min-height: 74px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 14px 18px;
  background: transparent;
  color: var(--muted);
}

.step-tab:last-child { border-right: 0; }
.step-tab span { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; align-self: center; border: 1px solid #b8c2bd; color: #77817d; font-size: 11px; font-weight: 700; }
.step-tab strong { color: inherit; font-size: 14px; font-weight: 700; }
.step-tab small { font-size: 11px; color: #8a938f; }
.step-tab.is-active { background: white; color: var(--green-900); }
.step-tab.is-active span { background: var(--green-700); border-color: var(--green-700); color: white; }
.step-tab:disabled { cursor: default; opacity: 0.66; }

.progress-track { height: 3px; background: #e5e9e7; }
.progress-track span { display: block; width: 25%; height: 100%; background: var(--gold-500); transition: width 180ms ease; }

form { padding: 0 28px 28px; }

.form-step { display: none; }
.form-step.is-active { display: block; }

.step-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 30px 0 18px; border-bottom: 1px solid var(--line); }
.step-heading span { display: block; margin-bottom: 5px; color: var(--green-700); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.step-heading h2 { margin: 0; font-size: 22px; letter-spacing: 0; }
.step-heading p { margin: 0 0 2px; color: var(--muted); font-size: 13px; text-align: right; }

.form-section { margin-top: 26px; }
.form-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--green-900); font-size: 15px; }
.form-section h3 > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; background: var(--gold-500); color: white; font-size: 12px; }
.form-section h3 small { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; }

.field-table { border-top: 2px solid var(--green-700); border-bottom: 1px solid var(--line); }
.field-row { display: grid; grid-template-columns: minmax(180px, 25%) 1fr; min-height: 62px; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: 0; }
.field-label { display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; background: #f5f7f6; font-weight: 700; line-height: 1.35; }
.field-label small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.field-label.required::after { content: "必填 / Required"; width: fit-content; margin-top: 5px; color: var(--danger); font-size: 10px; font-weight: 700; }
.field-control { min-width: 0; display: flex; align-items: center; padding: 10px 14px; }

.field-control > input, .field-control > select, .field-control > textarea { width: 100%; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid #bdc7c2; border-radius: 4px; background: white; color: var(--ink); padding: 9px 10px; outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(40, 90, 74, 0.12); }
.form-step.validation-attempted input:invalid,
.form-step.validation-attempted select:invalid,
.form-step.validation-attempted textarea:invalid { border-color: var(--danger); }

.input-pair, .input-grid-three, .condition-grid, .clinical-grid { display: grid; width: 100%; gap: 10px; align-items: end; }
.input-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.condition-grid { grid-template-columns: minmax(180px, 2fr) minmax(130px, 1fr); }
.clinical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.clinical-grid .wide { grid-column: 1 / -1; }
.field-control label { min-width: 0; display: block; color: var(--muted); font-size: 11px; }
.field-control label > span { display: block; min-height: 15px; margin: 0 0 5px; }

.choices { gap: 14px; }
.choices.wrap { flex-wrap: wrap; }
.choices label, .check-list label { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 13px; line-height: 1.45; }
.choices input, .check-list input { width: 17px; height: 17px; min-height: 17px; flex: 0 0 17px; margin: 1px 0 0; accent-color: var(--green-700); }

.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.two-columns > div { min-width: 0; }
.check-list { min-height: 150px; display: grid; align-content: center; gap: 12px; padding: 16px; border-top: 2px solid var(--green-700); border-bottom: 1px solid var(--line); background: #fafbfa; }
.required-check::after { content: "*"; color: var(--danger); font-weight: 800; }

.form-actions { display: flex; justify-content: space-between; gap: 12px; padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.primary-button, .secondary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 5px; padding: 10px 18px; font-weight: 750; }
.primary-button { margin-left: auto; border: 1px solid var(--green-700); background: var(--green-700); color: white; }
.primary-button:hover { background: var(--green-900); border-color: var(--green-900); }
.primary-button:disabled { cursor: wait; opacity: 0.62; }
.secondary-button { border: 1px solid #aeb9b4; background: white; color: var(--green-900); }
.secondary-button:hover { background: #f6f8f7; }

.submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 18px; border-left: 4px solid var(--gold-500); background: var(--green-100); }
.submit-panel div { display: grid; gap: 4px; }
.submit-panel strong { font-size: 15px; }
.submit-panel span { color: var(--muted); font-size: 12px; }
.submit-panel .primary-button { flex: 0 0 auto; }

.result-panel { padding: 72px 28px 84px; text-align: center; }
.result-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: var(--green-700); color: white; font-size: 26px; }
.result-panel h2 { margin: 0; font-size: 24px; }
.result-panel p { margin: 9px 0 22px; color: var(--muted); }
.result-panel dl { width: min(430px, 100%); display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0 auto 24px; border: 1px solid var(--line); text-align: left; }
.result-panel dt, .result-panel dd { margin: 0; padding: 12px; }
.result-panel dt { background: #f5f7f6; font-weight: 700; }
.result-panel dd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 20px, 760px); margin-top: 10px; }
  .app-header { padding: 17px 18px; }
  .delivery-status { display: none; }
  .step-tab { min-height: 62px; grid-template-columns: 26px 1fr; padding: 10px 8px; column-gap: 7px; }
  .step-tab span { width: 24px; height: 24px; }
  .step-tab small { display: none; }
  form { padding: 0 16px 20px; }
  .step-heading { align-items: flex-start; padding-top: 22px; }
  .step-heading p { max-width: 46%; }
  .field-row { grid-template-columns: minmax(150px, 31%) 1fr; }
  .input-grid-three { grid-template-columns: 1fr; }
  .two-columns { grid-template-columns: 1fr; }
  .check-list { min-height: 0; }
}

@media (max-width: 560px) {
  .app-shell { width: 100%; margin: 0; border: 0; box-shadow: none; }
  .app-header { min-height: 78px; }
  .document-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .title-group h1 { font-size: 18px; }
  .title-group p { font-size: 10px; }
  .step-nav { position: sticky; top: 0; z-index: 5; }
  .step-tab { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 2px; text-align: center; }
  .step-tab strong { display: block; font-size: 10px; line-height: 1.15; }
  .step-tab span { grid-row: auto; }
  .step-heading { display: block; }
  .step-heading p { max-width: none; margin-top: 8px; text-align: left; }
  .form-section { margin-top: 22px; }
  .form-section h3 { align-items: flex-start; flex-wrap: wrap; }
  .form-section h3 small { width: calc(100% - 38px); margin-left: 38px; margin-top: -8px; }
  .field-row { display: block; min-height: 0; }
  .field-label { padding: 10px 12px; }
  .field-control { padding: 12px; }
  .input-pair, .condition-grid, .clinical-grid { grid-template-columns: 1fr; }
  .clinical-grid .wide { grid-column: auto; }
  .submit-panel { align-items: stretch; flex-direction: column; }
  .submit-panel .primary-button { width: 100%; }
  input, select, textarea { min-height: 44px; }
  .form-actions { margin-top: 22px; padding: 16px 0 4px; background: white; }
}
