/* ===== 恋爱版 SBTI 测试 · 全局样式 ===== */
:root {
  --bg: #fff5f8;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #fff0f4;
  --text: #2b2330;
  --text-soft: #6b6275;
  --line: #f0d9e2;
  --brand: #ff5e8a;
  --brand-2: #a166ff;
  --brand-grad: linear-gradient(135deg, #ff5e8a 0%, #a166ff 100%);
  --ok: #1fb57a;
  --shadow: 0 10px 30px rgba(255, 94, 138, 0.12);
  --shadow-soft: 0 4px 14px rgba(43, 35, 48, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 720px;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121a;
    --bg-soft: #1d1822;
    --surface: #221c29;
    --surface-2: #2a2232;
    --text: #f3eef6;
    --text-soft: #b3a8bd;
    --line: #3a3045;
    --brand: #ff7aa6;
    --brand-2: #b388ff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #16121a;
  --bg-soft: #1d1822;
  --surface: #221c29;
  --surface-2: #2a2232;
  --text: #f3eef6;
  --text-soft: #b3a8bd;
  --line: #3a3045;
  --brand: #ff7aa6;
  --brand-2: #b388ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .3px;
}
.brand .logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
  box-shadow: var(--shadow-soft);
}
.brand .sub { color: var(--text-soft); font-weight: 600; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s ease, border-color .2s ease;
}
.icon-btn:active { transform: scale(.92); }

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  text-align: center;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-block { width: 100%; }

/* ===== 首页 Hero ===== */
.hero {
  padding: 40px 0 26px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.25;
  margin: 0 0 12px;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  color: var(--text-soft);
  font-size: clamp(14px, 3.6vw, 17px);
  margin: 0 auto 26px;
  max-width: 540px;
}
.badge-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 28px;
}
.pill {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

/* 双版本卡片 */
.version-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
.version-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.version-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.version-card .emoji { font-size: 40px; }
.version-card h3 { margin: 4px 0 2px; font-size: 19px; }
.version-card p { margin: 0 0 14px; color: var(--text-soft); font-size: 13.5px; }
@media (max-width: 480px) {
  .version-grid { grid-template-columns: 1fr; }
}

/* ===== 区块 ===== */
.section { padding: 30px 0; }
.section h2 {
  font-size: 22px;
  margin: 0 0 16px;
  text-align: center;
}
.section .container > p.section-sub {
  text-align: center;
  color: var(--text-soft);
  margin: -8px 0 22px;
  font-size: 14.5px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.feature .ico { font-size: 24px; }
.feature h4 { margin: 8px 0 4px; font-size: 15.5px; }
.feature p { margin: 0; color: var(--text-soft); font-size: 13px; }
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.steps { display: grid; gap: 12px; }
.step {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  align-items: flex-start;
}
.step .num {
  flex: 0 0 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 800;
  display: grid; place-items: center;
}
.step h4 { margin: 4px 0 4px; font-size: 15.5px; }
.step p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

/* FAQ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.faq-item h4 { margin: 0 0 6px; font-size: 15px; }
.faq-item p { margin: 0; color: var(--text-soft); font-size: 14px; }

/* ===== 测试页 ===== */
.quiz-wrap { padding: 18px 0 40px; }
.quiz-head { text-align: center; margin-bottom: 18px; }
.quiz-head .tag {
  font-size: 12.5px; color: var(--brand);
  font-weight: 700; letter-spacing: .5px;
}
.quiz-head h1 { font-size: clamp(22px, 6vw, 30px); margin: 6px 0 2px; }
.quiz-head p { color: var(--text-soft); font-size: 14px; margin: 0; }

.progress {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0 6px;
  border: 1px solid var(--line);
}
.progress > i {
  display: block; height: 100%;
  width: 0%;
  background: var(--brand-grad);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--text-soft);
  margin-bottom: 18px;
}

.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow-soft);
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.q-card .q-index { font-size: 13px; color: var(--brand); font-weight: 700; }
.q-card h3 { font-size: 19px; margin: 6px 0 18px; line-height: 1.45; }
.options { display: grid; gap: 11px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 15px;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.option:hover { border-color: var(--brand); }
.option:active { transform: scale(.99); }
.option.selected {
  border-color: var(--brand);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.option .dot {
  flex: 0 0 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; color: #fff; font-weight: 700;
}
.option.selected .dot { background: var(--brand-grad); border-color: transparent; }
.option .txt { flex: 1; }
.quiz-nav {
  display: flex; gap: 10px; margin-top: 18px;
}
.quiz-nav .btn { flex: 1; }

/* 结果页 */
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fade .4s ease;
}
.result-card .rtype-emoji { font-size: 60px; line-height: 1; }
.result-card .rtype-code {
  display: inline-block;
  margin: 12px 0 4px;
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: #fff; padding: 4px 12px; border-radius: 999px;
  background: var(--brand-grad);
}
.result-card h2 { font-size: 26px; margin: 6px 0 2px; }
.result-card .rtype-slogan { color: var(--text-soft); font-size: 15px; margin: 0 0 16px; }
.score-ring {
  --p: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  margin: 6px auto 14px;
  background:
    radial-gradient(closest-side, var(--surface) 70%, transparent 71%),
    conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  font-weight: 800; font-size: 26px;
}
.result-card .desc { text-align: left; color: var(--text); font-size: 14.5px; margin: 14px 0; }
.result-card .tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.result-card .tags span {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--line);
}

/* 脱单指数 */
.love-index { margin: 16px 0 6px; text-align: left; }
.love-index .li-head { font-size: 14px; color: var(--text-soft); margin-bottom: 6px; }
.love-index .li-head b { color: var(--text); font-size: 18px; }
.love-index .li-bar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.love-index .li-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.love-index .li-note { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; }

/* 三栏信息 */
.info-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0; text-align: left; }
.info-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.info-box h4 { margin: 0 0 5px; font-size: 14.5px; }
.info-box p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.info-box.warn { border-color: color-mix(in srgb, #f5a623 40%, var(--line)); }
.info-box.tip { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }

/* 匹配框 */
.match-box { text-align: left; margin: 12px 0 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.match-box .m-row { font-size: 14px; margin-bottom: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.match-box .m-row span { color: var(--text-soft); }
.match-box .m-row b { color: var(--text); }
.match-box .m-row.ok b { color: var(--ok); }
.match-box .m-row.bad b { color: #e2536b; }
.match-box .m-note { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; line-height: 1.5; }
.match-box .m-row b { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; }
.cp-name { font-weight: 700; }
.cp-compat { font-size: 12px; font-weight: 600; color: var(--ok); background: rgba(31,181,122,.12); padding: 1px 8px; border-radius: 999px; }
.cp-compat.bad { color: #e2536b; background: rgba(226,83,107,.12); }
.friends-tip { margin: 12px 0; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; font-size: 13.5px; color: var(--text-soft); line-height: 1.6; }
.compound-tip { margin: 10px 0 2px; padding: 12px 14px; background: linear-gradient(135deg, rgba(255,94,138,.1), rgba(161,102,255,.1)); border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--text); line-height: 1.6; }
.shared-banner { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--text-soft); margin-bottom: 6px; text-align: center; }

/* 隐藏人格 */
.hidden-tip { text-align: left; margin: 14px 0 0; font-size: 13.5px; color: var(--text); background: var(--surface-2); border: 1px dashed var(--brand); border-radius: 12px; padding: 12px 14px; }

/* 结果生成 loading */
.result-loading { text-align: center; padding: 80px 0; }
.result-loading .spinner {
  width: 48px; height: 48px; margin: 0 auto 16px;
  border: 4px solid var(--surface-2); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.result-loading p { color: var(--text-soft); font-size: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bars { text-align: left; margin: 16px 0 6px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 38px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.bar-row .bar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-row .bar > i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.result-actions { display: grid; gap: 10px; margin-top: 18px; }

/* ===== 底部模块 ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 26px 0 30px;
  margin-top: 30px;
}
.footer-cta {
  display: block;
  text-align: center;
  background: var(--brand-grad);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.footer-cta small { display: block; font-weight: 500; font-size: 12.5px; opacity: .92; margin-top: 4px; }
/* 预留广告位：未来在此注入广告代码 */
#ad-slot {
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  font-size: 12.5px;
  background: var(--surface);
  overflow: hidden;
}
#ad-slot.filled { border-style: solid; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-soft);
}
.footer-links a:hover { color: var(--brand); }
.footer-beian {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.9;
}
.footer-beian a { color: var(--text-soft); border-bottom: 1px dotted var(--line); }
.footer-beian a:hover { color: var(--brand); }
.footer-copy { text-align: center; font-size: 12px; color: var(--text-soft); margin-top: 8px; }

/* 提示 toast */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 桌面端微调 */
@media (min-width: 768px) {
  .container { padding: 0 20px; }
  .q-card { padding: 28px 26px; }
}
