:root {
  --ink: #202124;
  --muted: #697079;
  --line: #dde3e8;
  --paper: #f6f3ed;
  --panel: #ffffff;
  --deep: #24332f;
  --green: #2f775d;
  --blue: #315f86;
  --rose: #a85e61;
  --gold: #bd8a3f;
  --soft: #ecf4ef;
  --shadow: 0 18px 48px rgba(25, 31, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 119, 93, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(168, 94, 97, 0.1), transparent 36%),
    var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.survey-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  color: #fff;
  background: var(--deep);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--deep);
  background: #e8c980;
  font-weight: 800;
}

.brand-block strong,
.brand-block span,
.progress-card span {
  display: block;
}

.brand-block span,
.progress-card span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.step-nav {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.step-nav button {
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
}

.step-nav button.active,
.step-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.progress-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-card strong {
  display: block;
  margin: 6px 0 14px;
  font-size: 30px;
}

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

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #e8c980;
}

.form-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar p {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ghost-btn,
.primary-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
}

.ghost-btn {
  color: var(--deep);
  background: #fff;
}

.primary-btn {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.section-card {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-card.active {
  display: block;
}

.section-head {
  padding: 24px 26px;
  color: #fff;
  background: linear-gradient(120deg, var(--deep), var(--blue));
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.section-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px 26px 28px;
}

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

.field.wide {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  color: #30343a;
  font-weight: 700;
  line-height: 1.5;
}

.field small {
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
}

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

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  font-weight: 400;
}

.choice-list input {
  width: auto;
}

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

.members-grid label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.form-footer span {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 8px;
  padding: 13px 15px;
  color: #fff;
  background: var(--deep);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .survey-app {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    height: auto;
  }

  .step-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .form-panel,
  .side-panel,
  .section-head,
  .field-grid {
    padding: 18px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .field-grid,
  .members-grid,
  .step-nav {
    grid-template-columns: 1fr;
  }

  .actions,
  .form-footer {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .side-panel,
  .topbar .actions,
  .form-footer,
  .toast {
    display: none !important;
  }

  .survey-app {
    display: block;
  }

  .form-panel {
    width: 100%;
    padding: 0;
  }

  .section-card {
    display: block !important;
    page-break-inside: avoid;
    margin-bottom: 18px;
    box-shadow: none;
  }
}
