:root {
  --brand: #1f5c99;
  --brand-dark: #154372;
  --brand-soft: #e8eff7;
  --brand-faint: #f7fafd;
  --ok: #2e9e5b;
  --warn: #d9822b;
  --danger: #c0392b;
  --ink: #1f2933;
  --muted: #6b7785;
  --line: #dfe6ee;
  --bg: #eef3f8;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(31, 92, 153, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 80px; }

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 34px 0 28px;
}
.hero .wrap { padding-bottom: 0; }
.hero h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.35; }
.hero .sub { margin: 0 0 14px; opacity: 0.92; font-size: 14px; }
.hero .meta { font-size: 13px; opacity: 0.85; }
.hero .meta b { font-weight: 600; }

/* ---------- 填写说明 ---------- */
.intro {
  background: var(--brand-faint);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.intro h3 { margin: 0 0 8px; color: var(--brand); font-size: 15px; }
.intro ul { margin: 0; padding-left: 18px; color: #44505d; }
.intro li { margin: 4px 0; }

/* ---------- 进度条 ---------- */
.progress-wrap {
  position: sticky; top: 0; z-index: 30;
  background: rgba(238, 243, 248, 0.96);
  backdrop-filter: blur(6px);
  padding: 10px 0;
  margin-bottom: 8px;
}
.progress-bar { height: 8px; background: #d7e1ec; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #3a86d4); transition: width .25s ease; }
.progress-text { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: right; }

/* ---------- 区块 ---------- */
.section { margin: 26px 0 8px; }
.section-title {
  font-size: 17px; font-weight: 700; color: var(--brand);
  padding: 6px 0 6px 12px; border-left: 4px solid var(--brand);
  margin-bottom: 4px;
}

/* ---------- 题卡 ---------- */
.q {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow);
}
.q.invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(192,57,43,.12); }
.q-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.q-title .no { color: var(--brand); margin-right: 4px; }
.q-title .req { color: var(--danger); margin-left: 4px; }
.q-tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  margin-left: 6px; vertical-align: middle;
}
.q-tag.single { background: #eaf2fb; color: var(--brand); }
.q-tag.multi { background: #eaf7ef; color: var(--ok); }
.q-tag.optional { background: #f0f0f0; color: var(--muted); }
.q-note { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

/* ---------- 选项 ---------- */
.options { display: flex; flex-direction: column; gap: 8px; }
.options.cols { flex-direction: row; flex-wrap: wrap; }
.opt {
  display: flex; align-items: flex-start; gap: 9px;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  cursor: pointer; transition: all .15s ease; font-size: 14px; background: #fff;
}
.options.cols .opt { flex: 1 1 calc(50% - 4px); }
.opt:hover { border-color: var(--brand); background: var(--brand-faint); }
.opt input { margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }
.opt.checked { border-color: var(--brand); background: var(--brand-soft); font-weight: 500; }
.opt-other-text {
  margin-top: 8px; width: 100%;
}

/* ---------- 文本输入 ---------- */
input[type="text"], textarea, .opt-other-text input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; transition: border-color .15s;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.fields { display: flex; gap: 12px; flex-wrap: wrap; }
.fields .field { flex: 1 1 200px; }
.fields .field label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 4px; }
.followup { margin-top: 10px; }
.followup label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 4px; }

/* ---------- 矩阵评分 ---------- */
.matrix { display: flex; flex-direction: column; gap: 10px; }
.matrix-row { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.matrix-row .label { font-size: 14px; margin-bottom: 8px; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale .pill {
  min-width: 38px; text-align: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 0; cursor: pointer; font-size: 14px; transition: all .15s; user-select: none;
}
.scale .pill:hover { border-color: var(--brand); }
.scale .pill.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* ---------- 排序题 ---------- */
.rank-items { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-size: 14px;
  cursor: pointer; transition: all .15s;
}
.rank-item:hover { border-color: var(--brand); }
.rank-item.picked { background: var(--brand-soft); border-color: var(--brand); }
.rank-badge {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 1.5px dashed #b9c6d4; color: var(--muted);
}
.rank-item.picked .rank-badge { background: var(--brand); color: #fff; border-style: solid; border-color: var(--brand); }

/* ---------- 提交 ---------- */
.submit-bar { margin-top: 26px; text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 13px 40px; font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 8px 18px; font-size: 14px; }
.privacy { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ---------- 完成态 ---------- */
.done {
  text-align: center; background: #fff; border-radius: var(--radius);
  padding: 50px 24px; box-shadow: var(--shadow); margin-top: 40px;
}
.done .check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--ok);
  color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.done h2 { margin: 0 0 10px; color: var(--ink); }
.done p { color: var(--muted); margin: 0 0 20px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: var(--danger); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 99; opacity: 0;
  transition: opacity .2s, bottom .2s; pointer-events: none;
}
.toast.show { opacity: 1; bottom: 40px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }

@media (max-width: 560px) {
  .hero h1 { font-size: 20px; }
  .options.cols .opt { flex-basis: 100%; }
  .scale .pill { min-width: 32px; }
}
