/* 设计系统：专业、克制、高对比，浅色为主，支持深色与打印 */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --text: #16202e;
  --text-soft: #4b5768;
  --text-mute: #6b7688;
  --brand: #1d4ed8;
  --brand-dark: #153a9e;
  --brand-soft: #e8f0fe;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fdf1e0;
  --red: #b91c1c;
  --red-soft: #fcebeb;
  --violet: #6d28d9;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* 顶部品牌条 */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.brand:hover { text-decoration: none; }
.topbar .meta { font-size: 13px; color: var(--text-mute); }

/* Hero / 搜索 */
.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -0.5px; }
.hero p { color: var(--text-soft); font-size: 17px; max-width: 640px; margin: 0 auto 28px; }
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}
.search-card input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 12px 14px;
  color: var(--text);
  background: transparent;
}
.btn {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  background: var(--brand);
  color: #fff;
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--surface); color: var(--brand); border: 1px solid var(--border); }
.hint { font-size: 13px; color: var(--text-mute); margin-top: 14px; }
.error-box {
  max-width: 620px; margin: 16px auto 0;
  background: var(--red-soft); color: var(--red);
  border: 1px solid #f3c9c9; border-radius: 10px; padding: 12px 16px;
  font-size: 14px; display: none;
}

/* 信任条 */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 26px 0 0;
}
.pill {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 13px;
  padding: 7px 14px; border-radius: 999px;
}
.pill b { color: var(--text); font-weight: 600; }

/* 报告区 */
.report { display: none; padding: 32px 0 60px; }
.report-head {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
}
.score-ring {
  --p: 0;
  width: 132px; height: 132px; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), #e7ecf3 0);
  display: grid; place-items: center; flex-shrink: 0;
}
.score-ring .inner-ring {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; text-align: center;
}
.score-ring .num { font-size: 30px; font-weight: 800; line-height: 1; }
.score-ring .grade { font-size: 13px; color: var(--text-mute); font-weight: 700; }
.report-head .info { flex: 1; min-width: 240px; }
.report-head h2 { margin: 0 0 4px; font-size: 26px; }
.report-head .url { color: var(--brand); font-size: 14px; word-break: break-all; }
.report-head .loc { color: var(--text-mute); font-size: 14px; margin-top: 6px; }
.source-note {
  margin-top: 14px; font-size: 12.5px; color: var(--text-mute);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px;
}

/* 区块标题 */
.section-title { font-size: 18px; margin: 36px 0 14px; font-weight: 700; }

/* 维度卡片 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dim-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.dim-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.dim-head .name { font-weight: 700; font-size: 15px; }
.dim-head .val { font-weight: 800; font-size: 20px; }
.bar { height: 8px; border-radius: 999px; background: #e9edf4; overflow: hidden; margin-bottom: 14px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.reason { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-top: 1px dashed var(--border); }
.reason .r-label { color: var(--text-soft); font-weight: 600; white-space: nowrap; }
.reason .r-detail { color: var(--text-mute); text-align: right; }
.reason .r-score { font-weight: 700; white-space: nowrap; }

/* 指标 */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; text-align: center;
}
.metric .m-num { font-size: 26px; font-weight: 800; }
.metric .m-label { font-size: 13px; color: var(--text-mute); margin-top: 2px; }

/* findings */
.findings { display: flex; flex-direction: column; gap: 12px; }
.finding {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; display: flex; gap: 14px;
}
.finding .icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 15px; }
.finding.high .icon { background: var(--red-soft); color: var(--red); }
.finding.medium .icon { background: var(--amber-soft); color: var(--amber); }
.finding.low .icon { background: var(--green-soft); color: var(--green); }
.finding .f-body { flex: 1; }
.finding .f-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding .f-detail { font-size: 13.5px; color: var(--text-soft); margin-top: 3px; }
.finding .f-impact { font-size: 13px; color: var(--text-mute); margin-top: 5px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag.measured { background: var(--brand-soft); color: var(--brand); }
.tag.suggestion { background: #f0e9fc; color: var(--violet); }

/* roadmap */
.roadmap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 22px; box-shadow: var(--shadow); }
.step { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.step:first-child { border-top: none; }
.step .when { font-weight: 800; color: var(--brand); min-width: 92px; }
.step .what { color: var(--text-soft); font-size: 14.5px; }

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--brand), var(--violet));
  border-radius: var(--radius); padding: 34px; text-align: center; color: #fff;
  margin-top: 40px;
}
.cta h3 { margin: 0 0 8px; font-size: 22px; }
.cta p { color: rgba(255, 255, 255, 0.88); margin: 0 0 20px; }
.cta .btn { background: #fff; color: var(--brand); }
.cta .btn:hover { background: #f0f4ff; }

/* 未命中提示 + 线索捕获表单 */
.notfound-box {
  max-width: 680px; margin: 0 auto 18px;
  background: var(--brand-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; font-size: 15px; text-align: center;
}
.lead-card {
  max-width: 680px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; text-align: left;
}
.lead-title { margin: 0 0 8px; font-size: 21px; }
.lead-sub { color: var(--text-soft); font-size: 14.5px; margin: 0 0 20px; }
.lead-form { display: flex; flex-direction: column; gap: 12px; }
.lead-form .field { display: flex; }
.lead-form input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; padding: 12px 14px; color: var(--text);
  background: var(--surface-2); outline: none;
}
.lead-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lead-form .btn { width: 100%; }
.lead-note { font-size: 12.5px; color: var(--text-mute); margin-top: 14px; }
.lead-status { margin-top: 12px; font-size: 14px; display: none; }
.lead-status.ok { display: block; color: var(--green); }
.lead-status.err { display: block; color: var(--red); }

/* 分享卡片 */
.share-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 26px; margin-top: 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.share-text { font-weight: 700; font-size: 15px; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.share-actions .btn { padding: 10px 18px; font-size: 14px; }

/* 页脚 */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-mute); font-size: 13px; }
.footer .inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

/* 响应式 */
@media (max-width: 760px) {
  .hero h1 { font-size: 27px; }
  .grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .report-head { flex-direction: column; text-align: center; }
  .search-card { flex-direction: column; }
  .topbar .meta { display: none; }
  .lead-card { padding: 22px; }
  .share-card { flex-direction: column; align-items: flex-start; }
  .share-actions { width: 100%; }
  .share-actions .btn { flex: 1; }
}

/* 深色模式：保持高对比 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1420;
    --surface: #161e2c;
    --surface-2: #1c2636;
    --border: #283449;
    --text: #e8edf6;
    --text-soft: #b6c1d2;
    --text-mute: #8b98ac;
    --brand-soft: #1e2c4d;
    --green-soft: #143024;
    --amber-soft: #382714;
    --red-soft: #3a1c1e;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
  }
  .score-ring .inner-ring { background: var(--surface); }
  .score-ring { background: conic-gradient(var(--brand) calc(var(--p) * 1%), #283449 0); }
  .bar { background: #283449; }
}

@media print {
  .topbar, .hero, .cta, .search-card { display: none !important; }
  .report { display: block !important; padding: 0; }
  body { background: #fff; }
  .dim-card, .finding, .metric, .report-head, .roadmap { box-shadow: none; }
}
