:root {
  --page: #f5f6f8;
  --card: #ffffff;
  --text: #222222;
  --text-soft: #4a4a4a;
  --muted: #8a8f99;
  --line: #eceff3;
  --line-strong: #d9dee7;
  --primary: #1e88ff;
  --primary-dark: #0f72e5;
  --primary-soft: #eaf4ff;
  --danger: #f04438;
  --danger-soft: #fff5f4;
  --shadow: 0 7px 18px rgba(31, 45, 61, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 0 12px 24px;
}

.hero {
  margin: 0 -12px;
  padding: 28px 16px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.hero__copy {
  max-width: 100%;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero p:not(.eyebrow) {
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 14px;
  text-align: left;
}

.hero__visual {
  display: none;
}

.layout {
  display: block;
}

.panel {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.progress {
  padding: 0;
}

.progress__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.progress__top strong {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.progress__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.2s ease;
}

.section-nav {
  display: none;
  gap: 8px;
  margin: 12px -2px 0;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav__item {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #555d69;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.section-nav__item.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0 16px;
  font-weight: 600;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.button:active {
  transform: scale(0.99);
}

.button--primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.button--primary:hover {
  background: var(--primary-dark);
}

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

.button--ghost {
  border-color: var(--line-strong);
  background: #fff;
  color: #555d69;
}

.survey,
#questionHost {
  display: grid;
  gap: 10px;
}

.section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.section__header h2 {
  margin: 0;
  color: #2b2f36;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.section__header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.question {
  position: relative;
  margin: 0;
  padding: 17px 15px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.question:last-child {
  border-bottom: 0;
}

.question__title {
  display: block;
  margin-bottom: 13px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.question__num {
  display: inline;
  min-width: auto;
  height: auto;
  margin-right: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
}

.question__num::after {
  content: ".";
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.hint {
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.options {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-height: 48px;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.option:last-child {
  border-bottom: 0;
}

.option:has(input:checked) {
  background: #f4f9ff;
}

.option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.option__text {
  min-width: 0;
  color: #333842;
  font-size: 14px;
}

.other-input {
  display: none;
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.option:has(input:checked) .other-input {
  display: block;
}

textarea {
  display: block;
  width: 100%;
  min-height: 106px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

textarea::placeholder,
.other-input::placeholder {
  color: #a3a9b3;
}

textarea:focus,
.other-input:focus,
.button:focus-visible,
.section-nav__item:focus-visible,
.option:has(input:focus-visible) {
  outline: 2px solid rgba(30, 136, 255, 0.18);
  outline-offset: 2px;
}

.question.is-missing {
  background: var(--danger-soft);
}

.question.is-missing::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--danger);
}

.question.is-missing .question__title {
  color: #c42118;
}

.submit-card {
  margin-top: 0;
  padding: 16px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.submit-card h2,
.submit-card p {
  margin: 0;
}

.submit-card .eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.submit-card h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.submit-card p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.submit-card__actions {
  margin-top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 48px);
  padding: 10px 14px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
