/* 客户经理端（问卷）和报告页共用样式。报告要截图转发，固定浅色。 */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: #eaf2fc;
  --accent-track: #d3e4f9;
  --page: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f1728;
  --ink-2: #4a5568;
  --ink-3: #8a94a6;
  --line: #e4e8f0;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 40, 0.04), 0 4px 16px rgba(15, 23, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

/* 品牌色可以在 config.json 里换，深浅色阶自动跟着算 */
@supports (color: color-mix(in srgb, red 50%, white)) {
  :root {
    --accent-strong: color-mix(in srgb, var(--accent) 72%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
    --accent-track: color-mix(in srgb, var(--accent) 20%, #fff);
  }
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.3; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- 布局 ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  flex: none; width: 28px; height: 28px; border-radius: 8px; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.92); }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-org { font-size: 12px; color: var(--ink-3); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 12px; }
.card-title { font-size: 17px; margin: 0 0 6px; }
.intro-title { font-size: 22px; margin: 0 0 6px; }
.intro-text { color: var(--ink-2); margin: 0 0 12px; }
.intro-steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.9; }

.field { margin: 10px 0; }
.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-size: 16px; background: var(--surface); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 18px;
  border: none; border-radius: 12px; font-size: 16px; font-weight: 600; text-decoration: none;
}
.btn-block { display: flex; width: 100%; margin: 12px 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.link-btn { background: none; border: none; color: var(--accent-strong); font-size: 15px; padding: 8px 0; }
.btn:focus-visible, .chip:focus-visible, .link-btn:focus-visible, .btn-interest:focus-visible, .btn-call:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.sales-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sales-name { font-weight: 600; font-size: 16px; }

.history { list-style: none; margin: 8px 0 0; padding: 0; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.history li:first-child .history-item { border-top: none; }
.history-main { display: flex; flex-direction: column; min-width: 0; }
.history-company { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-score { flex: none; font-weight: 700; font-size: 18px; color: var(--accent-strong); }
.foot-link { text-align: center; font-size: 13px; margin: 24px 0; }
.foot-link a { color: var(--ink-3); }

/* ---------- 问卷 ---------- */
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; }
.step-title { font-size: 22px; margin: 16px 2px 12px; }
.q { padding: 2px 0 18px; }
.q + .q { border-top: 1px solid var(--line); padding-top: 18px; }
.q:last-child { padding-bottom: 2px; }
.q-label { font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.q-label:has(+ .q-hint) { margin-bottom: 2px; }
.q-hint { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.req { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px;
  min-height: 40px; font-size: 15px; line-height: 1.3; transition: background 0.15s, border-color 0.15s;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.q.invalid .q-label { color: var(--danger); }
.q.invalid .chip, .q.invalid .input { border-color: #e3a5a0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
@supports (backdrop-filter: blur(8px)) {
  .bottombar { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px); }
}
.bottombar-inner { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }
.bottombar .btn-primary { flex: 1; }
.bottombar .btn-ghost { flex: 0 0 34%; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px;
  background: rgba(15, 23, 40, 0.88); color: #fff; font-size: 14px; text-align: center;
}
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(243, 245, 249, 0.88); }
.overlay-box { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ink-2); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--accent-track); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 报告 ---------- */
.report-hero { background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%); color: #fff; padding: 22px 16px 78px; }
.report-hero-inner { max-width: 536px; margin: 0 auto; }
.eyebrow { font-size: 12px; opacity: 0.85; letter-spacing: 0.02em; }
.report-company { font-size: 24px; margin: 6px 0 4px; overflow-wrap: anywhere; }
.report-meta { font-size: 13px; opacity: 0.9; }
.demo-flag { display: inline-block; margin-top: 8px; font-size: 12px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 6px; padding: 1px 6px; }
.report-body { max-width: 560px; margin: -60px auto 0; padding: 0 12px 40px; }
.report-body.plain { margin-top: 40px; }

.score-card { text-align: center; padding-top: 22px; }
.gauge-wrap { position: relative; width: 220px; margin: 0 auto; }
.gauge { display: block; width: 220px; height: 120px; }
.gauge-track, .gauge-fill { fill: none; stroke-width: 14; stroke-linecap: round; }
.gauge-track { stroke: var(--accent-track); }
.gauge-fill { stroke: var(--accent); transition: stroke-dasharray 1s ease-out; }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 0; }
.hero-num { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.gauge-label { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.grade { margin-top: 12px; }
.grade-pill { display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat { padding: 0 4px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.stat-unit { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.callout { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; text-align: left; }

.section-title { font-size: 17px; margin: 24px 4px 10px; }
.diag-headline { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.diag-summary { margin: 0; color: var(--ink-2); line-height: 1.8; }
.ai-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.thinking { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin-bottom: 6px; }
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.3; transform: scale(0.8); } to { opacity: 1; transform: scale(1.1); } }
.skeleton {
  height: 12px; border-radius: 6px; margin: 10px 0;
  background: linear-gradient(90deg, #eceff5 25%, #f6f8fb 50%, #eceff5 75%); background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.w90 { width: 90%; }
.w75 { width: 75%; }
.w60 { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fade-in { animation: fadein 0.5s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.product-top { display: flex; align-items: center; gap: 8px; }
.rank { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; background: var(--accent-soft); color: var(--accent-strong); }
.rank-1 { background: var(--accent); color: #fff; }
.status { font-size: 12px; color: var(--ink-2); background: var(--page); border-radius: 6px; padding: 2px 8px; }
.product-name { font-size: 19px; margin: 10px 0 2px; }
.product-oneliner { margin: 0; color: var(--ink-2); font-size: 14px; }
.match { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.match-label { flex: none; font-size: 13px; color: var(--ink-3); }
.meter { flex: 1; height: 8px; border-radius: 4px; background: var(--accent-track); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.match-value { flex: none; min-width: 2em; text-align: right; font-weight: 700; }
.scene { background: var(--page); border-radius: 10px; padding: 12px 14px; }
.scene-title { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.scene-text { margin: 0; line-height: 1.75; }
.scene-step { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.scene-step b { color: var(--ink); }
.product-meta { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.product-meta b { color: var(--ink); font-weight: 600; }
.features { margin-top: 10px; font-size: 14px; }
.features summary { color: var(--accent-strong); cursor: pointer; padding: 4px 0; }
.features ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); line-height: 1.8; }
.btn-interest {
  width: 100%; margin-top: 14px; min-height: 46px; border-radius: 12px; padding: 8px 12px;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent-strong); font-size: 15px; font-weight: 600;
}
.btn-interest.done { background: var(--accent-soft); border-color: transparent; color: var(--ink); cursor: default; }
.extra-text { margin: 0; line-height: 1.75; }

.details-card summary { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; cursor: pointer; list-style: none; }
.details-card summary::-webkit-details-marker { display: none; }
.details-card summary::after { content: "展开"; font-weight: 400; font-size: 13px; color: var(--ink-3); }
.details-card[open] summary::after { content: "收起"; }
.kv { display: grid; grid-template-columns: 7em 1fr; gap: 8px 12px; margin: 14px 0 0; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.assumptions { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }

.contact { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-name { font-size: 17px; font-weight: 700; }
.btn-call { flex: none; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.share { margin-top: 8px; }
.report-footer { text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.9; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .no-print, .btn-interest, .features { display: none !important; }
  .card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
  .report-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  details > *:not(summary) { display: block; }
}
