:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #1d2233;
  --ink-soft: #5b6178;
  --ink-faint: #9aa0b4;
  --line: #e8eaf2;
  --brand: #4f46e5;
  --brand-deep: #4338ca;
  --brand-soft: #eef0fe;
  --accent: #0ea5a4;
  --warn: #e11d48;
  --warn-soft: #fff1f3;
  --gold: #b45309;
  --green: #0f9d58;
  --shadow: 0 10px 30px rgba(31, 38, 81, .08);
  --shadow-sm: 0 2px 10px rgba(31, 38, 81, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px 140px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #0ea5a4 120%);
  color: #fff;
  padding: 46px 18px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
  background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero h1 { margin: 0 0 10px; font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.hero .sub { margin: 0 auto; max-width: 560px; font-size: 14px; opacity: .92; }
.hero .pills { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; backdrop-filter: blur(4px); }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px; margin: 16px 0;
}
.card.lift { box-shadow: var(--shadow); }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 6px; height: 18px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--accent)); }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.field label .req { color: var(--warn); margin-left: 3px; }
.input {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fbfbfe; transition: .15s;
  font-family: inherit;
}
.input:focus { outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px var(--brand-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Question ---------- */
.q-card { scroll-margin-top: 16px; }
.q-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.q-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}
.q-card.done .q-num { background: linear-gradient(135deg, var(--accent), #0d9488); }
.q-text { font-size: 16px; font-weight: 600; color: var(--ink); padding-top: 4px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fcfcff; transition: .14s;
}
.opt:hover { border-color: #c7caf6; background: #fafaff; }
.opt .mark {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd3e6;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: transparent;
  transition: .14s; margin-top: 1px;
}
.opt .key { font-weight: 700; color: var(--ink-soft); margin-right: 2px; }
.opt .otext { font-size: 14.5px; color: var(--ink); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .mark { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
textarea.input { min-height: 130px; resize: vertical; line-height: 1.7; }
.char-hint { text-align: right; font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

/* ---------- Sticky bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(31,38,81,.07);
}
.bar-in { max-width: 760px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; }
.progress .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.progress .track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .3s ease; }

/* ---------- Button ---------- */
.btn {
  appearance: none; border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  font-size: 15px; padding: 12px 22px; border-radius: 12px; transition: .15s; white-space: nowrap;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 6px 16px rgba(79,70,229,.32); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:disabled { background: #c7cad8; box-shadow: none; cursor: not-allowed; transform: none; filter: none; }
.btn-ghost { background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------- Toast / states ---------- */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%) translateY(-20px);
  background: #1d2233; color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--warn); }

/* ---------- Done screen ---------- */
.done-screen { text-align: center; padding: 60px 24px; }
.done-screen .check {
  width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0d9488); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(14,165,164,.3); animation: pop .4s ease;
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.done-screen h2 { font-size: 23px; margin: 0 0 12px; }
.done-screen p { color: var(--ink-soft); font-size: 15px; max-width: 420px; margin: 0 auto; }
.hidden { display: none !important; }
