:root {
  --ink: #f7f3e8;
  --muted: #b9c2cb;
  --paper: #fbfaf6;
  --paper-2: #f1f4f6;
  --line: rgba(9, 16, 24, 0.12);
  --field: #ffffff;
  --navy: #091018;
  --navy-2: #111c27;
  --gold: #d6aa5a;
  --gold-2: #f0d489;
  --teal: #57b9b2;
  --danger: #a63737;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  color: var(--navy);
  background: var(--navy);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  padding: 18px 14px 22px;
  background:
    linear-gradient(180deg, rgba(9, 16, 24, 0.18), rgba(9, 16, 24, 0.88)),
    url("./assets/market-hero.png") center top / cover no-repeat;
  overflow: hidden;
}

.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 16, 24, 0.72), rgba(9, 16, 24, 0.18) 50%, rgba(9, 16, 24, 0.68)),
    linear-gradient(180deg, rgba(9, 16, 24, 0.05), rgba(9, 16, 24, 0.82) 58%, rgba(9, 16, 24, 0.96));
}

.survey-panel {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  height: calc(100vh - 40px);
  min-height: 0;
  max-height: calc(100vh - 40px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(251, 250, 246, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.survey-header {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(9, 16, 24, 0.98), rgba(27, 40, 52, 0.96));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 16px 14px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gold-2);
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.25;
}

.brand-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(214, 170, 90, 0.2);
}

.progress-area {
  margin-top: 15px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-copy strong {
  color: var(--ink);
  white-space: nowrap;
}

.progress-track {
  height: 6px;
  margin-top: 9px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: inherit;
  transition: width 220ms ease;
}

.stage-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 13px;
  min-width: 0;
}

.stage-nav span {
  min-height: 31px;
  display: grid;
  place-items: center;
  padding: 6px 4px;
  color: rgba(247, 243, 232, 0.68);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.73rem;
  text-align: center;
}

.stage-nav span.is-active {
  color: #08111a;
  background: var(--gold-2);
  border-color: var(--gold-2);
  font-weight: 800;
}

.content-area {
  padding: 19px 16px 24px;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-padding-bottom: var(--content-pad-bottom, 92px);
}

.question-frame {
  min-height: 100%;
  padding: 16px 14px;
  background: #ffffff;
  border: 1px solid rgba(9, 16, 24, 0.08);
  border-radius: 10px;
  box-shadow: 0 1px 8px rgba(9, 16, 24, 0.04);
}

.welcome-kicker,
.section-kicker {
  color: #7d642e;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.welcome-title,
.question-title {
  margin: 9px 0 0;
  color: #111820;
  font-size: 1.52rem;
  line-height: 1.2;
}

.welcome-lead {
  margin: 16px 0 0;
  color: #24313c;
  font-size: 0.96rem;
  line-height: 1.7;
}

.welcome-lead + .welcome-lead {
  margin-top: 13px;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.info-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  color: #27313b;
  background: #f1efe7;
  border: 1px solid rgba(125, 100, 46, 0.18);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.question-head {
  margin-bottom: 18px;
}

.question-title {
  font-size: 1.26rem;
}

.question-title .en {
  display: block;
  margin-top: 7px;
  color: #5f6871;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.36;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.meta-chip {
  min-height: 28px;
  color: #394650;
  background: var(--paper-2);
  border-color: rgba(9, 16, 24, 0.08);
  font-size: 0.74rem;
}

.meta-chip.required {
  color: #6a4310;
  background: #fff4d8;
  border-color: rgba(214, 170, 90, 0.4);
}

.field-grid {
  display: grid;
  gap: 13px;
}

.field-pair {
  display: grid;
  gap: 7px;
}

.field-pair label,
.text-label {
  color: #18222c;
  font-size: 0.91rem;
  font-weight: 800;
  line-height: 1.35;
}

.field-pair label span,
.text-label span {
  display: block;
  margin-top: 2px;
  color: #68727b;
  font-size: 0.78rem;
  font-weight: 650;
}

.text-input,
.text-area {
  width: 100%;
  color: #111820;
  background: var(--field);
  border: 1px solid rgba(9, 16, 24, 0.16);
  border-radius: 8px;
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.text-input {
  min-height: 48px;
  padding: 12px 13px;
}

.text-area {
  min-height: 138px;
  padding: 13px;
  line-height: 1.55;
  resize: vertical;
}

.text-input:focus,
.text-area:focus {
  background: #fffdf8;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 170, 90, 0.18);
}

.option-list {
  display: grid;
  gap: 9px;
}

.option-button {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 12px;
  color: #16222c;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(9, 16, 24, 0.13);
  border-radius: 8px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-button:hover {
  border-color: rgba(214, 170, 90, 0.62);
}

.option-button.is-selected {
  background: #fff8e8;
  border-color: var(--gold);
}

.option-button.is-selected .choice-mark {
  background: var(--gold);
  border-color: var(--gold);
}

.option-button.is-selected .choice-mark::after {
  opacity: 1;
}

.option-button.multi .choice-mark {
  border-radius: 5px;
}

.choice-mark {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid rgba(9, 16, 24, 0.24);
  border-radius: 50%;
  background: #fff;
}

.choice-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #091018;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}

.choice-text {
  min-width: 0;
  line-height: 1.35;
}

.choice-text strong {
  display: block;
  font-size: 0.94rem;
}

.choice-text span {
  display: block;
  margin-top: 3px;
  color: #6b737b;
  font-size: 0.8rem;
  font-weight: 650;
}

.extra-field {
  margin: 8px 0 5px 34px;
}

.validation {
  display: none;
  margin: 14px 0 0;
  padding: 11px 12px;
  color: #6c1d1d;
  background: #fff0ee;
  border: 1px solid rgba(166, 55, 55, 0.22);
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.validation.is-visible {
  display: block;
}

.summary-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.summary-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-row strong {
  color: #18222c;
  font-size: 0.86rem;
}

.summary-row span {
  color: #59636d;
  font-size: 0.82rem;
  line-height: 1.45;
}

.success-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #08111a;
  background: var(--gold-2);
  border-radius: 50%;
  font-size: 1.7rem;
  font-weight: 900;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.action-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  padding: 12px 14px 14px;
  background: rgba(251, 250, 246, 0.96);
  border-top: 1px solid rgba(9, 16, 24, 0.1);
  backdrop-filter: blur(12px);
  z-index: 2;
}

@supports (height: 100dvh) {
  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
  }

  .survey-panel {
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
  }
}

.ghost-button,
.primary-button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1.1;
}

.ghost-button {
  color: #26323c;
  background: #eceff1;
}

.primary-button {
  color: #071019;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 22px rgba(128, 91, 29, 0.28);
}

.secondary-button {
  color: #071019;
  background: #e4eff0;
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

@media (min-width: 760px) {
  .app-shell {
    display: grid;
    place-items: center;
    padding: 30px;
  }

  .survey-panel {
    height: calc(100vh - 60px);
    min-height: 0;
    max-height: calc(100vh - 60px);
  }

  .survey-header {
    padding: 19px 24px 17px;
  }

  .content-area {
    padding: 27px 28px 28px;
  }

  .question-frame {
    padding: 22px 20px;
  }

  .field-grid.two {
    grid-template-columns: 1fr 1fr;
  }

  .option-list.compact {
    grid-template-columns: 1fr 1fr;
  }

  .action-bar {
    padding: 14px 24px 18px;
  }
}

@media (max-width: 520px) {
  .survey-panel {
    max-width: 360px;
    margin: 0;
  }

  .stage-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .stage-nav span {
    min-height: 34px;
    font-size: 0.68rem;
  }

  .welcome-title {
    font-size: 1.34rem;
  }

  .question-title {
    font-size: 1.12rem;
  }

  .question-frame {
    padding: 14px 12px;
    border-radius: 8px;
  }

  .action-bar {
    grid-template-columns: 1fr;
  }
}
