/* 移动端优先；兼容微信内置浏览器（iOS WKWebView / 安卓 XWeb） */
:root {
  --primary: #E86A92;
  --primary-rgb: 232, 106, 146;
  --bg: #FFF0F5;
  --text: #3a2a33;
  --muted: #8a7a82;
  --ok: #23a26d;
  --ok-rgb: 35, 162, 109;
  --bad: #e5484d;
  --bad-rgb: 229, 72, 77;
  --card2: #F7A3BC;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 100% 0, rgba(var(--primary-rgb), 0.14), transparent 45%),
    radial-gradient(circle at 0 70%, rgba(var(--primary-rgb), 0.08), transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.main { flex: 1; }

/* ---------- 顶栏 / 页脚 ---------- */
.topbar { height: 48px; display: flex; align-items: center; }
.topbar a { color: var(--muted); font-size: 14px; text-decoration: none; padding: 8px 0; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 0 4px; line-height: 1.7; }
.foot p { margin: 0 0 4px; }
.foot a { color: var(--muted); text-decoration: none; }

/* ---------- 通用组件 ---------- */
.btn {
  display: block;
  width: 100%;
  height: 52px;
  margin: 12px 0;
  border: 0;
  border-radius: 26px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 52px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn[disabled] { opacity: 0.6; }
.btn.ghost {
  background: #fff;
  color: var(--primary);
  box-shadow: none;
  border: 1.5px solid rgba(var(--primary-rgb), 0.35);
  line-height: 49px;
}
.btn.small { height: 40px; line-height: 40px; font-size: 15px; border-radius: 20px; }
.btn.ghost.small { line-height: 37px; }

.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 4px 18px rgba(var(--primary-rgb), 0.08);
}
.card h2, .card h3 { margin: 0 0 10px; color: var(--primary); }
.card h2 { font-size: 18px; }
.card h3 { font-size: 16px; }
.card p { margin: 0; line-height: 1.8; }
.card p + p { margin-top: 8px; }

.input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 17px; /* ≥16px，避免 iOS 聚焦时自动放大 */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--primary); }
.label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 8px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.tip { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0; }

.fade { animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 加载 ---------- */
.loading { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.loading-heart {
  width: 28px; height: 28px; background: var(--primary); transform: rotate(45deg);
  animation: beat 0.9s ease-in-out infinite; position: relative;
}
.loading-heart::before, .loading-heart::after {
  content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
}
.loading-heart::before { left: -14px; }
.loading-heart::after { top: -14px; }
@keyframes beat { 0%, 100% { transform: rotate(45deg) scale(0.85); } 50% { transform: rotate(45deg) scale(1.05); } }

/* ---------- 首页 ---------- */
.brand { text-align: center; padding: 48px 0 12px; }
.brand-logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.35);
}
.brand-logo svg { width: 34px; height: 34px; fill: #fff; }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.brand p { margin: 6px 0 0; color: var(--muted); }

.code-input {
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 21px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.code-input::placeholder { font-size: 16px; letter-spacing: 0; font-family: inherit; color: #c4b4bc; }
.code-err { color: var(--bad); font-size: 14px; min-height: 22px; margin: 8px 0 0; text-align: center; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; text-decoration: none; color: var(--text);
  border-top: 1px solid rgba(var(--primary-rgb), 0.1);
}
.list-item:first-of-type { border-top: 0; }
.list-item b { display: block; font-size: 16px; }
.list-item span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.list-item i {
  flex: none; font-style: normal; color: var(--primary); font-size: 14px; margin-left: 12px;
  padding: 4px 12px; border-radius: 14px; background: rgba(var(--primary-rgb), 0.1);
}

/* ---------- 产品介绍 ---------- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero-badge {
  display: inline-block; padding: 4px 14px; border-radius: 14px; font-size: 13px;
  color: var(--primary); background: rgba(var(--primary-rgb), 0.12);
}
.hero h1 { font-size: 30px; margin: 14px 0 10px; line-height: 1.3; }
.hero-sub { color: var(--text); opacity: 0.8; margin: 0 auto; max-width: 320px; line-height: 1.8; }
.hl { color: var(--primary); }
.meta { display: flex; justify-content: center; margin: 16px 0 8px; }
.meta span {
  margin: 0 6px; font-size: 13px; color: var(--muted); background: #fff;
  border-radius: 12px; padding: 3px 12px;
}

/* ---------- 答题 ---------- */
.q-head { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.q-back { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; padding: 8px 0; cursor: pointer; }
.q-back[hidden] { display: block; visibility: hidden; }
.q-count { color: var(--muted); font-size: 14px; }
.progress { height: 6px; background: rgba(var(--primary-rgb), 0.15); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s ease; }
.q-who { margin: 24px 0 0; font-size: 13px; color: var(--primary); }
.q-text { font-size: 21px; font-weight: 600; line-height: 1.5; margin: 8px 0 22px; }

.opt {
  display: flex; align-items: center; width: 100%;
  margin: 0 0 12px; padding: 15px 18px;
  border: 1.5px solid transparent; border-radius: 16px;
  background: #fff; color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.5; text-align: left;
  box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.08);
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.opt .opt-letter {
  flex: none; width: 26px; height: 26px; margin-right: 12px; border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.1); color: var(--primary);
  font-size: 13px; font-weight: 600; line-height: 26px; text-align: center;
}
.opt .opt-text { flex: 1; }
.opt .opt-mark { flex: none; margin-left: 8px; font-size: 13px; font-weight: 600; }
.opt.selected { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.07); }
.opt.right { border-color: var(--ok); background: rgba(var(--ok-rgb), 0.08); }
.opt.right .opt-mark { color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: rgba(var(--bad-rgb), 0.06); }
.opt.wrong .opt-mark { color: var(--bad); }
.opts.locked .opt { pointer-events: none; }

/* ---------- 结果 ---------- */
.result-hero { text-align: center; padding: 20px 0 4px; }
.result-pre { color: var(--muted); font-size: 14px; margin: 0; }
.result-title { font-size: 34px; color: var(--primary); margin: 6px 0 4px; line-height: 1.3; }
.result-slogan { margin: 6px 0 0; opacity: 0.85; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; margin: 14px -4px 0; }
.tag {
  margin: 4px; padding: 5px 12px; border-radius: 14px; font-size: 13px;
  background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.08);
}

.bar-row { margin: 0 0 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-labels { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.bar-labels .on { color: var(--primary); font-weight: 600; }
.bar { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(var(--primary-rgb), 0.14); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }

.score-wrap { text-align: center; padding: 16px 0 0; }
.score-names { font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.score-names svg { width: 20px; height: 20px; fill: var(--primary); margin: 0 10px; }
.score-big { font-size: 76px; font-weight: 800; color: var(--primary); line-height: 1.1; margin: 10px 0 0; }
.score-big small { font-size: 32px; }
.score-label { color: var(--muted); font-size: 14px; }

.stats { display: flex; margin: 16px -5px 0; }
.stat { flex: 1; margin: 0 5px; background: #fff; border-radius: 16px; padding: 14px 6px; text-align: center; box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.08); }
.stat b { display: block; font-size: 24px; color: var(--primary); line-height: 1.3; }
.stat span { font-size: 12px; color: var(--muted); }

.cmp-item { padding: 14px 0; border-top: 1px dashed rgba(var(--primary-rgb), 0.2); }
.cmp-item:first-of-type { border-top: 0; padding-top: 4px; }
.cmp-q { font-weight: 600; margin: 0 0 6px; }
.cmp-line { font-size: 14px; color: var(--muted); margin: 2px 0 0; display: flex; }
.cmp-line em { font-style: normal; flex: none; width: 88px; }
.cmp-line span { flex: 1; color: var(--text); }
.cmp-line.ok span { color: var(--ok); }
.cmp-line.bad span { color: var(--bad); }
.same-badge { display: inline-block; white-space: nowrap; font-size: 12px; line-height: 20px; color: var(--primary); background: rgba(var(--primary-rgb), 0.1); border-radius: 10px; padding: 0 8px; margin-left: 6px; font-weight: 400; vertical-align: 1px; }

/* ---------- 分享链接 ---------- */
.linkbox {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 12px;
  background: rgba(var(--primary-rgb), 0.06); color: var(--text);
  font-size: 13px; line-height: 1.6; word-break: break-all;
  -webkit-user-select: all; user-select: all;
}
.share-steps { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.share-steps li { margin: 4px 0; }

/* ---------- 标签选择 ---------- */
.chips { display: flex; flex-wrap: wrap; margin: 0 -4px; }
.chip {
  margin: 4px; padding: 8px 14px; border-radius: 18px;
  border: 1.5px solid rgba(var(--primary-rgb), 0.25); background: #fff; color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.4; text-align: center;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip small { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }
.grid3 .chip { flex: 0 0 calc(33.333% - 8px); padding: 8px 4px; }
.chips.multi .chip { text-align: left; }

.row2 { display: flex; margin: 0 -6px; }
.row2 .btn { flex: 1; width: auto; margin: 12px 6px; }
.link { color: var(--primary); text-decoration: none; }
.pre { white-space: pre-line; }

/* ---------- 翻牌 ---------- */
.flip { position: relative; perspective: 1000px; -webkit-perspective: 1000px; cursor: pointer; }
.flip-inner {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  transition: transform 0.6s ease; transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; border-radius: 20px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.18);
}
.face-back { background: linear-gradient(135deg, var(--primary), var(--card2)); color: #fff; }
.face-back::before {
  content: ""; position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.5); border-radius: 14px;
}
.face-front { background: #fff; transform: rotateY(180deg); }
.face-mark svg { width: 44px; height: 44px; fill: rgba(255, 255, 255, 0.92); }
.face-back b { font-size: 20px; margin-top: 12px; }
.face-back span { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.face-cat {
  display: inline-block; margin-bottom: 14px; padding: 3px 12px; border-radius: 12px;
  font-size: 13px; color: var(--primary); background: rgba(var(--primary-rgb), 0.1);
}
.face-text { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.65; color: var(--text); }
.big-flip { height: 360px; margin: 20px 0 6px; }

.pick3 { display: flex; justify-content: center; margin: 24px -4px 8px; }
.mini-flip { flex: 0 0 30%; margin: 0 1.5%; height: 0; padding-bottom: 46%; transition: opacity 0.3s ease; }
.mini-flip .face { padding: 8px; border-radius: 14px; }
.mini-flip .face-mark svg { width: 30px; height: 30px; }
.mini-flip .face-front b { font-size: 18px; color: var(--primary); }
.mini-flip.dim { opacity: 0.35; }

/* ---------- 盲盒 ---------- */
.gift-wrap { text-align: center; padding: 48px 0 10px; }
.gift { position: relative; width: 190px; height: 200px; margin: 0 auto; cursor: pointer; animation: bob 2.2s ease-in-out infinite; }
.gift-body {
  position: absolute; left: 18px; right: 18px; bottom: 0; height: 124px;
  background: var(--primary); border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 30px rgba(var(--primary-rgb), 0.35);
}
.gift-lid { position: absolute; left: 4px; right: 4px; top: 54px; height: 36px; background: var(--card2); border-radius: 10px; }
.gift-ribbon { position: absolute; left: 50%; top: 54px; bottom: 0; width: 28px; margin-left: -14px; background: rgba(255, 255, 255, 0.88); }
.gift-bow { position: absolute; left: 50%; top: 18px; }
.gift-bow::before, .gift-bow::after {
  content: ""; position: absolute; top: 0; width: 42px; height: 34px;
  border: 8px solid rgba(255, 255, 255, 0.95); border-radius: 50%;
}
.gift-bow::before { right: -2px; transform: rotate(25deg); }
.gift-bow::after { left: -2px; transform: rotate(-25deg); }
.gift.shake { animation: shake 0.8s ease both; }
.gift-tip { color: var(--muted); margin: 22px 0 0; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shake {
  0% { transform: rotate(0); } 15% { transform: rotate(-10deg); } 30% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); } 60% { transform: rotate(8deg); } 75% { transform: scale(1.08); }
  100% { transform: scale(1.2); opacity: 0; }
}
.reveal {
  margin: 20px 0; padding: 30px 22px; border-radius: 24px; background: #fff; text-align: center;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.14);
}
.reveal-title { font-size: 26px; color: var(--primary); margin: 2px 0 12px; line-height: 1.4; }
.reveal p { margin: 0; line-height: 1.8; }

/* ---------- 能量卡 ---------- */
.energy-card {
  position: relative; width: 200px; height: 300px; margin: 6px auto 16px; border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--card2)); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.3);
}
.energy-card::before {
  content: ""; position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.5); border-radius: 14px;
}
.energy-date { position: absolute; top: 28px; font-size: 14px; letter-spacing: 2px; opacity: 0.85; }
.energy-card b { font-size: 36px; letter-spacing: 4px; }
.energy-kw { margin-top: 10px; font-size: 14px; opacity: 0.9; }

/* ---------- 塔罗 ---------- */
.shuffle { position: relative; height: 240px; margin: 60px 0 10px; }
.sh-card {
  position: absolute; left: 50%; top: 20px; width: 120px; height: 190px; margin-left: -60px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--card2));
  border: 3px solid rgba(255, 255, 255, 0.6); box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
}
.sh-card.s1 { animation: sh1 0.9s ease-in-out infinite alternate; }
.sh-card.s2 { animation: sh2 0.9s ease-in-out infinite alternate; }
@keyframes sh1 { to { transform: translateX(-70px) rotate(-12deg); } }
@keyframes sh2 { to { transform: translateX(70px) rotate(12deg); } }

.pick-grid { display: flex; flex-wrap: wrap; margin: 8px -5px 4px; }
.tcard {
  position: relative; flex: 0 0 calc(25% - 10px); margin: 5px; height: 0; padding-bottom: 38%;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, var(--primary), var(--card2));
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2); cursor: pointer; transition: transform 0.2s ease;
}
.tcard.on { transform: translateY(-8px); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--primary); }
.pick-no { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 22px; font-weight: 700; }

.tarot-q { text-align: center; color: var(--muted); margin: 18px 0 0; }
.spread { display: flex; justify-content: center; margin: 24px -4px 8px; }
.slot { flex: 0 0 30%; margin: 0 1.5%; text-align: center; }
.spread-1 .slot { flex-basis: 46%; }
.slot-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.slot-sub { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--primary); }
.tflip { height: 0; padding-bottom: 160%; }
.tflip .face { padding: 8px; border-radius: 14px; }
.tfront { background: linear-gradient(160deg, #fff, rgba(var(--primary-rgb), 0.14)); border: 2px solid rgba(var(--primary-rgb), 0.4); }
.t-inner { display: flex; flex-direction: column; align-items: center; }
.t-inner.rev { transform: rotate(180deg); }
.t-num { font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--primary); }
.t-name { margin-top: 8px; font-size: 17px; color: var(--text); }
.spread-1 .t-num { font-size: 20px; }
.spread-1 .t-name { font-size: 24px; }
.kw { color: var(--primary); font-size: 14px; }
.card p.kw { margin-bottom: 6px; }

/* ---------- 完整版塔罗 ---------- */
.spread-list { margin: 0 -2px; }
.spread-opt {
  display: block; width: calc(100% - 4px); margin: 0 2px 8px; padding: 10px 14px; text-align: left;
  border: 1.5px solid rgba(var(--primary-rgb), 0.2); border-radius: 14px; background: #fff;
  font: inherit; color: var(--text); cursor: pointer; -webkit-appearance: none; appearance: none;
}
.spread-opt b { display: flex; justify-content: space-between; font-size: 15px; }
.spread-opt em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.spread-opt span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.spread-opt.on { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.06); }
.spread-opt.on b { color: var(--primary); }
.opt-inputs .input { margin-top: 10px; height: 46px; font-size: 16px; }
.tip.left { text-align: left; margin-bottom: 0; }

.ritual { text-align: center; padding: 48px 0 20px; }
.breath { width: 120px; height: 120px; margin: 0 auto 28px; position: relative; }
.breath i {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.5), rgba(var(--primary-rgb), 0.08) 70%);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(0.6); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } }
.ritual-title { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.ritual-sub { color: var(--muted); margin: 0; }
.center.ritual-title { margin-top: 36px; }

.cut-row { display: flex; justify-content: space-around; padding: 40px 0 20px; }
.cut-stack { position: relative; width: 84px; height: 140px; cursor: pointer; transition: transform 0.3s ease; }
.cut-stack i {
  position: absolute; left: 0; width: 84px; height: 132px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--card2)); border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.25);
}
.cut-stack i:nth-child(1) { top: 8px; }
.cut-stack i:nth-child(2) { top: 4px; }
.cut-stack i:nth-child(3) { top: 0; }
.cut-stack.on { transform: translateY(-16px); }
.cut-stack.on i:nth-child(3) { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--primary); }

.pick-grid.g6 { margin: 8px -3px 4px; }
.pick-grid.g6 .tcard { flex-basis: calc(16.666% - 6px); margin: 3px; padding-bottom: 27%; border-radius: 7px; }
.pick-grid.g6 .pick-no { font-size: 16px; }

.spread-grid { display: grid; grid-gap: 14px 8px; gap: 14px 8px; align-items: start; margin: 18px 0 8px; }
.spread-grid .slot { margin: 0; text-align: center; position: relative; }
.spread-grid .slot.cross { z-index: 2; }
.spread-grid .slot.cross .tflip { transform: rotate(90deg) scale(0.6); }
.spread-grid .tflip { height: 0; padding-bottom: 170%; }
.spread-grid .tflip .face { border-radius: 8px; padding: 0; }
.timg { background: #fff; overflow: hidden; }
.timg img { display: block; width: 100%; height: 100%; object-fit: cover; }
img.rev { transform: rotate(180deg); }
.spread-grid .slot-label { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.tback::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 36%; padding-bottom: 36%;
  transform: translate(-50%, -50%) rotate(45deg); border: 1.5px solid rgba(255, 255, 255, 0.55); border-radius: 4px;
}
.flip-all { width: auto; padding: 0 22px; margin: 4px auto 12px; }

.read-item { padding: 14px 0; border-top: 1px dashed rgba(var(--primary-rgb), 0.2); overflow: hidden; }
.read-item:first-of-type { border-top: 0; padding-top: 4px; }
.read-thumb { float: left; width: 48px; height: 82px; margin: 3px 12px 4px 0; border-radius: 6px; object-fit: cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.card p.read-title { font-weight: 600; margin: 0; }
.card p.kw { margin: 2px 0 4px; }
.card p.read-advice { color: var(--primary); }
.closing { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; margin: 8px 12px 16px; }

.card-modal { color: #fff; }
.card-modal .modal-card { display: block; width: 62%; margin: 8px auto 14px; border-radius: 12px; }
.card-modal h2 { margin: 0 0 4px; font-size: 20px; }
.card-modal .modal-kw { color: rgba(255, 255, 255, 0.75); margin: 0 0 10px; font-size: 14px; }
.card-modal .modal-text { margin: 0 0 6px; line-height: 1.8; text-align: left; }

/* ---------- 双人对比刻度 ---------- */
.legend { display: flex; justify-content: center; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; margin: 0 10px; }
.legend .scale-dot { position: static; transform: none; width: 12px; height: 12px; border-width: 2px; margin-right: 6px; }
.scale-row { padding: 14px 0; border-top: 1px dashed rgba(var(--primary-rgb), 0.2); }
.legend + .scale-row { border-top: 0; }
.scale-head { display: flex; justify-content: space-between; align-items: center; }
.scale-head b { font-size: 15px; }
.scale-tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.scale-tag.same { color: var(--ok); background: rgba(var(--ok-rgb), 0.1); }
.scale-tag.near { color: var(--primary); background: rgba(var(--primary-rgb), 0.1); }
.scale-tag.far { color: #7a6ae0; background: rgba(140, 124, 240, 0.12); }
.scale-track { position: relative; height: 8px; margin: 16px 9px 8px; border-radius: 4px; background: rgba(var(--primary-rgb), 0.14); }
.scale-dot {
  position: absolute; top: 50%; display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.dot-a { background: var(--primary); }
.dot-b { background: #8C7CF0; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.card .scale-row p { margin-top: 6px; font-size: 14px; line-height: 1.7; }

/* ---------- 生成器表单 ---------- */
.textarea { height: auto; min-height: 96px; padding: 12px 16px; font-size: 16px; line-height: 1.6; resize: none; }
input[type=date].input { line-height: 50px; }
.optional { margin-left: 4px; font-size: 12px; color: #c4b4bc; }
.count { margin-left: 4px; font-size: 12px; color: var(--primary); }
.add-row { display: flex; margin-top: 10px; }
.add-row .input { flex: 1; height: 44px; font-size: 16px; }
.add-row .btn { flex: none; width: auto; height: 44px; margin: 0 0 0 8px; padding: 0 18px; line-height: 44px; }
.preset-label { margin: 12px 0 6px; }
.poster-inline { margin: 8px 0 0; box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.18); }

/* ---------- 交叉推荐 ---------- */
.promo h3 { color: var(--text); }

/* ---------- 海报弹层 ---------- */
.poster-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  background: rgba(30, 16, 24, 0.92);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.poster-box { max-width: 400px; margin: 0 auto; text-align: center; }
.poster-img { display: block; width: 100%; border-radius: 14px; -webkit-touch-callout: default; }
.poster-tip { color: #fff; font-size: 14px; margin: 14px 0 4px; }
.poster-box .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 200;
  max-width: 80%; padding: 10px 18px; border-radius: 22px;
  background: rgba(30, 16, 24, 0.86); color: #fff; font-size: 14px; text-align: center;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript { text-align: center; padding: 40px 20px; }
