:root {
  --ink: #243247;
  --muted: #77849a;
  --line: #dfe5ec;
  --soft: #f6f8fb;
  --blue: #467ac7;
  --blue-dark: #315fa9;
  --blue-soft: #eef4ff;
  --danger: #c55f57;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f9;
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.questionnaire-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 72px;
}

.questionnaire-header { margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; letter-spacing: .01em; line-height: 1.3; }
h2 { margin-bottom: 0; font-size: 20px; line-height: 1.35; }

.panel {
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(37, 54, 79, .05);
}

.section-heading, .survey-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.required-note { color: var(--muted); font-size: 12px; }

.intro-panel h2 { margin-bottom: 22px; }
.intro-copy { color: #536177; font-size: 15px; line-height: 1.9; }
.intro-copy p { margin: 0 0 13px; }
.intro-copy p:last-child { margin-bottom: 27px; }
.intro-copy strong { color: var(--ink); font-weight: 700; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 16px; margin-top: 28px; }
.field { display: block; min-width: 0; }
.field > span, .gender-field legend { display: block; margin-bottom: 7px; color: #45536a; font-size: 13px; font-weight: 600; }
input, select {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ccd5e1;
  border-radius: 6px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a2adbd; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(70, 122, 199, .12); }

.gender-field { padding: 0; margin: 0; border: 0; }
.gender-field legend { padding: 0; }
.gender-options { display: flex; gap: 10px; }
.gender-options label { flex: 1; position: relative; }
.gender-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gender-options span { display: grid; height: 45px; padding: 0 12px; place-items: center; color: #69778b; text-align: center; border: 1px solid #ccd5e1; border-radius: 6px; cursor: pointer; transition: .15s; }
.gender-options input:checked + span { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.gender-options input:focus-visible + span { outline: 3px solid rgba(70, 122, 199, .18); }

.form-error { min-height: 22px; margin: 13px 0 0; color: var(--danger); font-size: 13px; }
.primary-button, .secondary-button {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 700;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.primary-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.secondary-button { color: #5c6a80; background: #fff; border: 1px solid #ccd5e1; }
.secondary-button:hover { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-soft); }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .45; }

.survey-panel { padding-bottom: 27px; }
.survey-topbar { align-items: end; }
.progress-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.progress-track { height: 5px; margin: 22px 0 29px; overflow: hidden; background: #e9edf3; border-radius: 8px; }
.progress-track span { display: block; height: 100%; width: 4.76%; background: var(--blue); border-radius: inherit; transition: width .2s ease; }
.question-number { margin-bottom: 13px; color: var(--blue); font-size: 14px; font-weight: 700; }
.question-text { margin: 0; min-height: 104px; color: #26354b; font-size: 21px; font-weight: 700; line-height: 1.75; }
.answer-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 29px; }
.answer-option { position: relative; min-width: 0; }
.answer-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.answer-option label { display: flex; min-height: 98px; padding: 11px 7px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #68768b; text-align: center; border: 1px solid #d4dce7; border-radius: 7px; cursor: pointer; transition: .15s; }
.answer-option label strong { color: #52617a; font-size: 20px; line-height: 1; }
.answer-option label span { font-size: 12px; line-height: 1.4; }
.answer-option input:checked + label { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.answer-option input:checked + label strong { color: var(--blue-dark); }
.answer-option input:focus-visible + label { outline: 3px solid rgba(70, 122, 199, .18); }
.survey-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

.completion-panel { text-align: center; padding: 56px 32px; }
.completion-mark { display: grid; width: 55px; height: 55px; margin: 0 auto 17px; place-items: center; color: #fff; font-size: 27px; background: #4eae88; border-radius: 50%; }
.completion-panel h2 { margin-bottom: 5px; }
.completion-panel p { margin-bottom: 0; color: var(--muted); }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .questionnaire-shell { width: min(100% - 22px, 760px); padding: 30px 0 45px; }
  .questionnaire-header { margin-bottom: 18px; }
  h1 { font-size: 24px; }
  .panel { padding: 23px 18px; border-radius: 8px; }
  .field-grid { grid-template-columns: 1fr; gap: 15px; margin-top: 22px; }
  .survey-topbar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .progress-track { margin: 18px 0 22px; }
  .question-text { min-height: 0; font-size: 18px; line-height: 1.7; }
  .answer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 24px; }
  .answer-option label { min-height: 78px; padding: 8px 4px; }
  .answer-option label strong { font-size: 18px; }
  .answer-option label span { font-size: 11px; }
  .survey-actions { margin-top: 24px; }
}
