:root {
  --bg-1: #f2f7ff;
  --bg-2: #eefaf7;
  --bg-3: #fff8f1;
  --card: #ffffff;
  --primary: #4c7df0;
  --primary-dark: #3560d6;
  --primary-soft: #eaf1ff;
  --accent: #19b39a;
  --text: #1f2b45;
  --text-soft: #46577a;
  --muted: #7d8aa8;
  --line: #e4ecf9;
  --danger: #e5573f;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(76, 125, 240, 0.09);
  --shadow-sm: 0 2px 10px rgba(76, 125, 240, 0.07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1) 0%, #f7fbff 45%, var(--bg-2) 75%, var(--bg-3) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 16px;
}

p { margin: 0; }

.page { min-height: 100vh; padding-bottom: 90px; }

/* ---------- 顶部标题 ---------- */
.hero {
  padding: 46px 20px 30px;
  background:
    radial-gradient(1200px 300px at 15% 0%, rgba(76, 125, 240, 0.16), transparent 70%),
    radial-gradient(900px 260px at 88% 10%, rgba(25, 179, 154, 0.14), transparent 70%);
  text-align: center;
}

.hero-inner { max-width: 760px; margin: 0 auto; }

.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dbe7fb;
  color: var(--primary);
  font-size: 12.5px;
  letter-spacing: .06em;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 16px 0 8px;
  font-size: 30px;
  letter-spacing: .02em;
  font-weight: 700;
  color: #1b2b4d;
}

.hero-sub { color: var(--text-soft); font-size: 14.5px; }

/* ---------- 进度条 ---------- */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(228, 236, 249, 0.9);
}

.progress-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: #e8effb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #6ea1ff, #4c7df0 60%, #19b39a);
  transition: width .35s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 布局与卡片 ---------- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 16px 0;
}

.card {
  scroll-margin-top: 74px;
  background: var(--card);
  border: 1px solid rgba(228, 236, 249, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin-bottom: 18px;
}

.card p { color: var(--text-soft); font-size: 15px; }

.intro-card p { line-height: 1.9; }

.intro-points {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.intro-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  background: #f7faff;
  border-radius: 12px;
  padding: 9px 12px;
}

.dot-ico {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- 小节标题 ---------- */
.sec-head { margin-bottom: 20px; }

.sec-head h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: #1b2b4d;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-head h2::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 99px;
  background: linear-gradient(180deg, #6ea1ff, #19b39a);
}

.sec-desc { font-size: 14px !important; color: var(--muted) !important; line-height: 1.8; }

/* ---------- 分值说明 ---------- */
.legend {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, #f5f9ff, #f3fdfa);
  border: 1px dashed #d5e4fa;
}

.legend-title {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: .04em;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
}

.legend-item {
  font-size: 12.5px;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-item b {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cadcf6;
  color: var(--primary);
  font-size: 11px;
  display: grid;
  place-items: center;
}

/* ---------- 基本信息 ---------- */
.personal-list { display: grid; gap: 4px; }

.personal-item {
  padding: 14px 0;
  border-bottom: 1px dashed #edf3fc;
}

.personal-item:last-child { border-bottom: none; }

.p-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #24344f;
  margin-bottom: 10px;
}

.p-no {
  flex: none;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.req { color: var(--danger); font-style: normal; font-size: 13px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { position: relative; cursor: pointer; }

.pill input { position: absolute; opacity: 0; pointer-events: none; }

.pill span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fbfdff;
  color: var(--text-soft);
  font-size: 14px;
  transition: all .18s ease;
}

.pill:hover span { border-color: #b9cdf5; background: #f4f8ff; }

.pill input:checked + span {
  border-color: transparent;
  background: linear-gradient(135deg, #5b8bf7, #4c7df0);
  color: #fff;
  box-shadow: 0 6px 16px rgba(76, 125, 240, 0.28);
}

.pill input:focus-visible + span { outline: 2px solid #9fc0ff; outline-offset: 2px; }

.input-wrap { position: relative; max-width: 420px; display: flex; align-items: center; }

.input-wrap input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfdff;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input-wrap input::placeholder { color: #a9b6ce; }

.input-wrap input:focus {
  outline: none;
  border-color: #8db0f8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(76, 125, 240, 0.12);
}

.input-wrap .unit {
  position: absolute;
  right: 14px;
  font-size: 13.5px;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap input[type="number"] { padding-right: 42px; }

/* ---------- 量表题目 ---------- */
.group { margin-top: 6px; }

.group + .group { margin-top: 18px; padding-top: 6px; border-top: 1px dashed #eef3fc; }

.group-title {
  display: inline-block;
  margin: 10px 0 4px;
  padding: 4px 12px;
  border-radius: 8px;
  background: #f2fbf8;
  border: 1px solid #d4f0e8;
  color: #0f8f7b;
  font-size: 13px;
  font-weight: 600;
}

.q {
  padding: 16px 0 14px;
  border-bottom: 1px solid #f1f6fd;
}

.q:last-child { border-bottom: none; }

.q.has-error { background: #fff7f5; border-radius: 12px; padding-left: 12px; padding-right: 12px; }

.q-head { display: flex; gap: 10px; align-items: flex-start; }

.q-no {
  flex: none;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  margin-top: 2px;
  border-radius: 8px;
  background: #f1f5fd;
  color: #7d8aa8;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.q.answered .q-no { background: var(--primary-soft); color: var(--primary); }

.q-text {
  font-size: 15.2px;
  color: #24344f;
  line-height: 1.7;
}

.scale-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0 36px;
}

.scale-end {
  flex: none;
  width: 66px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.scale-end:last-child { text-align: center; }

.scale {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-width: 470px;
}

.opt { position: relative; cursor: pointer; }

.opt input { position: absolute; opacity: 0; pointer-events: none; }

.opt-dot {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 11px;
  border: 1.5px solid #e1eaf8;
  background: #fbfdff;
  color: #5d6e8f;
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all .16s ease;
  user-select: none;
}

.opt:hover .opt-dot { border-color: #a9c5f7; background: #f3f8ff; color: var(--primary); }

.opt input:checked + .opt-dot {
  border-color: transparent;
  background: linear-gradient(135deg, #5b8bf7, #4470ea);
  color: #fff;
  box-shadow: 0 6px 16px rgba(76, 125, 240, 0.3);
  transform: translateY(-1px);
}

.opt input:focus-visible + .opt-dot { outline: 2px solid #9fc0ff; outline-offset: 2px; }

.opt-mobile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sel-label {
  margin: 7px 0 0 36px;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
}

.field-error {
  margin: 5px 0 0 36px;
  min-height: 0;
  font-size: 12.5px;
  color: var(--danger);
}

.field-error:empty { display: none; }

.personal-item .field-error { margin-left: 0; }

/* ---------- 提交区 ---------- */
.submit-card { text-align: center; padding: 32px 24px; }

.submit-tip { font-size: 15px; color: var(--text-soft) !important; margin-bottom: 18px; }

.btn-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 14px 40px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b8bf7, #4173e8 55%, #2f9fd8);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(65, 115, 232, 0.32);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(65, 115, 232, 0.38); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: .72; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn-submit.loading .btn-spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.submit-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted) !important; }

.footer {
  text-align: center;
  font-size: 12.5px;
  color: #9aa8c2;
  padding: 26px 0 34px;
}

/* ---------- 移动端悬浮提交条 ---------- */
.float-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(76, 125, 240, 0.08);
}

.float-progress { font-size: 13px; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.float-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b8bf7, #4173e8);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(65, 115, 232, 0.3);
}

.float-btn:disabled { opacity: .6; }

/* ---------- 提示弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(30, 46, 76, 0.28);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay[hidden] { display: none; }

.toast {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 26px 24px 20px;
  box-shadow: 0 24px 60px rgba(30, 46, 76, 0.2);
  text-align: center;
  animation: pop .22s ease;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.toast h3 { margin: 0 0 8px; font-size: 17px; color: #1b2b4d; }
.toast p { font-size: 14px; color: var(--text-soft); }

.toast-btn {
  margin-top: 18px;
  padding: 10px 30px;
  border: none;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 完成页 ---------- */
.done {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #f2f7ff, #f0fbf7 70%, #fff8f1);
}

.done[hidden] { display: none; }

.done-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 44px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(76, 125, 240, 0.16);
}

.done-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, #35c9a8, #19b39a);
  box-shadow: 0 12px 26px rgba(25, 179, 154, 0.32);
}

.done-card h2 { margin: 0 0 10px; font-size: 22px; color: #1b2b4d; }
.done-card p { font-size: 14.5px; color: var(--text-soft); }
.done-id { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }

  .hero { padding: 32px 16px 22px; }
  .hero h1 { font-size: 23px; }
  .hero-sub { font-size: 13px; }

  .container { padding: 0 12px; }
  .card { padding: 20px 16px; border-radius: 16px; }

  .sec-head h2 { font-size: 17px; }
  .sec-desc { font-size: 13.5px !important; }

  .legend { padding: 10px 12px; }
  .legend-items { gap: 5px 10px; }
  .legend-item { font-size: 11.8px; }

  .q { padding: 14px 0 12px; }
  .q-text { font-size: 14.6px; }

  .scale-wrap { margin-left: 0; margin-top: 10px; gap: 0; }
  .scale-end { display: none; }
  .scale { gap: 5px; max-width: none; }
  .opt-dot { height: 36px; border-radius: 9px; font-size: 14px; }

  .sel-label, .field-error { margin-left: 0; }

  .pill span { padding: 7px 13px; font-size: 13.5px; }
  .input-wrap { max-width: none; }

  .btn-submit { width: 100%; min-width: 0; }
  .submit-card { padding: 24px 18px; }

  .float-bar { display: flex; }
  .page { padding-bottom: 96px; }
}

@media (max-width: 380px) {
  .scale { gap: 4px; }
  .opt-dot { height: 34px; font-size: 13.5px; }
  .legend-item { font-size: 11px; }
}

@media (min-width: 721px) {
  .float-bar { display: none; }
}

/* ---------- 微信分享 ---------- */
.share-source {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 300px;
  height: 300px;
  opacity: 0;
  pointer-events: none;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #d7e6fb;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all .18s ease;
}

.share-chip:hover {
  border-color: #b3ccf7;
  background: #fff;
  transform: translateY(-1px);
}

.share-overlay { align-items: flex-start; padding-top: 70px; }

.share-tip {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(30, 46, 76, 0.22);
  animation: pop .22s ease;
}

.share-arrow {
  color: var(--primary);
  display: flex;
  justify-content: flex-end;
  margin: -12px 0 2px;
}

.share-arrow svg { transform: rotate(-45deg); }

.share-tip h3 { margin: 0 0 10px; font-size: 17px; color: #1b2b4d; }
.share-tip p { font-size: 13.8px; line-height: 1.75; color: var(--text-soft); }

.share-preview {
  display: block;
  width: 120px;
  height: 120px;
  margin: 16px auto 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(76, 125, 240, 0.14);
}

.share-preview-cap {
  font-size: 12.5px !important;
  color: var(--muted) !important;
}

.done-share {
  display: inline-block;
  margin-top: 22px;
  padding: 11px 26px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #5b8bf7, #4173e8);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(65, 115, 232, 0.28);
}

.done-share:active { transform: translateY(1px); }
