/* 合拍报告 · 网页版。沿用小程序的配色：米色底、暖白卡片、朱红主色、青灰辅色（小程序 rpx ÷ 2 = 这里的 px） */
:root {
  --bg: #F6F1E9; --card: #FFFDF9; --line: #E4DACB; --line2: #EFE7DB; --ink: #221E1A; --body: #5A5047;
  --muted: #5E554B; --accent: #A63A2B; --accent-soft: #F3E6DF; --teal: #2E4B55; --teal-soft: #E3EBEC;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, select { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-bottom: 1px solid var(--line2); padding: 0 8px; max-width: 560px; margin: 0 auto; }
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .back { width: 56px; height: 44px; display: flex; align-items: center; font-size: 30px; padding-left: 8px; color: var(--ink); }
.topbar .me { width: 56px; text-align: right; font-size: 13px; color: var(--teal); padding-right: 8px; }
main { max-width: 560px; margin: 0 auto; }

.serif { font-family: var(--serif); }
.wrap { padding: 12px 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.card.tight { padding: 14px 16px; }
.h1 { font-size: 28px; font-weight: 700; line-height: 1.35; margin: 0; }
.h2 { font-size: 19px; font-weight: 700; margin: 4px 4px 0; }
.h3 { font-size: 16px; font-weight: 700; }
.lead { font-size: 15px; line-height: 1.8; font-weight: 500; }
.p { font-size: 14px; line-height: 1.8; color: var(--body); }
.muted { font-size: 12px; line-height: 1.7; color: var(--muted); }
.kicker { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.center { text-align: center; }
.strong { font-weight: 700; color: var(--ink); }
.tag { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 10px; background: #F1EADF; color: var(--body); }
.tag-teal { font-size: 11px; color: var(--teal); }
.t-teal { color: var(--teal); } .t-accent { color: var(--accent); }
.note { display: flex; gap: 8px; padding: 0 4px; }

.btn { height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
  color: #fff; background: var(--accent); letter-spacing: 1px; width: 100%; }
.btn.teal { background: var(--teal); }
.btn.ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn.disabled, .btn:disabled { opacity: 0.5; }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; }
.bottom-bar > .inner { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; width: 100%; }
.bottom-bar .btn { flex: 1; }
.bottom-bar .btn.small { flex: 0 0 110px; }

.row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--line2); gap: 12px; }
.row:last-child { border-bottom: 0; }
.row-label { font-size: 15px; color: var(--muted); flex-shrink: 0; }
.chev { width: 7px; height: 7px; border-right: 1.5px solid #8C7F70; border-top: 1.5px solid #8C7F70; transform: rotate(45deg); flex-shrink: 0; }
.lock { width: 11px; height: 8px; border: 1px solid var(--muted); border-radius: 2px; position: relative; margin-top: 4px; flex-shrink: 0; }
.lock::before { content: ''; position: absolute; left: 1.5px; top: -6px; width: 6px; height: 6px; border: 1px solid var(--muted); border-bottom: 0; border-radius: 4px 4px 0 0; }
.locked-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--body); padding: 4px 0; }

@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.beat-slow { animation: breathe 2s ease-in-out infinite; }
@keyframes wiggle { 0%, 60%, 100% { transform: translateX(0); } 10%, 30%, 50% { transform: translateX(-4px); } 20%, 40% { transform: translateX(4px); } }
.wiggle { animation: wiggle 2.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .beat-slow, .wiggle { animation: none; } }

/* 五行颜色 */
.el-wood { background: #4E7A3A; } .el-fire { background: #B8432F; } .el-earth { background: #9A6B3C; } .el-metal { background: #B8912E; } .el-water { background: #2E5A7A; }
.c-wood { color: #4E7A3A; } .c-fire { color: #B8432F; } .c-earth { color: #9A6B3C; } .c-metal { color: #B8912E; } .c-water { color: #2E5A7A; }

/* 首页 */
.hero { padding: 12px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.entry { border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 11px; color: #fff; text-align: left; width: 100%; }
.entry.main { background: var(--accent); }
.entry.second { background: var(--teal); }
.entry-top { display: flex; justify-content: space-between; align-items: center; }
.entry-kicker { font-size: 13px; letter-spacing: 2px; opacity: 0.9; }
.entry-badge { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,0.18); }
.entry-title { font-size: 24px; font-weight: 700; line-height: 1.35; }
.entry-title.small { font-size: 21px; line-height: 1.4; }
.entry-desc { font-size: 14px; line-height: 1.7; opacity: 0.92; }
.entry-note { font-size: 12px; line-height: 1.7; opacity: 0.8; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags span { font-size: 12px; padding: 4px 10px; border-radius: 12px; background: rgba(255,255,255,0.16); }
.entry-btn { height: 48px; border-radius: 24px; background: var(--card); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; margin-top: 4px; }
.entry.second .entry-btn { color: var(--teal); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding-right: 4px; }
.profile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.badge { width: 38px; height: 38px; border-radius: 19px; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.grow { flex: 1; min-width: 0; }
.link { color: var(--accent); font-size: 14px; padding: 10px 0 10px 10px; }
.recent { gap: 12px; min-height: 64px; width: 100%; text-align: left; }
.rtag { font-size: 12px; padding: 3px 8px; border-radius: 8px; flex-shrink: 0; background: var(--accent-soft); color: #7E2A1F; }
.rtag.ideal { background: var(--teal-soft); color: var(--teal); }
.del { font-size: 13px; color: var(--accent); padding: 8px 4px 8px 12px; flex-shrink: 0; }
.codebar { display: flex; align-items: center; gap: 12px; }

/* 小题 */
.qz-top { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 0; }
.qz-no { color: var(--accent); }
.qz-n { font-size: 26px; font-weight: 700; }
.qz-of { font-size: 14px; color: var(--muted); }
.bar { height: 5px; border-radius: 3px; background: #EFE7DB; overflow: hidden; }
.bar-in { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.qz-card { padding: 22px 18px 14px; display: flex; flex-direction: column; gap: 16px; }
.qz-q { font-size: 20px; font-weight: 700; line-height: 1.45; }
.qz-opts { display: flex; flex-direction: column; gap: 10px; }
.qz-opt { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: left; width: 100%; }
.qz-opt.on { border-color: var(--accent); background: #FBF1EC; }
.qz-radio { width: 18px; height: 18px; border-radius: 9px; border: 1.5px solid #C9B9A6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qz-opt.on .qz-radio { border-color: var(--accent); }
.qz-opt.on .qz-radio::after { content: ''; width: 9px; height: 9px; border-radius: 5px; background: var(--accent); }
.qz-letter { font-size: 15px; color: var(--muted); flex-shrink: 0; }
.qz-text { font-size: 15px; line-height: 1.5; }
.qz-info-head { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }

/* 出生信息表单 */
.pf { padding-bottom: 6px; }
.pf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pf-who { display: flex; align-items: center; gap: 10px; }
.pf-badge { width: 30px; height: 30px; border-radius: 15px; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.seg { display: flex; background: #F1EADF; border-radius: 10px; padding: 3px; flex-shrink: 0; }
.seg button { min-width: 48px; height: 32px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; }
.field { border: 1px solid var(--line); background: var(--card); border-radius: 10px; height: 38px; padding: 0 10px; font-size: 15px; min-width: 0; }
.field.ph { color: var(--muted); }
input.field[type=date], input.field[type=time] { min-width: 150px; text-align: right; -webkit-appearance: none; appearance: none; }
.selects { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.selects select { max-width: 132px; }
.place { flex-direction: column; align-items: stretch; padding: 10px 0; gap: 8px; }
.place .selects { justify-content: flex-start; }
.place .selects select { flex: 1 1 30%; max-width: none; }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: #E4DACB; transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.periods { padding: 10px 0 14px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.chip.on { border: 2px solid var(--accent); background: #FBF1EC; }
.chip b { font-size: 14px; font-weight: 500; }
.chip.on b { font-weight: 700; }
.chip small { font-size: 11px; color: var(--muted); }

/* 等待 */
.ld { padding: 60px 28px; display: flex; flex-direction: column; gap: 16px; }
.ring { align-self: center; width: 116px; height: 116px; border-radius: 58px; border: 8px solid var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--accent); }
.steps { display: flex; flex-direction: column; gap: 11px; margin-top: 8px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #B7AB9B; }
.step::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.step.done { color: var(--muted); } .step.now { color: var(--ink); font-weight: 500; }

/* 配对结果 */
.res-hero { display: flex; flex-direction: column; gap: 14px; }
.hero-top { display: flex; gap: 16px; align-items: center; }
.score { width: 110px; height: 110px; border-radius: 55px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.score-in { width: 94px; height: 94px; border-radius: 47px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.score-num.range { font-size: 22px; }
.hero-label { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.label { font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1.25; }
.variants { display: flex; flex-direction: column; gap: 6px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo-item { border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.duo-item.best { background: var(--accent-soft); } .duo-item.worst { background: var(--teal-soft); }
.duo-item .p { font-size: 12px; line-height: 1.65; }
.duo-k { font-size: 12px; font-weight: 700; }
.best .duo-k { color: #7E2A1F; } .worst .duo-k { color: var(--teal); }
.block { display: flex; flex-direction: column; gap: 10px; }
.point { display: flex; flex-direction: column; gap: 4px; }
.person { display: flex; flex-direction: column; gap: 10px; }
.person .p, .point .p { color: #6B6157; }
.person-head { display: flex; align-items: center; gap: 12px; }
.stem { width: 44px; height: 44px; border-radius: 22px; color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ask { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt { padding: 9px 14px; border-radius: 20px; border: 1px solid var(--accent); color: var(--accent); font-size: 14px; }
.cross { background: #FFF8F4; border: 2px solid var(--accent); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 7px; text-align: left; width: 100%; box-shadow: 0 6px 16px rgba(166, 58, 43, 0.12); }
.cross .kicker { color: var(--accent); font-weight: 700; }
.cross-cta { align-self: flex-start; margin-top: 5px; padding: 9px 18px; border-radius: 22px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; }

/* 理想伴侣结果 */
.fit { display: flex; flex-direction: column; gap: 12px; }
.fit-line { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; line-height: 1.6; font-weight: 700; }
.fit-line::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); margin-top: 10px; flex-shrink: 0; }
.fit-line.no { font-size: 14px; font-weight: 400; color: #8C7F70; }
.fit-line.no::before { background: #CFC4B4; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { background: var(--teal-soft); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.fact-k { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.fact-v { font-size: 18px; font-weight: 700; }
.fact-s { font-size: 11px; color: var(--body); }
.refs { display: flex; flex-direction: column; gap: 10px; }
.refs .tag { align-self: flex-start; font-weight: 700; }
.ref { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.ref-l { width: 34px; height: 34px; border-radius: 17px; background: #F1EADF; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ref-s { display: flex; flex-direction: column; align-items: flex-end; }
.ref-n { font-size: 18px; font-weight: 700; }

/* 完整报告 */
.report { line-height: 1.85; user-select: text; -webkit-user-select: text; }
.report table { width: 100%; border-collapse: collapse; }

/* 解锁弹窗 */
.mask { position: fixed; inset: 0; background: rgba(34, 30, 26, 0.45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 24px 24px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow-y: auto; }
.grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: #D9CFC0; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-title { font-size: 22px; font-weight: 700; }
.close { width: 44px; height: 44px; margin: -8px -10px 0 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; }
.benefit { display: flex; gap: 8px; align-items: flex-start; }
.benefit::before { content: '✓'; font-weight: 700; font-size: 14px; line-height: 1.8; color: var(--accent); }
.code-input { height: 52px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; font-size: 20px; letter-spacing: 2px; text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; background: #fff; width: 100%; }
.code-input:focus { outline: none; border-color: var(--accent); }
.err { color: var(--accent); font-size: 13px; min-height: 18px; }
.shop { background: #F7F1E8; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.shop-links { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-links a { padding: 7px 14px; border-radius: 16px; border: 1px solid var(--teal); color: var(--teal); font-size: 13px; }
.credit-use { border: 1.5px solid var(--teal); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 200; background: rgba(34, 30, 26, 0.88); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 80vw; text-align: center; line-height: 1.6; }

/* 分享卡片 */
.share-preview { display: flex; justify-content: center; }
.share-preview img { width: 300px; max-width: 100%; border-radius: 12px; box-shadow: 0 6px 20px rgba(34, 30, 26, 0.16); -webkit-touch-callout: default; }
#cardph { height: 400px; width: 300px; background: var(--card); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.share-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.share-chip { font-size: 12px; padding: 5px 10px; border-radius: 16px; background: #F1EADF; color: var(--body); border: 1px solid transparent; }
.share-chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 700; }

/* 备案号 */
.beian { text-align: center; font-size: 11px; line-height: 1.9; color: #8C7F70; padding-top: 4px; }
.beian a { color: #8C7F70; }
