:root {
  /* 粉紫梦幻少女风 —— 面向年轻女性 */
  --bg: #1a1024;
  --bg-2: #241334;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 156, 199, 0.22);
  --border-strong: rgba(255, 156, 199, 0.48);
  --primary: #c87dff;
  --primary-2: #ff9ecb;
  --accent: #ffc6dc;
  --accent-2: #a9c2ff;
  --text: #fdeefb;
  --muted: #d6bcd8;
  --muted-2: #9c84a6;
  --good: #8fe3c0;
  --warn: #ffb088;
  --bad: #ff8fab;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -20px rgba(60, 10, 50, 0.7);
  --maxw: 1180px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: var(--font);
  background: transparent;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Starry background ---------- */
.stars, .stars::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 60%, #ffd6ec, transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, #fff, transparent),
    radial-gradient(1px 1px at 40% 80%, #e9c6ff, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 10% 70%, #fff, transparent),
    radial-gradient(1px 1px at 90% 85%, #cfe0ff, transparent);
  background-repeat: repeat;
  background-size: 320px 320px;
  opacity: 0.55;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.stars::after {
  background-size: 200px 200px;
  opacity: 0.35;
  animation-duration: 9s;
  animation-direction: alternate-reverse;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.7; } }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(200,125,255,.32), transparent 60%),
    radial-gradient(800px 600px at 0% 10%, rgba(169,194,255,.18), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(255,198,220,.20), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(26, 16, 36, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; text-decoration: none; color: var(--text); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), var(--accent-2), var(--accent), var(--primary));
  display: grid; place-items: center; font-size: 1rem; box-shadow: 0 0 18px rgba(200,125,255,.6);
}
.brand b { background: linear-gradient(90deg, var(--accent), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: .9rem; padding: 7px 10px; border-radius: 10px; transition: .2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 42px; height: 38px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 92px 0 64px; text-align: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.15; letter-spacing: 1px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--primary-2) 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.2rem); max-width: 720px; margin: 22px auto 0; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: .98rem; cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s;
}
.btn-primary { background: linear-gradient(90deg, var(--primary-2), var(--primary)); color: #3a1642; box-shadow: 0 12px 30px -10px rgba(255,158,199,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(255,158,199,.92); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* ---------- Section heading ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3.5vw, 2.1rem); display: flex; align-items: center; gap: 12px; }
.sec-head h2 .bar { width: 5px; height: 26px; border-radius: 4px; background: linear-gradient(var(--accent), var(--primary)); }
.sec-head .more { color: var(--primary-2); text-decoration: none; font-size: .92rem; }
.sec-head p.sub { color: var(--muted); font-size: .95rem; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: transform .2s, border-color .2s, background .2s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.card h3, .card h4 { font-size: 1.08rem; }
.card .meta { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.card a, a.card, a.card:visited { color: var(--text); text-decoration: none; }

/* ---------- Zodiac sign card ---------- */
.sign-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sign-card h3 { color: var(--text); }
.sign-card .glyph {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem;
  background: radial-gradient(circle at 30% 25%, rgba(255,198,220,.24), rgba(200,125,255,.18));
  border: 1px solid var(--border-strong); color: var(--accent);
}
.sign-card .date { color: var(--muted-2); font-size: .82rem; }
.sign-card .el { font-size: .78rem; color: var(--primary-2); }

/* ---------- Tag chips ---------- */
.chip { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .76rem; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin: 3px 3px 0 0; }
.chip.el-fire { color: #ff9d6b; border-color: rgba(255,157,107,.4); }
.chip.el-earth { color: #c9e07a; border-color: rgba(201,224,122,.4); }
.chip.el-air { color: #8fd6ff; border-color: rgba(143,214,255,.4); }
.chip.el-water { color: #9ad7ff; border-color: rgba(154,215,255,.4); }

/* ---------- Tool / panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; }
.tool-card .ico { font-size: 1.7rem; }
.tool-card h4 { font-size: 1.05rem; }
.tool-card p { color: var(--muted); font-size: .88rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(26,16,36,.42);
  border: 1px solid var(--border); color: var(--text); font-family: var(--font); font-size: .95rem;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200,125,255,.22); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 18px; }
.form-group > label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); font-size: .95rem; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }
.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); font-size: .95rem; }
.radio input { accent-color: var(--primary); width: 16px; height: 16px; }
.hidden { display: none !important; }
.manual-ll { margin-top: 12px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tab { padding: 9px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: .9rem; transition: .2s; }
.tab.active { background: linear-gradient(90deg, var(--primary-2), var(--primary)); color: #3a1642; border-color: transparent; }

/* ---------- Fortune bars ---------- */
.bars { display: grid; gap: 12px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 52px; align-items: center; gap: 12px; font-size: .9rem; }
.bar-track { background: rgba(255,255,255,.08); height: 9px; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--primary)); }

/* ---------- Compatibility result ---------- */
.match-score { font-size: 3.2rem; font-weight: 800; font-family: var(--serif); background: linear-gradient(90deg, var(--accent), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: .82rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span.sep { margin: 0 8px; color: var(--muted-2); }

/* ---------- Article / prose ---------- */
.prose { font-size: 1rem; color: #ecd9ec; }
.prose h2, .prose h3 { font-family: var(--serif); color: var(--text); margin: 26px 0 12px; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.18rem; }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 12px 0 12px 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--primary); padding: 8px 16px; margin: 16px 0; background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.prose .tip { background: rgba(255,198,220,.1); border: 1px solid rgba(255,198,220,.3); border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; color: #ffd9e8; }

/* ---------- Detail hero for sign pages ---------- */
.detail-hero { display: grid; grid-template-columns: 130px 1fr; gap: 26px; align-items: center; padding: 30px; }
.detail-hero .big-glyph { width: 120px; height: 120px; border-radius: 28px; display: grid; place-items: center; font-size: 3.6rem; background: radial-gradient(circle at 30% 25%, rgba(255,198,220,.24), rgba(200,125,255,.2)); border: 1px solid var(--border-strong); color: var(--accent); }

/* ---------- 星座速配深度报告 ---------- */
.gap-16 { gap: 16px; }
.compat-report h3 { font-family: var(--serif); font-size: 1.22rem; color: var(--text); margin: 0; }
.compat-report .card h4 { font-family: var(--serif); font-size: 1.04rem; color: var(--text); margin: 0; }
.compat-report .card ul { margin: 10px 0 0 20px; }
.compat-report .card li { margin: 6px 0; color: var(--muted); font-size: .9rem; }
.compat-pros { border-top: 3px solid rgba(169,194,255,.55); }
.compat-cons { border-top: 3px solid rgba(255,143,171,.55); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.stat .k { font-size: .78rem; color: var(--muted); }
.stat .v { font-size: 1.05rem; font-weight: 700; margin-top: 3px; }

/* ---------- Misc ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 0; border: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .gap-12 { gap: 12px; } .wrap-flex { flex-wrap: wrap; }
.between { justify-content: space-between; } .items-center { align-items: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 48px 0 30px; background: rgba(26,16,36,.4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.site-footer h4 { font-size: .98rem; margin-bottom: 12px; color: var(--text); }
.site-footer a { color: var(--muted); text-decoration: none; font-size: .88rem; display: block; margin: 7px 0; }
.site-footer a:hover { color: var(--primary-2); }
.footer-note { color: var(--muted-2); font-size: .8rem; margin-top: 26px; line-height: 1.8; }

/* ---------- Astrolabe canvas ---------- */
.astrolabe { width: 100%; max-width: 460px; aspect-ratio: 1; margin: 0 auto; display: block; }

/* ---------- Tarot categories ---------- */
.tarot-cats { max-width: 760px; margin: 0 auto 8px; }
.tarot-cat-group { font-size: .95rem; color: var(--accent); margin: 18px 0 10px; font-weight: 700; }
.tarot-cat-group:first-child { margin-top: 0; }
.tarot-cat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tarot-cat-chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: .9rem; cursor: pointer;
  transition: .2s; font-family: var(--font);
}
.tarot-cat-chip:hover { border-color: var(--primary); color: var(--text); background: var(--surface-2); }
.tarot-cat-chip.active {
  background: linear-gradient(90deg, var(--primary-2), var(--primary)); color: #3a1642;
  border-color: transparent; box-shadow: 0 8px 22px -8px rgba(255,158,199,.6);
}

/* ---------- Tarot actions ---------- */
.tarot-actions { display: flex; justify-content: center; margin-top: 24px; }

/* ---------- Tarot card ---------- */
.tarot-card {
  width: 110px; height: 190px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 12px 10px 10px; text-align: center; cursor: pointer; transition: transform .25s;
  position: relative; box-sizing: border-box;
}
.tarot-card .num {
  font-family: var(--serif); font-size: .82rem; font-weight: 700; letter-spacing: 1px;
  color: #6b5c3a; background: rgba(184,170,130,.18); padding: 2px 10px; border-radius: 999px;
}
.tarot-card .sym-wrap {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), rgba(184,170,130,.25));
  box-shadow: inset 0 0 0 1.5px rgba(184,170,130,.45), 0 4px 14px rgba(0,0,0,.08);
}
.tarot-card .sym { font-size: 2.6rem; line-height: 1; }
.tarot-card .nm { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: #1f1c38; margin-top: auto; }
.tarot-card .orient {
  font-size: .72rem; padding: 3px 12px; border-radius: 999px; font-weight: 700; margin-top: 6px;
}
.tarot-card .orient:not(.rev) { background: rgba(169,194,255,.22); color: #0a5f7a; }
.tarot-card .orient.rev { background: rgba(255,143,171,.18); color: #a83232; }

/* Card back (soft pink-purple, dreamy) */
.tarot-card.back,
.tarot-draw-col .tarot-card.flip .face.front {
  background:
    radial-gradient(circle at 14px 14px, rgba(255,158,199,.5) 0, rgba(255,158,199,.5) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, rgba(255,158,199,.5) 0, rgba(255,158,199,.5) 3px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), rgba(255,158,199,.5) 0, rgba(255,158,199,.5) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), rgba(255,158,199,.5) 0, rgba(255,158,199,.5) 3px, transparent 4px),
    linear-gradient(160deg, #2a1840 0%, #1a0f2e 100%);
  border: 1px solid #6b4a7a;
  box-shadow: 0 10px 24px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
  color: #d6bcd8; overflow: hidden;
}
.tarot-card.back::before,
.tarot-draw-col .tarot-card.flip .face.front::before {
  content: ""; position: absolute; inset: 7px;
  border: 1.5px solid rgba(255,158,199,.45); border-radius: 11px; pointer-events: none;
}
.tarot-card.back::after,
.tarot-draw-col .tarot-card.flip .face.front::after {
  content: ""; position: absolute; inset: 11px;
  border: 1px solid rgba(255,158,199,.25); border-radius: 8px; pointer-events: none;
}
.tarot-card.back .medallion,
.tarot-draw-col .tarot-card.flip .face.front .medallion {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,158,199,.35), rgba(42,24,64,.85));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,158,199,.55);
  box-shadow: 0 0 20px rgba(255,158,199,.25), inset 0 0 0 1px rgba(255,255,255,.08);
}
.tarot-card.back .sym,
.tarot-draw-col .tarot-card.flip .face.front .sym {
  font-size: 1.8rem; color: #ff9ecb; text-shadow: 0 0 14px rgba(255,158,199,.5);
}

/* ---------- Tarot: spread fan + flip ---------- */
.tarot-deck { position: relative; height: 240px; overflow-x: auto; overflow-y: hidden; padding: 6px 0 14px; margin-top: 4px; scrollbar-width: thin; }
.tarot-deck::-webkit-scrollbar { height: 6px; }
.tarot-deck::-webkit-scrollbar-thumb { background: rgba(255,158,199,.4); border-radius: 6px; }
.tarot-deck .fan { position: relative; height: 100%; margin: 0 auto; }
.tarot-deck .tarot-card.back { position: absolute; top: 10px; width: 100px; height: 185px; aspect-ratio: auto; }
.tarot-deck .tarot-card.back:hover {
  transform: translateY(-14px) scale(1.06) rotate(var(--rot));
  box-shadow: 0 18px 36px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.08);
  z-index: 5;
}
.tarot-status { color: var(--muted); font-size: .9rem; margin: 18px 0 4px; min-height: 1.2em; text-align: center; }
.tarot-drawn { display: none; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.tarot-draw-col { width: 160px; display: flex; flex-direction: column; align-items: center; }
.tarot-draw-col .tarot-card.flip { width: 110px; height: 190px; aspect-ratio: auto; cursor: default; perspective: 900px; background: none; border: 0; padding: 0; }
.tarot-draw-col .tarot-card.flip:hover { transform: none; }
.tarot-draw-col .tarot-card.flip .tarot-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.tarot-draw-col .tarot-card.flip.flipped .tarot-inner { transform: rotateY(180deg); }
.tarot-draw-col .tarot-card.flip .face {
  position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 12px 10px 10px; text-align: center; overflow: hidden; box-sizing: border-box;
}

/* Revealed face (parchment/light) */
.tarot-draw-col .tarot-card.flip .face.rear {
  background:
    radial-gradient(circle at 14px 14px, rgba(184,170,130,.85) 0, rgba(184,170,130,.85) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, rgba(184,170,130,.85) 0, rgba(184,170,130,.85) 3px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), rgba(184,170,130,.85) 0, rgba(184,170,130,.85) 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), rgba(184,170,130,.85) 0, rgba(184,170,130,.85) 3px, transparent 4px),
    linear-gradient(165deg, #f9f3e0 0%, #e8dfc5 55%, #ddd3b8 100%);
  color: #2d2a45; border: 1px solid #b8aa82;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 10px 28px rgba(0,0,0,.25);
  transform: rotateY(180deg);
}
.tarot-draw-col .tarot-card.flip .face.rear::before {
  content: ""; position: absolute; inset: 7px;
  border: 1.5px solid rgba(184,170,130,.7); border-radius: 11px; pointer-events: none;
}
.tarot-draw-col .tarot-card.flip .face.rear::after {
  content: ""; position: absolute; inset: 11px;
  border: 1px solid rgba(184,170,130,.35); border-radius: 8px; pointer-events: none;
}
.tarot-draw-col .tarot-card.flip .face.rear .num { font-size: .78rem; color: #6b5c3a; background: rgba(184,170,130,.18); padding: 2px 10px; border-radius: 999px; }
.tarot-draw-col .tarot-card.flip .face.rear .nm { font-family: var(--serif); font-size: 1rem; font-weight: 700; color: #1f1c38; margin-top: auto; }
.tarot-draw-col .tarot-card.flip .face.rear .sym-wrap { background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.6), rgba(184,170,130,.28)); }
.tarot-draw-col .tarot-card.flip .face.rear .sym { color: #4a3f7a; }
.tarot-read { width: 160px; margin-top: 12px; }
.tarot-read h4 { font-size: .95rem; }
.tarot-read p { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Dream list ---------- */
.dream-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.dream-item:last-child { border-bottom: 0; }
.dream-item h4 { font-size: 1rem; margin-top: 6px; }
.dream-item p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.dream-item .tag { display: inline-block; }
.tag { font-size: .72rem; padding: 2px 9px; border-radius: 999px; background: rgba(169,194,255,.16); color: var(--accent-2); white-space: nowrap; }
.dream-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.dream-cat-chip { border: 1px solid var(--border); background: transparent; color: var(--text); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: .85rem; transition: .2s; }
.dream-cat-chip:hover { border-color: var(--accent-2); }
.dream-cat-chip.active { background: var(--accent); color: #3a1642; border-color: var(--accent); font-weight: 700; }
.dream-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; max-height: 300px; overflow: auto; padding: 4px; scrollbar-width: thin; }
.dream-grid::-webkit-scrollbar { width: 6px; }
.dream-grid::-webkit-scrollbar-thumb { background: rgba(255,158,199,.4); border-radius: 6px; }
.dream-key { border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text); padding: 7px 12px; border-radius: 10px; cursor: pointer; font-size: .9rem; transition: .15s; }
.dream-key:hover { transform: translateY(-2px); border-color: var(--accent-2); box-shadow: 0 6px 16px rgba(169,194,255,.22); }
.dream-detail { background: rgba(200,125,255,.08); border: 1px solid var(--border-strong); border-radius: 14px; padding: 18px; margin-top: 4px; animation: dreamIn .35s ease; }
.dream-detail .dh { display: flex; align-items: center; gap: 10px; }
.dream-detail .dh h3 { font-family: var(--serif); font-size: 1.3rem; }
.dream-detail .dv { margin-top: 10px; line-height: 1.8; }
@keyframes dreamIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Test quiz ---------- */
.question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 14px; }
.question .q { font-weight: 700; margin-bottom: 12px; }
.opt { display: block; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); margin: 8px 0; cursor: pointer; transition: .15s; }
.opt:hover { border-color: var(--primary); background: var(--surface-2); }
.opt.sel { border-color: var(--primary); background: rgba(200,125,255,.16); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 56px; aspect-ratio: auto; border-radius: 8px; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .85rem; cursor: pointer; transition: .15s; padding: 3px 1px; line-height: 1.25; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.today { border-color: var(--accent); color: var(--accent); }
.cal-cell.sel { background: rgba(255,158,203,.18); border-color: var(--primary-2); }
.cal-cell .day { font-size: .95rem; font-weight: 600; }
.cal-cell .lunar { font-size: .58rem; color: var(--muted-2); margin-top: 1px; }
.cal-cell .tag { font-size: .5rem; color: var(--accent); margin-top: 1px; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.cal-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1.05rem; }
.cal-select { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 5px 8px; font-size: .92rem; cursor: pointer; min-width: 72px; text-align: center; }
.cal-select:focus { outline: none; border-color: var(--primary); }
.cal-select option { background: #2a1a38; color: #fff8fb; }
.cal-title .cal-select { min-width: 76px; }
/* ---------- Result box ---------- */
.result-box { background: linear-gradient(160deg, rgba(200,125,255,.14), rgba(169,194,255,.06)); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 24px; margin-top: 20px; }

/* ---------- Accordion ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.acc > button { width: 100%; text-align: left; padding: 15px 18px; background: var(--surface); border: 0; color: var(--text); font-size: 1rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: var(--font); }
.acc > .body { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height .3s, padding .3s; }
.acc.open > .body { padding: 14px 18px 18px; max-height: 600px; }
.acc-group .acc { margin-bottom: 10px; }

/* ---------- Data tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.data-table td { color: var(--text); }
.data-table tr:last-child td { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .nav-links {
    position: fixed; inset: 0 0 0 auto;
    width: min(280px, 82vw); height: 100vh;
    margin-left: 0; flex-direction: column; justify-content: flex-start; align-items: stretch;
    background: rgba(26,16,36,.98); backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    padding: 84px 16px 24px;
    z-index: 60;
    transform: translateX(110%);
    transition: transform .35s ease;
    box-shadow: -20px 0 50px rgba(0,0,0,.4);
    pointer-events: none;
  }
  .nav-links.open { transform: translateX(0); pointer-events: auto; }
  .nav-links a { padding: 14px 16px; border-radius: 12px; font-size: 1rem; }
  .nav-links a:hover, .nav-links a.active { background: var(--surface-2); }
  .nav-toggle { display: block; }
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr 1fr; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .detail-hero { grid-template-columns: 1fr; text-align: center; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
}
@media (max-width: 460px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
}

/* ============================================================
   双主题切换：方案 A（深色氛围，默认） / 方案 B（亮色阅读）
   方案 B 仅亮化「长文阅读区」，导航/Hero/入口卡/塔罗保持深色氛围
   ============================================================ */

/* ---------- 浮动主题切换器 ---------- */
.theme-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #2a0f33; font-size: .86rem; font-weight: 600; border: 0;
  box-shadow: 0 10px 26px -8px rgba(200,125,255,.7);
  transition: transform .2s, box-shadow .2s;
}
.theme-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(200,125,255,.85); }
.theme-fab .ic { font-size: 1rem; line-height: 1; }

.theme-pop {
  position: fixed; right: 18px; bottom: 64px; z-index: 81;
  width: 230px; padding: 14px;
  background: rgba(36,19,52,.98); backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px) scale(.98); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.theme-pop.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.theme-pop .tp-title { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.theme-opt {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: .88rem; margin-bottom: 8px; transition: .15s;
}
.theme-opt:last-child { margin-bottom: 0; }
.theme-opt:hover { background: var(--surface-2); border-color: var(--border-strong); }
.theme-opt.active { border-color: var(--primary-2); background: rgba(255,158,203,.16); }
.theme-opt .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; flex: 0 0 auto; }
.theme-opt.a .dot { background: linear-gradient(135deg, #241334, #c87dff); }
.theme-opt.b .dot { background: linear-gradient(135deg, #fffafc, #ffc6dc); }
.theme-opt b { display: block; font-weight: 600; }
.theme-opt small { color: var(--muted); font-size: .76rem; }

/* ---------- 方案 B：亮色阅读区（仅长文内容） ---------- */

/* 只亮化「作为正文容器的 .prose」，避免误亮化嵌套在深色 .card 里的小段 .prose（如星盘页） */
html[data-theme="b"] .card.prose,
html[data-theme="b"] .compat-report .prose {
  color: #3f2a38; background: #fffafc; border: 1px solid #f0d5e2; border-radius: var(--radius); padding: 22px 24px;
}
html[data-theme="b"] .card.prose h2, html[data-theme="b"] .card.prose h3,
html[data-theme="b"] .compat-report .prose h2, html[data-theme="b"] .compat-report .prose h3 { color: #7a2b52; }
html[data-theme="b"] .card.prose strong,
html[data-theme="b"] .compat-report .prose strong { color: #c14d7e; }
html[data-theme="b"] .card.prose blockquote,
html[data-theme="b"] .compat-report .prose blockquote { background: #fbeef5; border-left-color: var(--primary-2); color: #6b4a58; }
html[data-theme="b"] .card.prose .tip,
html[data-theme="b"] .compat-report .prose .tip { background: #fdeef5; border-color: #f0c9dd; color: #8a3a63; }
html[data-theme="b"] .card.prose .muted, html[data-theme="b"] .card.prose .small,
html[data-theme="b"] .compat-report .prose .muted, html[data-theme="b"] .compat-report .prose .small { color: #7a6272; }
html[data-theme="b"] .card.prose a,
html[data-theme="b"] .compat-report .prose a { color: #c14d7e; }

/* 星座速配报告：方案 B 仅亮底长文 .prose，报告整体与卡片保持深色氛围 */
html[data-theme="b"] .compat-report { color: var(--text); }
html[data-theme="b"] .compat-report .card {
  background: rgba(255,250,252,0.07);
  border-color: rgba(255,250,252,0.14);
}
html[data-theme="b"] .compat-report h3,
html[data-theme="b"] .compat-report .card h4 { color: #fff8fb; }
html[data-theme="b"] .compat-report .card .muted,
html[data-theme="b"] .compat-report .card .small,
html[data-theme="b"] .compat-report .card p,
html[data-theme="b"] .compat-report .card li { color: #f0d5e2; }
html[data-theme="b"] .compat-report .card strong { color: #ffc6dc; }

/* 速配头部 detail-hero 保持深色氛围 */
html[data-theme="b"] .compat-report .detail-hero,
html[data-theme="b"] .compat-report .detail-hero .card { background: transparent; border: 0; color: var(--text); }
html[data-theme="b"] .compat-report .detail-hero .big-glyph { border-color: rgba(255,250,252,0.22); }

/* 周公解梦释义 */
html[data-theme="b"] .dream-detail { background: #fffafc; border-color: #f0d5e2; color: #3f2a38; }
html[data-theme="b"] .dream-detail .dh h3 { color: #7a2b52; }
html[data-theme="b"] .dream-detail .dv { color: #4a3340; }
html[data-theme="b"] .dream-detail .muted,
html[data-theme="b"] .dream-detail .small { color: #7a6272; }

/* 星座/生肖详情 hero */
html[data-theme="b"] .detail-hero { background: #fffafc; border: 1px solid #f0d5e2; }
html[data-theme="b"] .detail-hero h1,
html[data-theme="b"] .detail-hero h2 { color: #7a2b52; }
html[data-theme="b"] .detail-hero .lead,
html[data-theme="b"] .detail-hero .muted,
html[data-theme="b"] .detail-hero .small,
html[data-theme="b"] .detail-hero p { color: #6b4a58; }
html[data-theme="b"] .detail-hero .big-glyph { background: radial-gradient(circle at 30% 25%, rgba(255,158,203,.4), rgba(200,125,255,.3)); color: #7a2b52; }

/* ---------- 广告位（全站预留，由后台 cms 动态填充） ---------- */
.ad-slot { margin: 18px 0; min-height: 0; }
.ad-slot:empty { display: none; }
/* 后台可填写任意 HTML 作为广告内容；这里给一个通用的轻量外框，便于运营查看边界 */
.ad-slot .ad-card {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 14px 16px; background: var(--surface); text-align: center;
}
.ad-slot .ad-card .ad-tag {
  display: inline-block; font-size: .68rem; letter-spacing: .12em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-bottom: 6px;
}
