/* ============================================================
   观微命理 · 三页卡片版
   墨蓝夜空 + 奶油纸感卡片 + CAOCH 编辑式设计语言
   Epilogue 超黑大标题 + Inter 正文 + 每页一块强调色 + 下划线文字 CTA
   ============================================================ */

:root {
  --night: #10141b;
  --night-deep: #0b0e14;
  --night-soft: rgba(255, 255, 255, 0.055);
  --paper: #f5f2ea;
  --paper-deep: #efeae0;
  --ink: #232323;
  --ink-soft: #5e5e5e;
  --ink-dim: #6d6d6d;
  --cinnabar: #b23a2e;
  --cinnabar-bright: #d2543f;
  --gold: #a97b2f;
  --gold-bright: #c9a15f;
  --line-dark: rgba(255, 255, 255, 0.14);
  --line-paper: rgba(35, 35, 35, 0.14);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --kaiti: "KaiTi", "STKaiti", "Noto Serif SC", serif;
  --display: "Epilogue", "Inter", "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-card: 28px;
  --radius-input: 10px;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* 每页一块强调色（CAOCH 粉彩分区理念，落到纸卡上取足够深的可读变体） */
.page--zodiac {
  --accent: #a97b2f;
  --accent-soft: rgba(169, 123, 47, 0.13);
}
.page--bazi {
  --accent: #4a6fa5;
  --accent-soft: rgba(74, 111, 165, 0.12);
}
.page--liuren {
  --accent: #bf5b7e;
  --accent-soft: rgba(191, 91, 126, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 242, 234, 0.35) transparent;
}
html.is-locked {
  overflow: hidden;
}

body {
  background:
    radial-gradient(1000px 640px at 82% 16%, rgba(118, 96, 186, 0.16), transparent 62%),
    radial-gradient(1100px 700px at 10% 30%, rgba(48, 88, 148, 0.2), transparent 64%),
    radial-gradient(900px 620px at 68% 86%, rgba(201, 161, 95, 0.1), transparent 60%),
    radial-gradient(760px 520px at 22% 96%, rgba(150, 64, 96, 0.13), transparent 62%),
    var(--night);
  color: var(--paper);
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

::selection {
  background: rgba(201, 161, 95, 0.35);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(245, 242, 234, 0.28);
  border: 3px solid var(--night);
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
ul,
ol,
dl,
figure {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 背景氛围 ---------- */

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* 视口四周柔暗角，把视线收进卡片 */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 52%, rgba(5, 7, 11, 0.42) 100%);
}

.fog {
  position: fixed;
  width: 130vw;
  height: 62vh;
  left: -15vw;
  z-index: 1;
  pointer-events: none;
  filter: blur(70px);
  mix-blend-mode: screen;
  opacity: 0.32;
  will-change: transform;
}
.fog--a {
  top: -22vh;
  background: radial-gradient(50% 60% at 35% 50%, rgba(190, 180, 160, 0.12), transparent 70%);
  animation: fogDriftA 34s ease-in-out infinite alternate;
}
.fog--b {
  bottom: -24vh;
  background: radial-gradient(50% 60% at 68% 50%, rgba(120, 140, 180, 0.12), transparent 70%);
  animation: fogDriftB 42s ease-in-out infinite alternate;
}
@keyframes fogDriftA {
  to {
    transform: translateX(9vw) translateY(3vh);
  }
}
@keyframes fogDriftB {
  to {
    transform: translateX(-11vw) translateY(-2vh);
  }
}

.cursor-glow {
  position: fixed;
  top: -320px;
  left: -320px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 161, 95, 0.07), rgba(201, 161, 95, 0) 62%);
  z-index: 2;
  pointer-events: none;
}

/* ---------- 入场 ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--night-deep);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.preloader__line {
  width: 180px;
  height: 1px;
  background: var(--line-dark);
  overflow: hidden;
}
.preloader__line i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold-bright);
  transform-origin: left;
  transform: scaleX(0);
  animation: preloadLine 1.1s var(--ease) forwards;
}
@keyframes preloadLine {
  to {
    transform: scaleX(1);
  }
}
.preloader__copy {
  font-family: var(--kaiti);
  font-size: 14px;
  letter-spacing: 0.34em;
  color: var(--paper);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 52px);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(16, 20, 27, 0.92) 0%,
    rgba(16, 20, 27, 0.8) 55%,
    rgba(16, 20, 27, 0) 100%
  );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar > * {
  pointer-events: auto;
}

/* 顶部中央 · 注释式引言 */
.topbar__tagline {
  position: static;
  justify-self: center;
  margin: 0;
  max-width: 100%;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: rgba(201, 161, 95, 0.82);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(150, 40, 30, 0.4);
}
.topbar__name {
  font-family: var(--kaiti);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--paper);
}
.topbar__sub {
  margin-left: 2px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold-bright);
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
}
.nav-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: rgba(245, 242, 234, 0.58);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s ease;
}
.nav-item i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(245, 242, 234, 0.36);
}
.nav-item:hover {
  color: rgba(245, 242, 234, 0.9);
}
.nav-item.is-active {
  color: var(--paper);
}
.nav-item.is-active i {
  color: var(--gold);
}
.topbar-account {
  display: inline-flex;
  align-items: center;
  height: 34px;
  max-width: 190px;
  padding: 0 14px;
  border: 1px solid rgba(245, 242, 234, 0.28);
  border-radius: 999px;
  background: rgba(245, 242, 234, 0.06);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.topbar-account:hover {
  border-color: var(--cinnabar);
  background: rgba(194, 65, 47, 0.18);
}
.topbar-account.is-signed-in {
  border-color: rgba(200, 161, 95, 0.55);
}
.topbar-account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--gold-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-item.is-active::after,
.nav-item:hover::after {
  transform: scaleX(1);
}

/* ---------- 主区 ---------- */

main {
  position: relative;
  z-index: 3;
}

.page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(96px, 11vh, 124px) clamp(20px, 4vw, 56px) clamp(40px, 6vh, 72px);
  scroll-margin-top: 0;
}
.page.is-active {
  animation: pageIn 0.8s var(--ease) both;
}
.page.is-active:nth-of-type(2) {
  animation-delay: 0.08s;
}
.page.is-active:nth-of-type(3) {
  animation-delay: 0.16s;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 纸感卡片 ---------- */

.card {
  width: 100%;
  max-width: 1360px;
  background:
    radial-gradient(700px 300px at 18% 0%, rgba(201, 161, 95, 0.07), transparent 60%),
    var(--paper);
  color: var(--ink);
  border-radius: var(--radius-card);
  border: 1px solid rgba(35, 35, 35, 0.055);
  box-shadow: 0 44px 110px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.card__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  min-height: min(72svh, 660px);
}

.card__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 4.4vw, 62px);
}

.card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  align-self: flex-start;
  margin-bottom: 18px;
  font-family: "Cinzel", var(--serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.card__eyebrow .eyebrow-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent, var(--gold));
}
.card__eyebrow::after {
  content: "";
  width: 46px;
  height: 1px;
  margin-left: 2px;
  background: var(--accent-soft, rgba(169, 123, 47, 0.4));
}

.card__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--ink);
  text-wrap: balance;
}
.card__title em {
  display: block;
  margin-top: 14px;
  font-style: normal;
  font-weight: 900;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent, var(--gold));
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
  text-decoration-skip-ink: none;
}

.card__desc {
  margin-top: 26px;
  max-width: 34em;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.card__question {
  margin-top: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line-paper);
  border-bottom: 1px solid var(--line-paper);
  color: var(--cinnabar);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- 输入行（Stripe B 风格） ---------- */

.card__form {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: clamp(12px, 1.4vw, 22px);
  margin-top: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 54px;
}
.field--year {
  min-width: 66px;
}
.field--time {
  min-width: 70px;
}
.field--gender {
  min-width: 78px;
}
.field__label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-left: 2px;
}
.field__input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(35, 35, 35, 0.16);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  text-align: center;
  caret-color: var(--cinnabar);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field__select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--sans);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  padding: 0 10px;
}
.field__select:focus-visible {
  outline: none;
}
.field:focus-within .field__input {
  border-color: var(--accent, var(--gold));
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(169, 123, 47, 0.14));
}

.card__go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 42px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.25s ease,
    transform 0.25s var(--ease),
    box-shadow 0.25s ease;
}
.card__go i {
  font-style: normal;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}
.card__go .go__short {
  display: none;
}
.card__go:hover {
  background: var(--accent, var(--cinnabar));
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(35, 35, 35, 0.2);
}
.card__go:focus-visible {
  outline: 2px solid var(--accent, var(--gold-bright));
  outline-offset: 2px;
}
.card__go:hover i {
  transform: translateX(4px);
}

/* ---------- 右侧示意 ---------- */

.card__visual {
  position: relative;
  margin: 0;
  height: min(72svh, 660px);
  padding: clamp(14px, 2vw, 26px) clamp(14px, 2vw, 26px) clamp(14px, 2vw, 26px) 0;
}
.card__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(35, 35, 35, 0.18);
}

/* 第二页：太极罗盘动态图（iframe 无边框贴边） */
.card__visual--frame {
  padding: 0;
}
.visual-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

/* 第三页：宇宙球舞台 + 加载态 + 结果卡（无边框，奶油纸上悬浮深空玻璃球） */
.card__visual--liuren {
  padding: 0;
  overflow: hidden;
}
.orb-stage {
  --ring: min(76%, 440px);
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.orb-stage__canvas {
  display: block;
  width: min(68%, 400px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0b0e14;
}
.orb-stage__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ring);
  height: var(--ring);
  border: 1px dashed rgba(191, 91, 126, 0.38);
  border-radius: 50%;
  animation: orbSpinCenter 46s linear infinite;
  pointer-events: none;
}
.orb-stage__copy {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
}
.orb-stage__copy--top {
  top: 11%;
  color: var(--accent, #bf5b7e);
}
.orb-stage__copy--bottom {
  bottom: 10%;
  color: var(--ink-soft);
}
.orb-stage__copy--bottom i {
  font-style: normal;
  display: inline-block;
  margin-left: 4px;
  animation: arrowNudge 1.8s ease-in-out infinite;
}

/* 加载态：仅星环加速（不显示任何加载文字） */
.orb-stage.is-loading .orb-stage__ring {
  animation-duration: 12s;
}
.orb-stage.is-loading .orb-stage__copy {
  opacity: 0;
}

/* 结果卡：宇宙球淡出 → 编辑风结果面板浮现 */
.liuren-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2vw, 20px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.15s, transform 0.55s var(--ease) 0.15s;
}
.card__visual--liuren.is-answering .orb-stage {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s var(--ease);
}
.card__visual--liuren.is-answering .liuren-result {
  opacity: 1;
  transform: none;
}
.liuren-result__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 16px;
  background:
    radial-gradient(240px 120px at 100% 0%, rgba(191, 91, 126, 0.06), transparent 70%),
    var(--paper-deep);
  border: 1px solid rgba(35, 35, 35, 0.1);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 42px rgba(35, 35, 35, 0.14);
}

/* 三卦链：第一步 → 第二步 → 最终落宫（红框） */
.liuren-result__palaces {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px 10px;
  border: 1px solid rgba(178, 58, 46, 0.3);
  border-radius: 14px;
  background: rgba(178, 58, 46, 0.05);
}
.liuren-result__palace {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(35, 35, 35, 0.08);
}
.liuren-result__palace--final {
  border-color: rgba(178, 58, 46, 0.55);
  background: rgba(178, 58, 46, 0.08);
  box-shadow: 0 6px 16px rgba(178, 58, 46, 0.12);
}
.liuren-result__palace-step {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.liuren-result__palace-cn {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 17px;
  color: var(--ink);
}
.liuren-result__palace-en {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.liuren-result__palace-arrow {
  color: rgba(178, 58, 46, 0.55);
  font-size: 13px;
  flex: 0 0 auto;
}

.liuren-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.liuren-result__badge {
  font-family: "Cinzel", var(--serif);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--cinnabar);
  padding: 5px 13px;
  border: 1px solid rgba(178, 58, 46, 0.3);
  border-radius: 999px;
  background: rgba(178, 58, 46, 0.06);
}
.liuren-result__title {
  margin: 15px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-wrap: balance;
}
.liuren-result__answer {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.liuren-result__answer strong {
  font-weight: 700;
  color: var(--ink);
}
.liuren-result__pending {
  font-style: italic;
  opacity: 0.75;
}
.liuren-result__basis {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dotted rgba(35, 35, 35, 0.22);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--ink-dim);
  white-space: pre-line;
}
.liuren-result__again {
  align-self: flex-start;
  margin-top: 18px;
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}
.liuren-result__again:hover {
  background: var(--accent, var(--cinnabar));
  transform: translateY(-1px);
}
.liuren-result__disclaimer {
  margin: 14px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink-dim);
}
@keyframes orbSpinCenter {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes arrowNudge {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.55;
  }
  50% {
    transform: translateX(4px);
    opacity: 1;
  }
}

/* ============================================================
   第一页 · 十二生肖舞台
   3×4 网格 → 悬停微放大 → 输入年份后选中生肖原位生长放大、
   其余淡出消散、底部浮现介绍面板
   ============================================================ */

.card__visual--zodiac {
  padding: 0;
}
.zodiac-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(169, 123, 47, 0.09), transparent 58%),
    var(--paper);
}

.zodiac-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  height: 74%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
}

.zodiac-tile {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #efe9db;
  border: 1px solid rgba(35, 35, 35, 0.08);
  box-shadow: 0 8px 18px rgba(35, 35, 35, 0.06);
  cursor: pointer;
  transition:
    transform 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    border-color 0.4s ease,
    opacity 0.5s ease,
    filter 0.5s ease;
}
.zodiac-stage .zodiac-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zodiac-tile__idx {
  position: absolute;
  top: 7px;
  left: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(35, 35, 35, 0.45);
  text-shadow: 0 1px 2px rgba(245, 242, 234, 0.7);
}
.zodiac-tile__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 4px 5px;
  text-align: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(35, 35, 35, 0.62));
  border-radius: 0 0 13px 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
  pointer-events: none;
}

/* 悬停互动：微微放大 + 上浮 + 金边 + 名字浮现 */
.zodiac-tile:hover {
  transform: scale(1.06) translateY(-3px);
  border-color: rgba(169, 123, 47, 0.5);
  box-shadow: 0 18px 34px rgba(35, 35, 35, 0.15);
  z-index: 2;
}
.zodiac-tile:hover .zodiac-tile__name {
  opacity: 1;
  transform: none;
}

/* 揭示状态：锁定悬停 */
.zodiac-stage.is-revealing .zodiac-tile {
  pointer-events: none;
}
.zodiac-tile.is-leaving {
  opacity: 0;
  transform: scale(0.55) translateY(8px);
  filter: blur(3px);
}
.zodiac-tile.is-selected {
  z-index: 5;
  border-color: rgba(169, 123, 47, 0.4);
  box-shadow: 0 34px 80px rgba(35, 35, 35, 0.3);
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(var(--s, 1));
  transition:
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.9s ease,
    border-color 0.6s ease;
}
.zodiac-tile.is-selected .zodiac-tile__name {
  opacity: 0;
}

/* 选中后的背景柔光 */
.zodiac-glow {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(62%, 400px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(169, 123, 47, 0.2), rgba(169, 123, 47, 0.06) 42%, transparent 68%);
  opacity: 0;
  transition: opacity 0.9s ease 0.45s;
  pointer-events: none;
}
.zodiac-stage.is-showing .zodiac-glow {
  opacity: 1;
}

/* 底部介绍面板 */
.zodiac-showcase {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 6;
  padding: 13px 18px 11px;
  text-align: center;
  background: var(--paper-deep);
  border: 1px solid rgba(35, 35, 35, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 46px rgba(35, 35, 35, 0.16);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s var(--ease);
}
.zodiac-showcase.is-visible {
  opacity: 1;
  transform: none;
}
.zodiac-showcase__name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}
.zodiac-showcase__char {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.zodiac-showcase__year {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.zodiac-showcase__desc {
  margin: 8px auto 0;
  max-width: 30em;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.zodiac-showcase__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 2px 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1.5px;
  background-position: 0 100%;
  transition: background-size 0.35s var(--ease), color 0.3s ease;
}
.zodiac-showcase__back:hover {
  color: var(--cinnabar);
  background-size: 100% 1.5px;
}

/* 年份校验错误 */
.form-error {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--cinnabar);
}
.field.has-error .field__input {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.12);
}
.field.has-error .field__label {
  color: var(--cinnabar);
}

/* 第三页 · 问题输入 */
.card__question-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
}
.card__question-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-left: 2px;
}
.card__question-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(35, 35, 35, 0.16);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  caret-color: var(--cinnabar);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card__question-input:focus {
  outline: none;
  border-color: var(--accent, var(--gold));
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(191, 91, 126, 0.12));
}
.card__question-input::placeholder {
  color: var(--ink-dim);
  opacity: 0.75;
}

.form-status {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.form-status.is-error {
  color: var(--cinnabar);
}

/* 输入参考提示 */
.form-hint {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ---------- 账户引导弹窗（免费次数用尽） ---------- */
.account-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.account-modal[hidden] {
  display: none;
}
.account-modal__panel {
  position: relative;
  width: min(92vw, 400px);
  padding: 32px 30px 28px;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
}
.account-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.account-modal__close:hover {
  color: var(--ink);
  background: rgba(35, 35, 35, 0.08);
}
.account-modal__eyebrow {
  font-family: "Cinzel", var(--serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.account-modal__title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.account-modal__body {
  margin: 14px 0 22px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.account-modal__btn {
  height: 40px;
  padding: 0 26px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s ease;
}
.account-modal__btn:hover {
  background: var(--cinnabar);
}
.account-modal__btn--ghost {
  margin-top: 10px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(35, 35, 35, 0.18);
}
.account-modal__btn--ghost:hover {
  color: var(--ink);
  background: rgba(35, 35, 35, 0.05);
}
.account-modal__btn--buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
  background: var(--cinnabar);
  color: #f7ead2;
  text-decoration: none;
}
.account-modal__btn--buy:hover {
  background: #a43324;
}
.account-modal__body strong {
  color: var(--ink);
  font-weight: 600;
}

/* 账户 · 邮箱魔法链接表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 4px;
  text-align: left;
}
.auth-form__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(35, 35, 35, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.auth-form__input:focus {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(194, 65, 47, 0.14);
}
.auth-form__input:disabled {
  opacity: 0.6;
}
.auth-form__btn {
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.25s ease;
}
.auth-form__btn:hover {
  background: var(--cinnabar);
}
.auth-form__btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-form__status {
  min-height: 16px;
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--cinnabar);
}
.auth-form__hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(35, 35, 35, 0.55);
}

/* ============================================================
   彩蛋 · 文曲星：白描小品 coverflow
   深色底 + 中国诗笺卡（竖排朱丝栏 + 衬线英文）
   ============================================================ */

.ink-section {
  position: relative;
  z-index: 3;
  overflow: hidden;
  padding: 74px clamp(16px, 4vw, 48px) 96px;
}
.ink-divider {
  position: relative;
  width: min(720px, 72%);
  height: 1px;
  margin: 0 auto 66px;
  background: linear-gradient(90deg, transparent, rgba(201, 161, 95, 0.55), transparent);
}
.ink-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold);
}
.ink-head {
  margin-bottom: 54px;
  text-align: center;
}
.ink-head__eyebrow {
  margin: 0;
  font-family: "Cinzel", var(--serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  line-height: 1.6;
  text-wrap: balance;
}
.ink-head__title {
  margin: 14px 0 0;
  font-family: "Epilogue", var(--sans);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: -0.02em;
  color: var(--paper);
  text-wrap: balance;
}

.ink-stage {
  position: relative;
  max-width: 1080px;
  height: 470px;
  margin: 0 auto;
  perspective: 1500px;
  outline: none;
}
.ink-carousel {
  position: absolute;
  inset: 0;
}
.ink-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 360px;
  height: 480px;
  margin: -240px 0 0 -180px;
  box-sizing: border-box;
  padding: 32px 32px 28px;
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.5s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
}
.ink-card__zh {
  flex: 1 1 auto;
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: pre-wrap;
  overflow: hidden;
}
.ink-card__en {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(35, 35, 35, 0.12);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  overflow: hidden;
}
.ink-card__no {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(35, 35, 35, 0.35);
}

.ink-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(245, 242, 234, 0.28);
  border-radius: 50%;
  background: rgba(245, 242, 234, 0.05);
  color: var(--paper);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.ink-arrow:hover {
  background: rgba(245, 242, 234, 0.16);
}
.ink-arrow--prev {
  left: max(6px, calc(50% - 430px));
}
.ink-arrow--next {
  right: max(6px, calc(50% - 430px));
}
.ink-arrow:active {
  transform: translateY(-50%) scale(0.94);
}

@media (max-width: 720px) {
  .ink-stage {
    height: 420px;
  }
  .ink-card {
    width: 310px;
    height: 430px;
    margin: -215px 0 0 -155px;
    padding: 26px 26px 22px;
  }
  .ink-arrow {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  .ink-arrow--prev {
    left: 0;
  }
  .ink-arrow--next {
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ink-card {
    transition: none;
  }
}

/* 文章入口 */
.site-guides {
  position: relative;
  z-index: 3;
  padding: 8px 20px 56px;
  text-align: center;
}
.site-guides a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, 0.5);
  text-decoration: none;
  padding: 8px 0;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
  transition: background-size 0.3s var(--ease), color 0.3s ease;
}
.site-guides a:hover {
  color: var(--paper);
  background-size: 100% 1px;
}

/* 移动端：生肖舞台高度与圆角 */
@media (max-width: 960px) {
  .card__visual.card__visual--zodiac {
    padding: 0;
    height: min(46vh, 420px);
  }
  .zodiac-grid {
    gap: 6px;
    padding: 8px;
  }
  .zodiac-tile {
    border-radius: 11px;
  }
  .zodiac-tile__name {
    font-size: 10px;
    padding-top: 10px;
  }
  .zodiac-showcase {
    left: 10px;
    right: 10px;
    bottom: 9px;
    padding: 10px 12px 9px;
    border-radius: 13px;
  }
  .zodiac-showcase__char {
    font-size: 24px;
  }
  .zodiac-showcase__desc {
    font-size: 12px;
    line-height: 1.55;
  }
  .zodiac-showcase__back {
    margin-top: 8px;
    font-size: 9px;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
  }
  .card__grid {
    grid-template-columns: 1fr;
  }
  .card__visual {
    height: auto;
    padding: 0 26px 26px;
  }
  .card__visual img {
    height: min(46vh, 420px);
  }
  .card__visual--frame {
    padding: 0;
  }
  .visual-frame {
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    height: min(46vh, 420px);
  }
  .card__visual--liuren {
    padding: 0;
    height: min(46vh, 420px);
  }
  .topbar {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .topbar__nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1240px) {
  .topbar__tagline {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .page {
    padding: 158px 16px 30px;
  }
  .card__copy {
    padding: 34px 24px 30px;
  }
  .card__title {
    font-size: clamp(30px, 8.6vw, 40px);
  }
  .card__desc {
    font-size: 15px;
  }
  .card__form {
    gap: 9px;
    margin-top: 26px;
  }
  .field {
    min-width: 44px;
    gap: 6px;
  }
  .field--year {
    min-width: 52px;
  }
  .field--time {
    min-width: 56px;
  }
  .field--gender {
    min-width: 68px;
  }
  #page-bazi .card__form {
    flex-wrap: wrap;
  }
  .field__input {
    height: 38px;
    padding: 0 8px;
    font-size: 14px;
  }
  .card__go {
    height: 38px;
    padding: 0 16px;
    font-size: 12px;
    gap: 6px;
  }
  .card__go .go__long {
    display: none;
  }
  .card__go .go__short {
    display: inline;
  }
  .card__question-input {
    min-height: 42px;
    font-size: 14px;
    padding: 8px 12px;
  }
  .card__visual img {
    height: 46vh;
  }
  .nav-item {
    font-size: 14px;
    padding: 8px 12px;
  }
  .nav-item i {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page.is-active {
    animation: none;
  }
  .orb-stage__ring,
  .orb-stage__copy--bottom i {
    animation: none;
  }
  .preloader {
    display: none;
  }
}
