/* ==========================================================================
   趣味情感匹配测试 · 样式表
   移动端优先，深色文字 + 粉紫渐变，适配微信 / 小红书 / 快手内置浏览器
   ========================================================================== */

:root {
  --bg: #fff6f9;
  --ink: #241a2e;
  --ink-2: #6b5b7a;
  --ink-3: #9a8aa8;
  --card: #ffffff;
  --line: rgba(90, 60, 120, .10);
  --brand: #ff4d8d;
  --brand-2: #a855f7;
  --brand-dark: #d81b60;   /* 用在白底上：白底粉字的对比度要够（#ff4d8d 只有 3.1:1，#d81b60 有 4.9:1） */
  --gold: #ff9f43;
  --shadow: 0 10px 30px rgba(120, 60, 140, .10);
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

/* 背景光斑 */
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orbs span {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.orbs span:nth-child(1) { width: 300px; height: 300px; background: #ffc2d6; top: -90px; left: -70px; }
.orbs span:nth-child(2) { width: 260px; height: 260px; background: #d9c6ff; top: 180px; right: -90px; opacity: .45; }
.orbs span:nth-child(3) { width: 320px; height: 320px; background: #ffe3c2; bottom: -120px; left: -60px; opacity: .40; }

#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ------------------------------------------------------------------ 屏幕切换 */
.screen { display: none; }
.screen.is-active { display: block; animation: rise .38s cubic-bezier(.22, .8, .3, 1) both; }
.screen.center { display: none; }
.screen.center.is-active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 72vh; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ 首页 */
.pill {
  display: inline-block; padding: 5px 13px; border-radius: 100px;
  font-size: 12px; letter-spacing: .4px; font-weight: 600;
  color: #b3326d; background: rgba(255, 77, 141, .12);
  border: 1px solid rgba(255, 77, 141, .18);
}
.pill.light { background: rgba(255, 255, 255, .26); color: #fff; border-color: rgba(255, 255, 255, .4); }

/* 首页的「已解锁」徽章：从首页输入兑换码后，让用户看得见状态 */
.unlock-badge {
  display: inline-block; margin-left: 8px; padding: 5px 13px; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  color: #0d7a52; background: rgba(18, 160, 106, .12);
  border: 1px solid rgba(18, 160, 106, .25);
}

.hero-title {
  font-size: 40px; line-height: 1.18; margin: 18px 0 12px;
  letter-spacing: -.5px; font-weight: 800;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; line-height: 1.75; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: #fff; border-radius: 18px; padding: 16px 8px;
  box-shadow: var(--shadow); margin-bottom: 22px;
}
.facts > div { text-align: center; }
.facts b { display: block; font-size: 24px; line-height: 1.1; color: var(--brand); font-weight: 800; }
.facts span { font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: block; width: 100%; border: 0; cursor: pointer;
  font-size: 17px; font-weight: 700; font-family: inherit;
  padding: 16px; border-radius: 16px; margin-bottom: 12px;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active { transform: scale(.975); }
.btn.primary {
  color: #fff;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(200, 60, 160, .30);
}
.btn.ghost {
  /* 次按钮：白底 + 品牌色描边和文字。
     以前用的是 rgba(90,60,120,.10) 的边框，淡到几乎看不见，
     结果白方块看着像"面板"甚至像"不可点"——主次层级要在，但不能弱到失去按钮感。 */
  background: #fff; color: var(--brand-dark);
  border: 1.5px solid rgba(216, 27, 96, .45);
  box-shadow: 0 4px 14px rgba(120, 60, 140, .06);
}
.btn.ghost:active { background: #fff5f9; }
.btn.text {
  background: none; color: var(--ink-3); font-weight: 500; font-size: 14px;
  padding: 10px; width: auto; margin: 18px auto 0;
}
.btn[disabled] { opacity: .45; pointer-events: none; }
/* 按钮里的小字说明（两档价格差异一句话讲清） */
.btn .btn-sub {
  display: block; margin-top: 3px;
  font-size: 12px; font-weight: 500; opacity: .85;
}

/* 人格预览条 */
.type-strip { display: flex; gap: 8px; margin: 22px 0 0; flex-wrap: wrap; }
.type-chip {
  flex: 1 1 calc(50% - 8px); background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; box-shadow: 0 3px 12px rgba(120, 60, 140, .05);
}
.type-chip b { font-size: 18px; }

/* ------------------------------------------------------------------ 答题 */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.icon-btn {
  border: 0; background: #fff; color: var(--ink-3); width: 34px; height: 34px;
  border-radius: 50%; font-size: 15px; cursor: pointer; box-shadow: 0 3px 10px rgba(120, 60, 140, .08);
  flex: 0 0 auto;
}
.progress { flex: 1; height: 7px; background: rgba(120, 60, 140, .12); border-radius: 100px; overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0; border-radius: 100px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .35s cubic-bezier(.3, .8, .3, 1);
}
.step { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.quiz-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.q-title { font-size: 24px; line-height: 1.42; margin: 8px 0 24px; font-weight: 800; letter-spacing: -.3px; }

.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid transparent; border-radius: 16px;
  padding: 17px 16px; font-size: 15.5px; color: var(--ink); font-family: inherit;
  cursor: pointer; box-shadow: 0 5px 16px rgba(120, 60, 140, .07);
  transition: transform .12s ease, border-color .18s, background .18s;
  line-height: 1.45;
}
.opt:active { transform: scale(.985); }
.opt .key {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: rgba(255, 77, 141, .10); color: var(--brand);
}
.opt.picked { border-color: var(--brand); background: #fff7fa; }
.opt.picked .key { background: linear-gradient(100deg, var(--brand), var(--brand-2)); color: #fff; }

/* ------------------------------------------------------------------ 计算中 */
.loader {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255, 77, 141, .18); border-top-color: var(--brand);
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--ink-2); font-size: 14px; margin-top: 18px; }

/* ------------------------------------------------------------------ 结果页 */
.result-hero {
  border-radius: 24px; padding: 26px 22px 24px; color: #fff;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 34px rgba(180, 60, 160, .28);
  margin-bottom: 18px; position: relative; overflow: hidden;
}
.result-hero::after {
  content: ''; position: absolute; width: 190px; height: 190px; right: -70px; top: -80px;
  background: rgba(255, 255, 255, .16); border-radius: 50%;
}
.hero-emoji { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.result-hero h2 { margin: 10px 0 6px; font-size: 27px; font-weight: 800; letter-spacing: -.3px; }
.result-hero p { margin: 0; font-size: 14.5px; opacity: .94; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag {
  font-size: 12px; padding: 4px 11px; border-radius: 100px;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .3);
}

.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ''; width: 4px; height: 15px; border-radius: 4px;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.card-note { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }
.card p { margin: 0 0 10px; font-size: 15px; line-height: 1.82; color: #3b2d47; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 0; list-style: none; }
.card li {
  font-size: 14.5px; line-height: 1.78; color: #3b2d47;
  padding-left: 22px; position: relative; margin-bottom: 11px;
}
.card li::before {
  content: ''; position: absolute; left: 6px; top: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}
.card li:last-child { margin-bottom: 0; }
.lead-label { display: block; font-size: 13px; color: var(--brand); font-weight: 700; margin-bottom: 6px; }

/* 完整内容清单：明确列出每档包含哪几项 */
.tier-line {
  margin: 16px 0 8px; font-size: 13.5px; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.tier-line:first-of-type { margin-top: 0; }
.tier-line::before {
  content: ''; width: 4px; height: 14px; border-radius: 4px; flex: 0 0 auto;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.tier-list { list-style: none; margin: 0; padding: 0; }
.card .tier-list li {
  font-size: 14px; line-height: 1.95; padding-left: 0; margin-bottom: 0;
  color: #3b2d47; display: flex; gap: 8px;
}
.card .tier-list li::before { display: none; }
.tier-list li.ok { color: #0d7a52; font-weight: 600; }
.tier-list li.no { color: var(--ink-2); }

/* 分布条 */
.dist { display: flex; flex-direction: column; gap: 11px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dist-row .nm { flex: 0 0 auto; width: 104px; color: var(--ink-2); }
.dist-row .bar { flex: 1; height: 9px; border-radius: 100px; background: rgba(120, 60, 140, .09); overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; border-radius: 100px; width: 0; transition: width .7s cubic-bezier(.2, .8, .3, 1); }
.dist-row .pc { flex: 0 0 auto; width: 78px; text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.dist-row.is-top .nm { color: var(--ink); font-weight: 800; }

/* 适配指数 */
.match-grid { display: flex; flex-direction: column; gap: 10px; }
.match-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.match-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; }
.match-head em { font-style: normal; color: var(--brand); font-size: 15px; font-weight: 800; }
.match-item p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* 锁：骨架铺在底层（绝对定位），遮罩是正常流（由它撑开高度，永远不会压到标题） */
.lock-wrap { position: relative; }
.lock-body {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; user-select: none;
}
/* 锁定内容的占位骨架（真实文案不进入 DOM，避免被 F12 读走） */
.skel { padding: 6px 0 2px; }
.skel i {
  display: block; height: 11px; border-radius: 6px; margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(120,60,140,.13), rgba(120,60,140,.06), rgba(120,60,140,.13));
}
.skel i:last-child { margin-bottom: 0; }
/* 锁定卡片的「未解锁」标签：让用户一眼看出这项还没买 */
.lock-tag {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  padding: 2px 8px; border-radius: 100px;
}
.lock-veil {
  position: relative; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .95) 40%);
  text-align: center; padding: 20px 0;
}
.lock-veil > b, .lock-veil > span { padding: 0 20px; }
.lock-veil b { font-size: 15px; }
.lock-veil span { font-size: 12.5px; color: var(--ink-3); }
/* 和底部「解锁完整报告 / 解锁基础版」按钮保持一致：
   遮罩左右不留内边距，所以用负外边距让它撑满整张卡片宽度 ——
   卡片的宽度就等于页面内容宽度，于是三个按钮的宽度、字号、左右位置完全一样。
   高度用上下 26px 内边距补上（底部两个按钮是两行文字，自然更高）——
   不靠加无意义的副文案来凑高度。 */
.lock-veil .btn {
  width: calc(100% + 40px);
  margin: 10px -20px 0;
  padding: 26px 16px;
  font-size: 17px;
}

.result-actions { margin-top: 18px; }

.disclaimer {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.8;
  background: rgba(120, 60, 140, .05); border-radius: 14px;
  padding: 14px; margin: 18px 0 0; text-align: left;
}
/* ICP 备案号（工信部要求展示在页面底部） */
.icp {
  font-size: 11.5px; color: var(--ink-3); text-align: center;
  margin: 14px 0 0; letter-spacing: .2px;
}
.icp a { color: var(--ink-3); text-decoration: none; }

/* ------------------------------------------------------------------ 弹层 */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(30, 15, 40, .48); backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
.sheet-mask.is-open { display: flex; animation: fade .22s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%; max-width: 560px; background: #fff;
  border-radius: 26px 26px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  position: relative; animation: slideUp .32s cubic-bezier(.22, .8, .3, 1) both;
  max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.sheet-sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-3); }
.sheet-close {
  position: absolute; right: 16px; top: 16px; border: 0; background: rgba(120, 60, 140, .07);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px; color: var(--ink-3); cursor: pointer;
}

.code-input {
  width: 100%; font-family: inherit; font-size: 18px; font-weight: 700;
  letter-spacing: 2px; text-align: center; text-transform: uppercase;
  padding: 15px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #faf7fd; color: var(--ink); margin-bottom: 12px; outline: none;
}
/* 弹层顶部常驻的「本机当前状态」——用户不该靠猜自己解锁到哪一档 */
.lock-status {
  font-size: 12.5px; line-height: 1.7; color: #0d7a52;
  background: rgba(18, 160, 106, .10); border: 1px solid rgba(18, 160, 106, .25);
  border-radius: 12px; padding: 10px 13px; margin: 0 0 14px;
}
.lock-status .lock-status-code {
  display: block; margin-top: 3px; color: var(--ink-3); font-size: 11.5px;
  letter-spacing: .3px;
}
.code-input:focus { border-color: var(--brand); background: #fff; }
.msg { font-size: 13px; text-align: center; margin: 4px 0 0; min-height: 20px; }
.msg.ok { color: #12a06a; }
.msg.err { color: #e0326a; }
.msg .msg-sub { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

.buy-box { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 18px; }
.buy-title { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--ink); }
.buy-hint {
  font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
  background: rgba(255, 77, 141, .06); border: 1px solid rgba(255, 77, 141, .14);
  border-radius: 12px; padding: 11px 13px; margin: 0 0 14px;
}
.price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; font-family: inherit; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 13px 15px; margin-bottom: 10px;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
}
.price-row:active { transform: scale(.99); }
.price-row .pr-left { display: block; min-width: 0; }
.price-row .pr-right { display: block; flex: 0 0 auto; text-align: center; }
.price-row .pr-go {
  display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--brand);
}
.price-row b { font-size: 15px; display: block; }
.price-row b i {
  font-style: normal; font-size: 10.5px; vertical-align: middle; margin-left: 4px;
  background: var(--brand); color: #fff; padding: 1px 6px; border-radius: 100px;
}
.price-row .pr-sub { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; line-height: 1.5; }
.price-row em { font-style: normal; font-weight: 800; color: var(--brand); font-size: 20px; flex: 0 0 auto; }
.price-row em::before { content: '¥'; font-size: 12px; margin-right: 1px; }
.buy-box .btn.ghost { margin: 10px 0 0; padding: 13px; font-size: 15px; }
.buy-note { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.7; }
/* 低调的文字按钮：重置本机解锁状态 */
.link-btn {
  display: block; width: 100%; margin: 12px 0 0; padding: 8px;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: 11.5px; color: var(--ink-3); text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:active { color: var(--brand); }

/* 海报 */
.poster-wrap {
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 16px; background: #f4f0f8;
}
#poster-canvas { display: block; width: 100%; height: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin-bottom: 0; font-size: 15px; padding: 14px; }
.row2.single { grid-template-columns: 1fr; }

/* 手机上「下载」按钮不可靠（iOS Safari 会把图片甩进「文件」App，
   买家根本找不到），所以 iPhone/iPad 上改成引导长按保存到相册。 */
.lt-poster-img {
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
.ios-tip {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fff3f7;
  border: 1px solid #ffd9e6;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #7a5563;
}
.ios-tip b { color: var(--brand); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 12%; transform: translate(-50%, 16px);
  background: rgba(36, 26, 46, .93); color: #fff; font-size: 14px;
  padding: 11px 20px; border-radius: 100px; z-index: 90;
  opacity: 0; pointer-events: none; transition: all .26s ease; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 桌面端微调 */
@media (min-width: 600px) {
  .hero-title { font-size: 46px; }
  #app { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
