:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --soft: #e6f4f1;
  --warn: #fff7e6;
  --warn-line: #f0c36a;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px 112px;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -14px -14px 14px;
  padding: 14px;
  background: rgba(246, 247, 249, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

h1 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 4px 0 0;
  font-size: 19px;
  letter-spacing: 0;
}

p { margin: 0 0 8px; }

.sub, .hint, .optional {
  color: var(--muted);
}

.sub { font-size: 14px; }

.intro {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.progress-wrap {
  margin-top: 12px;
  height: 8px;
  overflow: hidden;
  background: #e8ebf0;
  border-radius: 999px;
}

.progress {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width .2s ease;
}

.status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.section {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section.active { display: block; }

.section-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.field {
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid #eef1f5;
}

.field:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.label {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
}

.required, .optional {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.required {
  color: var(--accent-dark);
  background: var(--soft);
}

.optional {
  background: #f2f4f7;
}

.hint {
  margin-top: -4px;
  font-size: 13px;
}

input[type="text"], textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .13);
}

.options {
  display: grid;
  gap: 9px;
}

.option {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.option input {
  margin-top: 4px;
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--soft);
}

.subfield {
  display: block;
  margin: 10px 0;
}

.subfield span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.risk {
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn);
  color: #694a00;
  font-size: 14px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.image-slot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfcfd;
}

.image-slot strong {
  display: block;
  margin-bottom: 8px;
}

.image-slot input[type="file"] {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}

.image-slot textarea {
  min-height: 70px;
  font-size: 14px;
}

.preview {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.remove-image {
  margin-top: 8px;
  color: var(--danger);
  background: #fff;
  border: 1px solid #f5c2bd;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

button, .button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
}

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

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #17202a;
  color: #fff;
  transition: .2s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.landing {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 14px;
}

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

.card {
  display: block;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.card h2 { margin-bottom: 8px; }

.card p { color: var(--muted); }

@media (max-width: 720px) {
  .image-grid, .cards { grid-template-columns: 1fr; }
  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-inner button {
    width: 100%;
  }
}
