:root {
  --blue: #2563eb;
  --indigo: #4f46e5;
  --violet: #7c3aed;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--slate-800);
  background: linear-gradient(to top right, var(--slate-50), #ffffff 45%, #eff6ff);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.beian-footer {
  text-align: center;
  padding: 14px 16px 22px;
  font-size: 12px;
  line-height: 1.9;
  color: #94a3b8;
}
.beian-footer a {
  color: #94a3b8;
  text-decoration: none;
}
.beian-footer a:hover { color: #64748b; text-decoration: underline; }
.beian-footer .sep { margin: 0 8px; color: #cbd5e1; }
.beian-footer .police {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--slate-100);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.intro { max-width: 520px; padding: 40px 32px; text-align: center; }
.quiz-card { max-width: 680px; padding: 28px; }
.result-card { max-width: 720px; padding: 28px; }

.title-gradient {
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, var(--blue), var(--indigo), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { color: var(--slate-600); font-size: 14px; margin: 12px 0 0; }

.dim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}
.dim-tile {
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 12px;
  padding: 14px 6px;
  text-align: center;
}
.dim-tile .emoji { font-size: 20px; }
.dim-tile p { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--slate-700); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 0 20px;
  height: 48px;
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s;
  font-family: inherit;
}
.btn-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(to right, var(--blue), var(--indigo));
}
.btn-primary:hover { transform: scale(1.03); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24); }
.btn-outline {
  background: #fff;
  border: 1px solid #bfdbfe;
  color: var(--blue);
  height: 44px;
  font-size: 14px;
}
.btn-outline:hover { background: #eff6ff; }
.btn-ghost {
  background: transparent;
  color: var(--slate-500);
  height: 40px;
  font-size: 14px;
}
.btn-ghost:hover { color: var(--slate-700); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Quiz */
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.quiz-step { font-size: 13px; color: var(--slate-500); font-weight: 600; }
.quiz-dim { font-size: 13px; color: var(--indigo); font-weight: 600; }
.progress {
  height: 8px;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress > div {
  height: 100%;
  background: linear-gradient(to right, var(--blue), var(--indigo));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.q-emoji { font-size: 26px; }
.q-title { font-size: 13px; color: var(--indigo); font-weight: 700; margin: 8px 0 4px; }
.q-text { font-size: 19px; font-weight: 700; line-height: 1.5; margin: 0 0 22px; color: var(--slate-800); }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  text-align: left;
  border: 1.5px solid var(--slate-200);
  background: #fff;
  border-radius: 12px;
  padding: 15px 16px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
  color: var(--slate-700);
  transition: all 0.18s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-family: inherit;
}
.option:hover { border-color: #a5b4fc; background: #f5f3ff; transform: translateX(2px); }
.option.selected { border-color: var(--indigo); background: #eef2ff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }
.option .dot {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--slate-300, #cbd5e1);
  margin-top: 1px;
  display: grid; place-items: center;
}
.option.selected .dot { border-color: var(--indigo); }
.option.selected .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--indigo); }
.quiz-nav { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; }

/* Result */
.result-head { text-align: center; margin-bottom: 8px; }
.result-badge { font-size: 46px; line-height: 1; }
.result-title { font-size: 22px; font-weight: 800; margin: 10px 0 2px; }
.result-score { font-size: 15px; color: var(--slate-500); }
.result-score b { font-size: 30px; color: var(--indigo); font-weight: 800; }
.section { margin-top: 26px; }
.section h3 { font-size: 15px; font-weight: 700; color: var(--slate-800); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.radar-wrap { display: flex; justify-content: center; }
.panel {
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
}
.profile-text { font-size: 14.5px; line-height: 1.75; color: var(--slate-700); margin: 0; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; gap: 10px; font-size: 14px; line-height: 1.7; color: var(--slate-700); }
.list li .num {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  background: #eef2ff; color: var(--indigo);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px;
}
.course {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--slate-200);
  margin-bottom: 10px;
}
.course .cid { font-weight: 800; color: var(--violet); font-size: 13px; background: #f5f3ff; border-radius: 8px; padding: 3px 8px; }
.course .cname { font-weight: 600; color: var(--slate-800); font-size: 14.5px; }
.course .cout { font-size: 12.5px; color: var(--slate-500); margin-top: 3px; }

.lead-box { margin-top: 14px; }
.lead-box input, .lead-box textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--slate-200); border-radius: 10px;
  font-size: 14px; font-family: inherit; margin-bottom: 10px; background: #fff;
}
.lead-box textarea { resize: vertical; min-height: 60px; }
.qr-block { text-align: center; margin-top: 14px; }
.qr-block img, .qr-placeholder {
  width: 180px; height: 180px; object-fit: contain; border-radius: 12px; border: 1px solid var(--slate-200); background: #fff;
}
.qr-placeholder { display: grid; place-items: center; color: var(--slate-400); font-size: 13px; margin: 0 auto; }
.qr-text { font-size: 13px; color: var(--slate-600); line-height: 1.7; margin: 12px auto 0; max-width: 460px; }

.result-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.result-actions .btn { flex: 1; min-width: 160px; }

.tier-accent { border-width: 1.5px; }
.hidden { display: none !important; }
.fade-in { animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- v2: 30-question quick version ---- */
.book-line { margin: 18px 0 0; font-size: 11.5px; color: var(--slate-400); line-height: 1.6; }
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; }
.q-type { flex: 0 0 auto; font-size: 11px; color: var(--slate-500); background: var(--slate-100); border-radius: 999px; padding: 2px 9px; }
.hint-line { font-size: 12.5px; color: var(--slate-400); margin: 12px 0 0; }
.option .box { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #cbd5e1; margin-top: 1px; display: grid; place-items: center; }
.option.selected .box { border-color: var(--indigo); background: var(--indigo); }
.option.selected .box::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.btn-next { height: 42px; padding: 0 22px; width: auto; }
.open-input { width: 100%; border: 1.5px solid var(--slate-200); border-radius: 12px; padding: 14px; font-size: 15px; font-family: inherit; line-height: 1.6; resize: vertical; }
.open-input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.15); }

.result-sub { font-size: 13px; color: var(--slate-500); margin-top: 4px; }
.dim-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 10px; font-size: 12.5px; color: var(--slate-600); }
.dim-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dim-legend i { font-style: normal; }
.dim-legend b { color: var(--indigo); }

.persona-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #eef2ff, #faf5ff); border: 1px solid #e0e7ff; }
.persona-emoji { font-size: 38px; line-height: 1; }
.persona-name { font-size: 18px; font-weight: 800; color: var(--slate-800); }
.persona-portrait { font-size: 14px; color: var(--slate-600); margin: 6px 0 8px; line-height: 1.6; }
.persona-line { font-size: 13px; color: var(--slate-600); margin: 3px 0; line-height: 1.6; }
.persona-line b { color: var(--slate-700); }

.need-title { font-size: 13px; font-weight: 700; color: var(--slate-700); margin: 14px 0 8px; }
.match-product { margin-top: 14px; font-size: 13.5px; color: var(--slate-700); background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 12px; }
.match-product b { color: #c2410c; }

.diag { border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--slate-200); }
.diag.low { background: #fef2f2; border-color: #fecaca; }
.diag.mid { background: #fffbeb; border-color: #fde68a; }
.diag.high { background: #f0fdf4; border-color: #bbf7d0; }
.diag-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--slate-800); margin-bottom: 6px; }
.diag-tag { flex: 0 0 auto; font-size: 11.5px; font-weight: 600; color: var(--slate-500); }
.diag p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--slate-700); }
.diag-ref { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(100,116,139,.25); font-size: 12.5px; line-height: 1.65; color: var(--slate-500); }
.course-cta { margin: 14px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--slate-500); background: var(--slate-50); border: 1px solid var(--slate-100); border-radius: 10px; padding: 10px 12px; }

.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-row { display: flex; gap: 12px; padding: 11px 13px; border-radius: 10px; background: var(--slate-50); border: 1px solid var(--slate-100); }
.a-day { flex: 0 0 66px; font-size: 12px; font-weight: 700; color: var(--indigo); padding-top: 1px; }
.a-act { font-size: 13.5px; color: var(--slate-800); line-height: 1.55; }
.a-out { font-size: 12px; color: var(--slate-500); margin-top: 3px; }

.gate-box { margin-top: 6px; text-align: center; }
.gate-hint { font-size: 13.5px; color: var(--slate-600); line-height: 1.7; margin: 0 0 14px; }
.gate-box input { width: 100%; padding: 13px 14px; border: 1.5px solid var(--slate-200); border-radius: 12px; font-size: 16px; text-align: center; letter-spacing: 1px; font-family: inherit; margin-bottom: 12px; }
.gate-box input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.15); }
.gate-box .btn { width: 100%; }
.gate-err { color: #dc2626; font-size: 13px; min-height: 18px; margin-top: 8px; }
.gate-buy { font-size: 12.5px; color: var(--slate-500); margin: 12px 0 0; line-height: 1.6; }
.gate-buy b { color: var(--indigo); }
.deep-link { display: block; text-align: center; text-decoration: none; margin: 4px 0 16px; }
.cta-panel { background: linear-gradient(135deg, #eff6ff, #eef2ff); border-color: #dbeafe; }
.wechat-line { text-align: center; font-size: 14px; color: var(--slate-700); margin-top: 12px; }
.wechat-line b { color: var(--indigo); letter-spacing: .5px; }
.lead-tip { font-size: 13px; color: var(--slate-600); margin: 16px 0 8px; }
.lead-msg { font-size: 13px; text-align: center; margin-top: 8px; }

@media (max-width: 520px) {
  .title-gradient { font-size: 26px; }
  .q-text { font-size: 17px; }
  .result-actions .btn { min-width: 100%; }
  .a-day { flex-basis: 56px; }
}

/* ---- Survey (痛点调研) ---- */
.survey-intro { text-align: left; }
.survey-intro .title-gradient, .survey-intro .subtitle { text-align: center; }
.survey-note { font-size: 13.5px; line-height: 1.75; color: var(--slate-600); margin: 16px 0; }
.promise-box { border-radius: 12px; padding: 12px 14px; margin: 12px 0; border: 1px solid var(--slate-200); }
.promise-box.no { background: #fef2f2; border-color: #fecaca; }
.promise-box.yes { background: #f0fdf4; border-color: #bbf7d0; }
.promise-box .pb-title { font-size: 13.5px; font-weight: 700; color: var(--slate-700); margin-bottom: 6px; }
.promise-box ul { margin: 0; padding-left: 18px; }
.promise-box li { font-size: 13px; line-height: 1.8; color: var(--slate-600); }
.reward-box { background: linear-gradient(135deg, #eff6ff, #eef2ff); border: 1px solid #dbeafe; border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 13px; line-height: 1.9; color: var(--slate-700); }
.reward-box b { color: var(--indigo); }
.survey-intro .btn-primary { margin-top: 8px; }
.survey-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(10px); background: #0f172a; color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; }
.survey-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Print / Export PDF (result page) ---- */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  .app, .app-main { display: block !important; min-height: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; max-width: 100% !important; width: 100% !important; background: #fff !important; backdrop-filter: none !important; padding: 0 !important; }
  /* hide interactive-only bits */
  .result-actions, .lead-box, .beian-footer { display: none !important; }
  /* keep sections whole across page breaks */
  .section, .persona-card, .diag, .action-row, .panel, .course, .result-head { break-inside: avoid; page-break-inside: avoid; }
  .section { margin-top: 18px; }
  .radar-wrap svg { max-width: 320px; }
  .result-badge { font-size: 40px; }
  a[href]::after { content: ''; } /* don't append URLs */
  .cta-panel { background: #fff !important; }
}
