/* 五行查询 — 对照设计稿：放大版面、浅色圆角框、标题白字、上框大下框小、金线结果区 */

:root {
  /* 整页星空（与用户最新稿一致） */
  /* 矢量星空：黑蓝底 + 雾化银河 + 多色星点 */
  --pad-sky-bg: url("assets/pad-sky-hd.svg");
  --font-hei: "SimHei", "黑体", "Microsoft YaHei", "PingFang SC", sans-serif;
  --frame-border: rgba(255, 255, 255, 0.42);
  --gold-line: rgba(218, 180, 80, 0.85);
  --gold-line-soft: rgba(218, 180, 80, 0.55);
  /* 与标题下横线完全一致（中亮、两侧淡出） */
  --gold-divider-line: linear-gradient(
    90deg,
    transparent,
    var(--gold-line-soft) 12%,
    var(--gold-line) 50%,
    var(--gold-line-soft) 88%,
    transparent
  );
  /* 稿：输入框黑底；描边与标题下/结果区金分割线同色 */
  --field-bg: rgba(0, 0, 0, 0.62);
  --field-border: var(--gold-line);
  --field-text: rgba(255, 245, 220, 0.98);
  --field-placeholder: rgba(240, 220, 175, 0.88);
  /* 排盘干支：天干地支五行色（与五行球意象一致） */
  --wx-text-mu: #5ad18a;
  --wx-text-huo: #ff7a66;
  --wx-text-tu: #e0b555;
  --wx-text-jin: #f2e6a2;
  --wx-text-shui: #6ec0ff;
  /* 最外一圈大框：偏金、略深，比浅白线更醒目 */
  --outer-shell-border: rgba(200, 165, 85, 0.82);
  --outer-shell-shadow: 0 0 0 1px rgba(0, 0, 0, 0.42), 0 8px 32px rgba(0, 0, 0, 0.28);
  /* 五行图：5s 快转 → 10s 减速慢转 → 5s 再加速，整圈 20s 循环 */
  --wu-xing-spin-duration: 20s;
  /* 五球直径；「开始查询」按钮约为其 2.65 倍宽（英文一行） */
  --wu-xing-orb-diameter: clamp(3.1rem, 17vw, 5rem);
}

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

html {
  font-size: 108%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.wuXingPbody {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Pad 竖屏：与背景图圆角留白一致 */
  padding: clamp(1.1rem, 3.5vmin, 2.5rem) clamp(1.1rem, 4.5vw, 2.75rem) 1.75rem;
  padding-left: max(1.1rem, env(safe-area-inset-left));
  padding-right: max(1.1rem, env(safe-area-inset-right));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  font-family: var(--font-hei);
  font-weight: 400;
  color: #f5f5f5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.wuXingPbg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #060a18;
  background-image: var(--pad-sky-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* 不叠黑罩，整页即星空图 */
.wuXingPbg::after {
  display: none;
}

/* 单列：主内容框（内含联名 logo） */
.wuXingPstack {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(34rem, 92vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 主内容区：最外大框 — 加高以容纳底部 logo */
.wuXingPshell {
  position: relative;
  width: 100%;
  min-height: clamp(30rem, 76vh, 52rem);
  display: flex;
  flex-direction: column;
  padding: clamp(1.35rem, 3vmin, 1.9rem) clamp(1.15rem, 2.8vw, 1.65rem)
    clamp(1.45rem, 3.2vmin, 2.1rem);
  border: 1.5px solid var(--outer-shell-border);
  border-radius: 22px;
  background: transparent;
  box-shadow: var(--outer-shell-shadow);
  box-sizing: border-box;
}

.wuXingPheaderProw {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.15rem;
}

.wuXingPexit {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.06rem;
  margin: 0;
  padding: 0.15rem 0.2rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wuXingPexitPzh {
  line-height: 1.15;
}

.wuXingPexitPen {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.38);
}

.wuXingPexit:hover {
  color: rgba(255, 255, 255, 0.88);
}

.wuXingPexit:hover .wuXingPexitPen {
  color: rgba(255, 255, 255, 0.62);
}

/* 稿：主标题与隔断金线同色；长标题略收紧字距 */
.wuXingPtitle {
  margin: 0 0 0.55rem;
  padding: 0 0.35rem;
  text-align: center;
  font-family: var(--font-hei);
  font-weight: 700;
  line-height: 1.35;
  color: var(--gold-line);
}

.wuXingPtitlePmain {
  display: block;
  font-size: clamp(1.72rem, 5.2vw, 2.22rem);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 16px rgba(218, 180, 80, 0.35);
}

.wuXingPtitlePcredit {
  display: block;
  margin-top: 0.28rem;
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 230, 170, 0.78);
  text-shadow: none;
}

/* 稿：标题下细金线 */
.wuXingPtitlePdivider {
  height: 1px;
  margin: 0 auto 0.65rem;
  max-width: 88%;
  background: var(--gold-divider-line);
}

/* 表单项紧挨「开始查询」上方 */
.wuXingPform {
  margin-top: 0;
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wuXingPfieldPwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 0.55rem;
}

.wuXingPfieldPwrapPplace {
  margin-bottom: 0.5rem;
}

.wuXingPfieldPwrapPgender {
  margin-bottom: 0.55rem;
}

.wuXingPgender {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  align-items: stretch;
  width: min(34vw, 11.25rem);
  max-width: 78%;
  margin-left: auto;
  margin-right: auto;
}

.wuXingPgenderPbtn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.48rem 0.35rem 0.42rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-family: var(--font-hei);
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s,
    color 0.18s;
}

/* 未选中：略暗于选中，字用中灰偏亮，避免发黑 */
.wuXingPgenderPbtn:not(.isPselected) {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.wuXingPgenderPbtn:not(.isPselected) .wuXingPgenderPzh {
  color: rgba(168, 162, 152, 0.95);
  font-weight: 500;
  text-shadow: none;
}

.wuXingPgenderPbtn:not(.isPselected) .wuXingPgenderPen {
  color: rgba(130, 124, 114, 0.88);
}

/* 选中：金边 + 字亮 */
.wuXingPgenderPbtn.isPselected {
  border-color: rgba(240, 210, 130, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 230, 180, 0.45),
    0 0 18px rgba(218, 180, 80, 0.22);
  background: rgba(48, 42, 28, 0.78);
}

.wuXingPgenderPzh {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  transition: color 0.18s, text-shadow 0.18s, font-weight 0.18s;
}

.wuXingPgenderPbtn.isPselected .wuXingPgenderPzh {
  color: #fff8ec;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255, 220, 160, 0.45);
}

.wuXingPgenderPen {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.52rem, 1.5vw, 0.62rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  transition: color 0.18s;
}

.wuXingPgenderPbtn.isPselected .wuXingPgenderPen {
  color: rgba(255, 236, 200, 0.95);
}

/* 表单项下英文小字 */
.wuXingPfieldPen {
  display: block;
  margin-top: 0.28rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: min(34vw, 11.25rem);
  text-align: center;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.62rem, 1.85vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(230, 220, 200, 0.55);
  line-height: 1.35;
}

.wuXingPsrOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 公共：黑底、金描边（与分割线同色）、亮字 */
.wuXingPfield {
  width: 100%;
  font-family: var(--font-hei);
  font-weight: 500;
  border-radius: 9px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);
  outline: none;
}

/* 稿：出生日期、出生地同宽居中，非通栏 */
.wuXingPfieldPwrapPdate .wuXingPfieldPdate,
.wuXingPfieldPwrapPplace .wuXingPlocationPwrap {
  width: min(34vw, 11.25rem);
  max-width: 78%;
  margin-left: auto;
  margin-right: auto;
}

.wuXingPfieldPwrapPdate .wuXingPfieldPdate {
  text-align: center;
}

.wuXingPfield::placeholder {
  color: var(--field-placeholder);
}

.wuXingPfield:focus {
  border-color: rgba(240, 210, 130, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 230, 180, 0.45);
}

/* 稿：出生日期、出生地同高同字号 */
.wuXingPfieldPdate,
.wuXingPfieldPplace {
  padding: 0.62rem 0.78rem;
  font-size: 0.98rem;
  min-height: 46px;
  line-height: 1.35;
}

.wuXingPfieldPplace {
  text-align: center;
}

/* 出生：点击弹出层，勿用手输 */
.wuXingPbirthTrigger,
.wuXingPplaceTrigger {
  cursor: pointer;
  caret-color: transparent;
}

.wuXingPplaceTrigger {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.wuXingPlocationPwrap {
  position: relative;
  width: 100%;
}

.wuXingPlocationPdropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.3rem;
  max-height: min(14rem, 42vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #000;
  border: 1px solid rgba(232, 197, 71, 0.65);
  border-radius: 10px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 1) inset;
  z-index: 150;
}

.wuXingPlocationPdropdown[hidden] {
  display: none !important;
}

.wuXingPlocationPdropdown:not([hidden]) {
  display: block;
}

.wuXingPlocationPitem {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  font: inherit;
  font-family: var(--font-hei);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  color: rgba(255, 230, 170, 0.96);
  letter-spacing: 0.04em;
}

.wuXingPlocationPitem:hover,
.wuXingPlocationPitem:focus {
  background: rgba(232, 197, 71, 0.16);
  color: #fff6d4;
  outline: none;
}

#wuXingPlaceWrap.isPinvalid .wuXingPfieldPplace {
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}

#wuXingPlaceWrap.isPconfirmed .wuXingPfieldPplace {
  border-color: rgba(110, 231, 183, 0.75);
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.35);
}

.wuXingPlocationPhint {
  margin: 0.35rem 0 0;
  padding: 0 0.15rem;
  font-family: var(--font-hei);
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: rgba(252, 211, 77, 0.88);
  text-align: left;
}

.wuXingPlocationPhint[hidden] {
  display: none !important;
}

.wuXingPlocationPpickNotice {
  color: rgba(134, 239, 172, 0.95) !important;
  font-weight: 600;
}

.wuXingPlocationPitem {
  font-weight: 500;
}

/* 居中提示：与整页金深色一致，由 wuXingShowToast 控制，默认约 1.5s 消失 */
.wuXingPtoastProot {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.wuXingPtoastProot[hidden] {
  display: none !important;
}

.wuXingPtoastPbackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.wuXingPtoastPsheet {
  position: relative;
  z-index: 1;
  width: min(88vw, 18.5rem);
  margin: 0 auto;
  padding: 1.1rem 1.35rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(218, 180, 80, 0.42);
  background: linear-gradient(165deg, rgba(34, 30, 24, 0.98), rgba(10, 9, 8, 0.99));
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 230, 180, 0.08) inset,
    0 0 28px rgba(218, 180, 80, 0.12);
  animation: wuXingPtoastPop 0.22s ease-out;
}

@keyframes wuXingPtoastPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wuXingPtoastPtext {
  margin: 0;
  font-family: var(--font-hei);
  font-size: clamp(0.88rem, 2.4vw, 0.98rem);
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: rgba(255, 248, 235, 0.96);
  text-align: center;
}

body.wuXingPtoastOpen {
  overflow: hidden;
}

/* 出生时间弹层 */
.wuXingPmodal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.wuXingPmodal[hidden] {
  display: none !important;
}

/* 命理报告弹窗（叠在出生时间弹窗之上） */
.wuXingPmodal--report {
  z-index: 420;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* AI 计算 Loading（查询过程，约 3 秒） */
.wuXingPmodal--aiLoading {
  z-index: 435;
}

.wuXingPmodalPsheet--aiLoading {
  width: min(22rem, 92vw);
  max-width: 22rem;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 130, 0.35);
  background: linear-gradient(165deg, rgba(18, 28, 42, 0.97) 0%, rgba(8, 14, 24, 0.98) 100%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
}

.wuXingPaiLoadingPtitle {
  margin: 0 0 0.85rem;
  text-align: center;
  font-family: var(--font-hei);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

.wuXingPaiLoadingPtitlePmain {
  display: block;
  font-size: clamp(0.98rem, 3.2vw, 1.12rem);
  color: rgba(255, 248, 230, 0.96);
}

.wuXingPaiLoadingPcredit {
  display: block;
  margin-top: 0.2rem;
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  font-weight: 500;
  color: rgba(255, 230, 170, 0.72);
  letter-spacing: 0.06em;
}

.wuXingPaiLoadingPprogress {
  margin-bottom: 1rem;
}

.wuXingPaiLoadingPprogressPtrack {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.wuXingPaiLoadingPprogressPbar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399 0%, #6ee7b7 45%, #a7f3d0 100%);
  box-shadow: 0 0 10px rgba(110, 231, 183, 0.55);
  transition: width 0.08s linear;
}

.wuXingPaiLoadingPsteps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.72rem;
}

.wuXingPaiLoadingPstep {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-align: left;
}

.wuXingPaiLoadingPdot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.38rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.wuXingPaiLoadingPlabel {
  flex: 1;
  font-family: var(--font-hei);
  font-size: clamp(0.82rem, 2.5vw, 0.92rem);
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.wuXingPaiLoadingPstep.isPdone .wuXingPaiLoadingPdot,
.wuXingPaiLoadingPstep.isPactive .wuXingPaiLoadingPdot {
  background: #6ee7b7;
  box-shadow:
    0 0 0 2px rgba(110, 231, 183, 0.35),
    0 0 12px rgba(52, 211, 153, 0.65);
}

.wuXingPaiLoadingPstep.isPactive .wuXingPaiLoadingPdot {
  transform: scale(1.15);
}

.wuXingPaiLoadingPstep.isPdone .wuXingPaiLoadingPlabel,
.wuXingPaiLoadingPstep.isPactive .wuXingPaiLoadingPlabel {
  color: #86efac;
  text-shadow: 0 0 14px rgba(134, 239, 172, 0.25);
}

.wuXingPaiLoadingPstep.isPactive .wuXingPaiLoadingPlabel {
  color: #a7f3d0;
  font-weight: 600;
}

/* 先出命理报告：排盘区占位隐藏，卡片高度与展开后一致 */
.wuXingPmodal--reportFirst #reportMeta,
.wuXingPmodal--reportFirst #reportPaipanTitle,
.wuXingPmodal--reportFirst .wuXingPpaipan {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.wuXingPreportPmeta {
  margin: 0 0 0.75rem;
  padding: 0 0.15rem;
  font-family: var(--font-hei);
  font-size: clamp(0.78rem, 2.1vw, 0.9rem);
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: rgba(255, 245, 220, 0.72);
  text-align: left;
}

.wuXingPpaipanPsectionTitle {
  margin: 0 0 0.5rem;
  text-align: center;
  font-family: var(--font-hei);
  font-size: clamp(0.92rem, 2.8vw, 1.12rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 200, 120, 0.95);
}

.wuXingPmodal--reportExpanded #reportMeta,
.wuXingPmodal--reportExpanded #reportPaipanTitle,
.wuXingPmodal--reportExpanded .wuXingPpaipan {
  animation: wuXingPreportReveal 0.45s ease-out both;
}

@keyframes wuXingPreportReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* 出生日期前置：黄底卡片 + 内嵌深色条、高对比亮绿字（易读） */
.wuXingPmodal--birthDisclaimer {
  z-index: 410;
}

.wuXingPmodal--place {
  z-index: 405;
}

.wuXingPmodalPsheet--place {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(88dvh, calc(100vh - 1rem));
}

.wuXingPplaceModalHint {
  margin: -0.35rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 230, 180, 0.82);
  letter-spacing: 0.04em;
}

.wuXingPplaceModalSearch {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(240, 210, 130, 0.55);
  background: rgba(0, 0, 0, 0.42);
  color: #fff8ec;
  font-family: var(--font-hei);
  font-size: 1rem;
  outline: none;
}

.wuXingPplaceModalSearch:focus {
  border-color: rgba(240, 210, 130, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 230, 180, 0.45);
}

.wuXingPplaceModalSearch::placeholder {
  color: rgba(240, 220, 175, 0.72);
}

.wuXingPlocationPmodalList {
  flex: 1 1 auto;
  min-height: 10rem;
  max-height: min(52dvh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid rgba(232, 197, 71, 0.55);
  border-radius: 10px;
  background: #000;
}

.wuXingPlocationPmodalList .wuXingPlocationPitem {
  min-height: 46px;
  padding: 0.72rem 0.85rem;
  font-size: 0.92rem;
  text-align: left;
}

.wuXingPmodalPactions--place {
  margin-top: 0.15rem;
}

.wuXingPmodalPsheet--birthDisclaimer {
  max-width: min(22rem, 92vw);
  padding: 1.25rem 1.1rem 1.1rem;
  border-radius: 16px;
  border: 2px solid rgba(180, 120, 0, 0.65);
  background: linear-gradient(165deg, #fff3a8 0%, #ffd54a 48%, #f0c040 100%);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color-scheme: light;
}

.wuXingPbirthDisclaimerPtext {
  margin: 0 0 1.05rem;
  padding: 1rem 0.85rem;
  text-align: center;
  font-family: var(--font-hei);
  font-size: clamp(1.08rem, 3.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.65;
  letter-spacing: 0.04em;
  color: #ecfdf5;
  background: linear-gradient(180deg, rgba(12, 52, 32, 0.96), rgba(5, 32, 20, 0.98));
  border-radius: 12px;
  border: 2px solid rgba(110, 231, 183, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 14px rgba(0, 0, 0, 0.35);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.85),
    0 0 20px rgba(134, 239, 172, 0.25);
}

.wuXingPmodalPactions--birthDisclaimer {
  padding-top: 0.25rem;
}

.wuXingPmodalPbtn--disclaimerGhost {
  color: #3d2808;
  border-color: rgba(120, 80, 0, 0.45);
  background: rgba(255, 255, 255, 0.35);
}

.wuXingPmodalPbtn--disclaimerGhost:hover {
  background: rgba(255, 255, 255, 0.52);
}

.wuXingPmodalPsheet--birthDisclaimer .wuXingPmodalPbtn--ghost .wuXingPmodalPbtnPen {
  color: rgba(55, 40, 12, 0.72);
}

/* 弹窗内：四柱 + 大运流年（即时展示，非打字机） */
.wuXingPpaipan {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(218, 180, 80, 0.35);
  background: rgba(0, 0, 0, 0.42);
  font-family: var(--font-hei);
  font-size: clamp(0.86rem, 2.4vw, 1rem);
  line-height: 1.45;
  color: rgba(255, 248, 230, 0.94);
  text-align: left;
}

.wuXingPpaipanPmeta {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: rgba(230, 210, 170, 0.75);
}

.wuXingPpaipanPgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
  text-align: center;
}

/* 四柱 + 当前大运 + 流年：单行六格，窄屏省高 */
.wuXingPpaipanPgrid--six {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.36rem;
  margin-bottom: 0.5rem;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPcell {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.42rem 0.14rem 0.38rem;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPlabel {
  font-size: 0.76rem;
  margin-bottom: 0.16rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPstem,
.wuXingPpaipanPgrid--six .wuXingPpaipanPbranch {
  font-size: clamp(0.88rem, 3.8vw, 1.12rem);
  letter-spacing: 0.08em;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPpillar--compact .wuXingPpaipanPstem,
.wuXingPpaipanPgrid--six .wuXingPpaipanPpillar--compact .wuXingPpaipanPbranch {
  font-size: clamp(0.85rem, 3.6vw, 1.08rem);
  letter-spacing: 0.07em;
}

.wuXingPpaipanPyhint {
  display: block;
  margin-top: 0.14rem;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: rgba(220, 195, 150, 0.62);
}

.wuXingPpaipanPdash {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(200, 180, 150, 0.35);
}

.wuXingPpaipanPcell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.25rem 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(218, 180, 80, 0.2);
}

.wuXingPpaipanPlabel {
  display: block;
  font-size: 0.68rem;
  color: rgba(230, 200, 140, 0.65);
  margin-bottom: 0.28rem;
  letter-spacing: 0.12em;
}

/* 干支：天干上、地支下；带十神时：干上/支上各一行小字 */
.wuXingPpaipanPpillar {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
}

.wuXingPpaipanPpillar--withSs {
  gap: 0.08em;
}

.wuXingPpaipanPss {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.12;
  color: rgba(235, 210, 165, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.wuXingPpaipanPss--gan {
  margin-bottom: 0.02em;
}

/* 地支下：藏干本/中/余 十神上下三行（勿横排、勿截断） */
.wuXingPpaipanPzhiSsRow {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.1em;
  width: 100%;
  margin-top: 0.12em;
  box-sizing: border-box;
}

.wuXingPpaipanPzhiSsRow .wuXingPpaipanPss--zhi {
  margin-top: 0;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
  word-break: keep-all;
}

.wuXingPpaipanPss--zhi.wuXingPpaipanPss--empty {
  color: rgba(200, 180, 150, 0.28);
  font-weight: 500;
}

/* 仅天干十神在窄格里允许压缩；地支三神纵向完整显示 */
.wuXingPpaipanPgrid--six .wuXingPpaipanPss--gan {
  font-size: 0.6rem;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPzhiSsRow {
  gap: 0.08em;
}

.wuXingPpaipanPgrid--six .wuXingPpaipanPzhiSsRow .wuXingPpaipanPss--zhi {
  font-size: 0.58rem;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  max-width: none;
}

.wuXingPpaipanPstem,
.wuXingPpaipanPbranch {
  display: block;
  font-size: clamp(0.95rem, 2.6vw, 1.12rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.05;
  color: rgba(210, 200, 175, 0.82);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

/* 排盘：干支五行色（甲乙木 丙丁火 戊己土 庚辛金 壬癸水；地支本气五行） */
.wuXingPpaipanPstem.wuXingPpaipanPel--mu,
.wuXingPpaipanPbranch.wuXingPpaipanPel--mu {
  color: var(--wx-text-mu);
  text-shadow: 0 0 14px rgba(90, 209, 138, 0.4);
}

.wuXingPpaipanPstem.wuXingPpaipanPel--huo,
.wuXingPpaipanPbranch.wuXingPpaipanPel--huo {
  color: var(--wx-text-huo);
  text-shadow: 0 0 14px rgba(255, 122, 102, 0.38);
}

.wuXingPpaipanPstem.wuXingPpaipanPel--tu,
.wuXingPpaipanPbranch.wuXingPpaipanPel--tu {
  color: var(--wx-text-tu);
  text-shadow: 0 0 12px rgba(224, 181, 85, 0.35);
}

.wuXingPpaipanPstem.wuXingPpaipanPel--jin,
.wuXingPpaipanPbranch.wuXingPpaipanPel--jin {
  color: var(--wx-text-jin);
  text-shadow: 0 0 12px rgba(242, 230, 162, 0.3);
}

.wuXingPpaipanPstem.wuXingPpaipanPel--shui,
.wuXingPpaipanPbranch.wuXingPpaipanPel--shui {
  color: var(--wx-text-shui);
  text-shadow: 0 0 14px rgba(110, 192, 255, 0.38);
}

.wuXingPpaipanPpillar--compact .wuXingPpaipanPstem,
.wuXingPpaipanPpillar--compact .wuXingPpaipanPbranch {
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  letter-spacing: 0.1em;
}

.wuXingPpaipanPluck {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 235, 200, 0.8);
}

.wuXingPpaipanPluckRow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  justify-content: flex-start;
  margin-bottom: 0.45rem;
}

.wuXingPpaipanPstep {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(218, 180, 80, 0.12);
  border: 1px solid rgba(218, 180, 80, 0.22);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.wuXingPpaipanPnote {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  line-height: 1.55;
  color: rgba(220, 200, 160, 0.58);
}

@media (max-width: 360px) {
  .wuXingPpaipanPgrid:not(.wuXingPpaipanPgrid--six) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wuXingPreportPsubtitle {
  margin: 0 0 0.5rem;
  text-align: center;
  font-family: var(--font-hei);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 245, 220, 0.72);
}

/* 命理报告正文：可视约 200 字（11.2 行），左对齐 */
.wuXingPreportPbody {
  --report-body-lines: 11.2;
  box-sizing: border-box;
  height: calc(var(--report-body-lines) * 1.65em + 1.1rem);
  max-height: calc(var(--report-body-lines) * 1.65em + 1.1rem);
  overflow-y: auto;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(218, 180, 80, 0.28);
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-hei);
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  line-height: 1.65;
  letter-spacing: 0.04em;
  color: rgba(255, 250, 235, 0.92);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-overflow-scrolling: touch;
}

.wuXingPreportPactions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.wuXingPreportPyongshen:disabled,
.wuXingPreportPyongshen.wuXingPreportPyongshen--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 查询用神后可选停转；用神珠高亮 / 非用神置灰见 .wuXingPorbPin--muted */
.wuXingPdiagram--frozen {
  cursor: default;
  pointer-events: none;
}

.wuXingPdiagram--frozen .wuXingPdiagramProtate {
  animation-play-state: paused !important;
}

.wuXingPdiagram--frozen .wuXingPdiagram:not(.wuXingPdiagram--interactive) .wuXingPorbPupright {
  animation-play-state: paused !important;
}

.wuXingPdiagram--frozen .wuXingPorbPspin {
  animation-play-state: paused !important;
}

.wuXingPorbPin--yongshen .wuXingPorb {
  filter: drop-shadow(0 0 14px rgba(255, 215, 130, 0.95))
    drop-shadow(0 0 26px rgba(255, 190, 80, 0.45));
  transform: scale(1.08);
}

/* 用神：未入选的五行球置灰，仅保留用神球彩色 */
.wuXingPorbPin--muted .wuXingPorb {
  filter: grayscale(1) brightness(0.68) contrast(0.92);
  opacity: 0.48;
  transform: scale(0.94);
}

.wuXingPorbPin--muted .wuXingPorbPspin {
  opacity: 0.12;
  animation-play-state: paused;
}

body.wuXingPmodalOpen {
  overflow: hidden;
}

body.wuXingPmodalOpen:not(.wuXingPmodalOpen--place) {
  touch-action: none;
}

.wuXingPmodal--place {
  touch-action: auto;
}

.wuXingPmodalPsheet--place,
.wuXingPmodalPsheet--place .wuXingPplaceModalSearch,
.wuXingPlocationPmodalList,
.wuXingPlocationPmodalList .wuXingPlocationPitem {
  touch-action: manipulation;
}

.wuXingPlocationPmodalList {
  touch-action: pan-y;
}

.wuXingPmodalPbackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}

.wuXingPmodalPsheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(38rem, 96vw);
  padding: 1.45rem 1.35rem 1.35rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  margin: 0 auto;
  box-sizing: border-box;
  /* 下拉列表用暗色主题，避免系统白底 + 白字不可见 */
  color-scheme: dark;
}

/* 命理报告：居中浮层，整卡可滚 */
.wuXingPmodalPsheet--report {
  width: min(34rem, 88vw);
  max-width: min(34rem, 88vw);
  margin: auto;
  max-height: min(92dvh, calc(100vh - 1.5rem));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.05rem 0.95rem 1rem;
}

/* 打字机阶段：与展开后同高（排盘区占位 + 最小高度） */
.wuXingPmodal--report.wuXingPmodal--reportFirst .wuXingPmodalPsheet--report {
  min-height: min(78dvh, 36rem);
}

.wuXingPmodalPsheet--report > .wuXingPmodalPtitle {
  margin-bottom: 0.55rem;
  font-size: clamp(0.92rem, 2.8vw, 1.2rem);
}

.wuXingPmodalPtitle {
  margin: 0 0 1.1rem;
  text-align: center;
  font-family: var(--font-hei);
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
}

/* 出生地建议列表顶部说明：与下拉同黑底黄字 */
.wuXingPlocationPdataNotice {
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-family: var(--font-hei);
  font-size: 0.68rem;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-align: center;
  color: rgba(255, 220, 150, 0.92);
  border-bottom: 1px solid rgba(232, 197, 71, 0.35);
  background: #000;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 年月日时分：整体居中；窄屏三列、宽屏五列一行 */
.wuXingPmodalPgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(6.25rem, 1fr));
  justify-content: center;
  justify-items: center;
  gap: 0.95rem 0.85rem;
  width: 100%;
  max-width: min(34rem, 100%);
  margin: 0 auto 1.25rem;
}

@media (min-width: 640px) {
  .wuXingPmodalPgrid {
    grid-template-columns: repeat(5, minmax(5.75rem, 1fr));
    max-width: min(36rem, 100%);
    gap: 1rem 0.75rem;
  }
}

.wuXingPmodalPlabel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 9rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.wuXingPmodalPlabel span {
  letter-spacing: 0.12em;
  font-weight: 600;
}

.wuXingPmodalPselect {
  width: 100%;
  min-height: 50px;
  padding: 0.55rem 0.45rem;
  font-family: var(--font-hei);
  font-size: clamp(0.95rem, 2.4vw, 1.08rem);
  color: #ffffff;
  text-align: center;
  text-align-last: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background-color: rgba(55, 55, 62, 0.95);
  outline: none;
  box-sizing: border-box;
  color-scheme: dark;
  cursor: pointer;
}

.wuXingPmodalPselect:focus {
  border-color: rgba(240, 210, 130, 0.75);
  box-shadow: 0 0 0 1px rgba(240, 210, 130, 0.25);
}

/* 展开列表：灰底白字（浏览器对 option 支持程度不一，与 color-scheme 配合） */
.wuXingPmodalPselect option {
  background-color: #45454e;
  color: #ffffff;
}

.wuXingPmodalPselect option:checked {
  background-color: #5a5a66;
  color: #ffffff;
}

.wuXingPmodalPactions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.wuXingPmodalPbtn {
  min-width: 7.5rem;
  min-height: 50px;
  padding: 0 1.35rem;
  border-radius: 12px;
  font-family: var(--font-hei);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.wuXingPmodalPbtn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.wuXingPmodalPbtn--gold {
  color: #1a1508;
  background: linear-gradient(180deg, #f0dfa0, #c9a227);
}

.wuXingPmodalPbtn--stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  min-height: 56px;
}

.wuXingPmodalPbtnPzh {
  line-height: 1.15;
}

.wuXingPmodalPbtnPen {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.wuXingPmodalPbtn--ghost .wuXingPmodalPbtnPen {
  color: rgba(255, 255, 255, 0.52);
}

.wuXingPmodalPbtn--gold .wuXingPmodalPbtnPen {
  color: rgba(26, 21, 8, 0.82);
}

/* 五行图：放大；脚本接管旋转时允许拖拽；长按/拖移减轻叠影、系统菜单 */
.wuXingPdiagram {
  position: relative;
  width: 100%;
  max-width: min(21rem, 78vw);
  aspect-ratio: 1;
  margin: 0.12rem auto 0.72rem;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  container-type: size;
  container-name: wuxing-diagram;
}

.wuXingPdiagram:active {
  cursor: grabbing;
}

.wuXingPdiagram img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* 球尾迹微粒：在连线之上、球图之下 */
.wuXingPtrails {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 查询用神结果：五球中央「用神」+ 英文，叠在旋转球之上；落在五角星内圈 */
.wuXingPdiagramPyongshenLabel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08em;
  width: min(42cqmin, 44%);
  max-width: 44%;
  text-align: center;
  pointer-events: none;
  color: #ffffff;
}

.wuXingPdiagramPyongshenLabelPzh {
  font-family: var(--font-hei);
  font-weight: 700;
  font-size: min(15.2cqmin, clamp(0.95rem, 6.5vw, 2rem));
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1.05;
  text-shadow:
    0 0 18px rgba(0, 0, 0, 0.92),
    0 2px 12px rgba(0, 0, 0, 0.68),
    0 0 36px rgba(240, 210, 120, 0.38);
}

.wuXingPdiagramPyongshenLabelPen {
  display: block;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.48rem, 1.55vw, 0.62rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.88);
  text-indent: 0;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.85), 0 1px 6px rgba(0, 0, 0, 0.55);
}

@supports not (container-type: size) {
  .wuXingPdiagramPyongshenLabel {
    width: 44%;
  }

  .wuXingPdiagramPyongshenLabelPzh {
    font-size: clamp(0.95rem, calc(min(21rem, 78vw) * 0.152), 2rem);
  }
}

#wuXingDiagramYongshenLabel[hidden] {
  display: none !important;
}

/* 用神：各球上方仅「首选」「次选」标注，随 pin 公转；在 upright 内与球图同向抵消旋转，字始终可读 */
.wuXingPorbPyongshenTag {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.14rem);
  z-index: 3;
  transform: translateX(-50%);
  max-width: min(6.5rem, 32vw);
  padding: 0.06rem 0.2rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-hei, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: clamp(0.62rem, 1.85vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: rgba(255, 244, 210, 0.96);
  text-shadow:
    0 0 10px rgba(0, 0, 0, 0.88),
    0 0 18px rgba(218, 180, 80, 0.42);
  pointer-events: none;
}

.wuXingPorbPyongshenTag[hidden] {
  display: none !important;
}

/* JS 驱动时关闭公转与抵消公转的 CSS 动画，由脚本写 upright transform */
.wuXingPdiagram--interactive .wuXingPdiagramProtate,
.wuXingPdiagram--interactive .wuXingPorbPupright {
  animation: none !important;
}

/* 连线 + 五球整体：分段变速逆时针（与下方 keyframes 一致） */
.wuXingPdiagramProtate {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform-origin: 50% 50%;
  animation: wuXingPdiagramSpin var(--wu-xing-spin-duration) infinite;
}

/*
 * 一圈 360°：0–25%≈5s 极快（约 318°）；25–75%≈10s 减速慢转；75–100%≈5s 再加速接下一圈
 */
@keyframes wuXingPdiagramSpin {
  0% {
    transform: rotate(0deg);
    animation-timing-function: linear;
  }
  25% {
    transform: rotate(-318deg);
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  75% {
    transform: rotate(-340deg);
    animation-timing-function: ease-in;
  }
  100% {
    transform: rotate(-360deg);
  }
}

/* 五球顺时针自转：角度与整体严格相抵，字保持正向 */
@keyframes wuXingPorbCounterSpin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    animation-timing-function: linear;
  }
  25% {
    transform: translate(-50%, -50%) rotate(318deg);
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  75% {
    transform: translate(-50%, -50%) rotate(340deg);
    animation-timing-function: ease-in;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wuXingPdiagramProtate {
    animation: none;
  }

  .wuXingPorbPupright {
    animation: none !important;
  }

  .wuXingPorbPspin {
    animation: none !important;
  }

  .wuXingPresultPorbPwrap::after,
  .wuXingPresultPorbPwrap.wuXingPresultPorbPshine::after {
    animation: none !important;
  }
}

.wuXingPsvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wuXingPsvg polygon {
  stroke: rgba(240, 210, 120, 0.72) !important;
}

/* 顶点占位：宽高为 0，球在中心对齐 */
.wuXingPorbPin {
  position: absolute;
  width: 0;
  height: 0;
}

.wuXingPorbPin.wuXingPorbPmu {
  left: 50%;
  top: 9%;
}
.wuXingPorbPin.wuXingPorbPhuo {
  left: 84%;
  top: 36%;
}
.wuXingPorbPin.wuXingPorbPtu {
  left: 72%;
  top: 78%;
}
.wuXingPorbPin.wuXingPorbPjin {
  left: 28%;
  top: 78%;
}
.wuXingPorbPin.wuXingPorbPshui {
  left: 16%;
  top: 36%;
}

/* 抵消公转，使球面与字始终正向；自转仅作用在底层高光层 */
.wuXingPorbPupright {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  line-height: 0;
}

.wuXingPdiagram:not(.wuXingPdiagram--interactive) .wuXingPorbPupright {
  animation: wuXingPorbCounterSpin var(--wu-xing-spin-duration) infinite;
}

/* 球体自转感：底层锥形高光缓慢旋转，不带动上层 PNG，字不变 */
.wuXingPorbPspin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: 92%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.07) 38deg,
    transparent 78deg,
    rgba(180, 220, 255, 0.12) 160deg,
    transparent 220deg,
    rgba(255, 255, 255, 0.05) 300deg,
    transparent 360deg
  );
  opacity: 0.75;
  mix-blend-mode: screen;
  animation: wuXingPorbSelfGlow 11s linear infinite;
}

.wuXingPorbPin.wuXingPorbPhuo .wuXingPorbPspin {
  animation-duration: 9.5s;
  animation-direction: reverse;
}

.wuXingPorbPin.wuXingPorbPtu .wuXingPorbPspin {
  animation-duration: 13s;
}

.wuXingPorbPin.wuXingPorbPjin .wuXingPorbPspin {
  animation-duration: 10.5s;
  animation-direction: reverse;
}

.wuXingPorbPin.wuXingPorbPshui .wuXingPorbPspin {
  animation-duration: 12.5s;
}

@keyframes wuXingPorbSelfGlow {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.wuXingPorb {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--wu-xing-orb-diameter);
  height: auto;
  transform: none;
  object-fit: contain;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.45));
}

/* 木（绿）球素材边缘留白略多，略大于其余四球以视觉平衡 */
.wuXingPorbPin.wuXingPorbPmu .wuXingPorb {
  width: calc(var(--wu-xing-orb-diameter) * 1.08);
}

/* 缺五行结果：暂隐保留 DOM，接口就绪后去掉 hidden 并调用 wuXingRevealMissingResult */
#wuXingResult[hidden] {
  display: none !important;
}

/* 稿：上下金线与标题下横线同款渐变（非纯色 border）；结果区不要色块底；「缺」+ 五行球图。
   注意：勿对 .wuXingPresult 使用 flex，否则 ::before/::after 分割线会横排进内容区。 */
.wuXingPresult {
  margin: 0.28rem 0 0.75rem;
  padding: 0 0.65rem;
  font-family: var(--font-hei);
  font-size: clamp(2.22rem, 7.8vw, 2.925rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: normal;
  border: none;
  background: transparent;
  text-align: center;
}

.wuXingPresultPinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.12em 0.22em;
}

.wuXingPresult::before,
.wuXingPresult::after {
  content: "";
  display: block;
  height: 1px;
  max-width: 88%;
  margin-left: auto;
  margin-right: auto;
  background: var(--gold-divider-line);
}

.wuXingPresult::before {
  margin-bottom: 1.28rem;
}

.wuXingPresult::after {
  margin-top: 1.28rem;
}

/* 用神行：略小字号与球径，避免与上方五球图「叠成同一坨」；上下金线略收紧 */
.wuXingPresult--yongshen {
  font-size: clamp(1.55rem, 5.2vw, 2.05rem);
  margin: 0.18rem 0 0.52rem;
}

.wuXingPresult--yongshen::before {
  margin-bottom: 0.72rem;
}

.wuXingPresult--yongshen::after {
  margin-top: 0.72rem;
}

.wuXingPresult--yongshen .wuXingPresultPorb {
  width: calc(1.05 * var(--wu-xing-orb-diameter));
  max-width: 100%;
}

.wuXingPresult--yongshen .wuXingPresultPorb.wuXingPresultPorbPmu {
  width: calc(1.05 * var(--wu-xing-orb-diameter) * 1.1);
}

.wuXingPque {
  color: #ffffff;
  letter-spacing: 0.2em;
}

.wuXingPresultPorbs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22em;
  line-height: 0;
}

/* 结果球 = 转动五行球直径的 1.5 倍（随 --wu-xing-orb-diameter 与平板断点联动） */
.wuXingPresultPorbPwrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 50%;
  overflow: hidden;
}

.wuXingPresultPorb {
  display: block;
  width: calc(1.5 * var(--wu-xing-orb-diameter));
  max-width: 100%;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

/* 木球素材边缘留白略多，略放大后与火球视觉直径一致 */
.wuXingPresultPorb.wuXingPresultPorbPmu {
  width: calc(1.5 * var(--wu-xing-orb-diameter) * 1.1);
}

/* 高光：由 JS 轮流加 .wuXingPresultPorbPshine，间隔随机，不同时闪 */
.wuXingPresultPorbPwrap::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -70%;
  z-index: 1;
  width: 58%;
  height: 140%;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 38%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 240, 200, 0.35) 58%,
    transparent 100%
  );
  transform: rotate(18deg) translate3d(-5%, 0, 0);
  mix-blend-mode: screen;
  opacity: 0;
}

.wuXingPresultPorbPwrap.wuXingPresultPorbPshine::after {
  animation: wuXingPresultOrbShineOnce 0.72s cubic-bezier(0.33, 0, 0.22, 1) forwards;
}

@keyframes wuXingPresultOrbShineOnce {
  0% {
    transform: rotate(18deg) translate3d(-5%, 0, 0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    transform: rotate(18deg) translate3d(220%, 0, 0);
    opacity: 0.92;
  }
  100% {
    transform: rotate(18deg) translate3d(220%, 0, 0);
    opacity: 0;
  }
}

.wuXingPaction {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}

.wuXingPqueryCount {
  margin: 0 0 0.15rem;
  width: 100%;
  text-align: center;
  font-family: var(--font-hei);
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(255, 248, 230, 0.72);
  line-height: 1.35;
}

.wuXingPqueryCountPnum {
  color: #86efac;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(134, 239, 172, 0.45);
}

.wuXingPqueryCount--loading .wuXingPqueryCountPnum {
  color: rgba(134, 239, 172, 0.55);
  text-shadow: none;
}

/* 稿：金色主按钮 — 宽度略大于原 2 倍球径，便于英文单行 */
.wuXingPbtnGold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  width: min(100%, calc(2.65 * var(--wu-xing-orb-diameter)));
  max-width: 100%;
  margin: 0 auto;
  padding: 0.82rem 0.55rem 0.72rem;
  min-height: 64px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font-hei);
  font-size: clamp(1.12rem, 3.6vw, 1.32rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  background: url("assets/wx/btn-gold.png") center / 100% 100% no-repeat;
  transition: filter 0.2s;
  box-sizing: border-box;
}

.wuXingPbtnGoldPzh {
  display: block;
  line-height: 1.2;
}

.wuXingPbtnGoldPen {
  display: block;
  max-width: 100%;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.58rem, 1.65vw, 0.68rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  text-align: center;
  white-space: nowrap;
}

.wuXingPbtnGold:hover {
  filter: brightness(1.07);
}

/* 「用神」结果页：60 秒自动清空；倒计时（主框右下，白字「Ns （重置）」） */
.wuXingPqueResetTick {
  position: absolute;
  right: clamp(0.45rem, 2vw, 1rem);
  bottom: clamp(0.4rem, 1.4vmin, 0.75rem);
  z-index: 30;
  min-width: 6.5em;
  text-align: right;
  font-family: var(--font-hei);
  font-size: clamp(0.68rem, 1.75vw, 0.82rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65), 0 0 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

#wuXingQueResetTick[hidden] {
  display: none !important;
}

/* 底部合作品牌 LOGO 暂隐藏 */
.wuXingPbrand {
  display: none !important;
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  margin-top: auto;
  padding: clamp(0.75rem, 2vmin, 1.1rem) 0.25rem 0;
}

.wuXingPbrandImg {
  display: inline-block;
  max-width: min(44%, 12rem);
  width: auto;
  height: auto;
  vertical-align: middle;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35));
}

.wuXingPbrandPfallback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-family: var(--font-hei);
  color: rgba(255, 255, 255, 0.55);
}

.wuXingPbrandPname {
  color: #f472b8;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wuXingPbrandPx {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
}

.wuXingPbrandPplabit {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #0d5c32;
  color: #fff;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

/* 手机 H5：标题变高时，仍保证生日完整 + 首屏可见开始查询 */
@media (max-width: 599px) {
  .wuXingPbody {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }

  .wuXingPshell {
    min-height: auto;
    padding: 0.82rem 0.78rem 0.85rem;
    border-radius: 18px;
  }

  .wuXingPheaderProw {
    margin-bottom: 0.08rem;
  }

  .wuXingPtitle {
    margin-bottom: 0.35rem;
    padding: 0 0.18rem;
    font-size: clamp(1.58rem, 8.5vw, 2.02rem);
    line-height: 1.22;
    letter-spacing: 0.08em;
  }

  .wuXingPtitlePdivider {
    margin-bottom: 0.42rem;
  }

  .wuXingPdiagram {
    max-width: min(18.6rem, 66vw);
    margin: 0.02rem auto 0.36rem;
  }

  .wuXingPform {
    margin-bottom: 0.4rem;
  }

  .wuXingPfieldPwrap {
    margin-bottom: 0.34rem;
  }

  .wuXingPfieldPwrapPgender {
    margin-bottom: 0.36rem;
  }

  .wuXingPfieldPwrapPdate .wuXingPfieldPdate,
  .wuXingPfieldPwrapPplace .wuXingPlocationPwrap,
  .wuXingPfieldPwrapPgender .wuXingPgender,
  .wuXingPfieldPen {
    width: min(100%, calc(2.4 * var(--wu-xing-orb-diameter)));
    max-width: 92%;
  }

  .wuXingPlocationPdropdown {
    display: none !important;
  }

  .wuXingPmodal--place {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0;
  }

  .wuXingPmodalPsheet--place {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 18px 18px 0 0;
    padding: 1.1rem 1rem max(1rem, env(safe-area-inset-bottom));
    max-height: min(90dvh, 92vh);
  }

  .wuXingPlocationPmodalList {
    max-height: min(56dvh, 24rem);
  }

  .wuXingPfieldPdate,
  .wuXingPfieldPplace {
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    font-size: clamp(0.94rem, 4vw, 1.02rem);
    line-height: 1.25;
  }

  .wuXingPfieldPplace {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .wuXingPfieldPplace::placeholder {
    font-size: clamp(0.82rem, 3.2vw, 0.92rem);
    line-height: 1.25;
    white-space: nowrap;
  }

  .wuXingPfieldPen {
    margin-top: 0.2rem;
    font-size: clamp(0.58rem, 1.9vw, 0.68rem);
    line-height: 1.2;
  }

  .wuXingPgenderPbtn {
    padding: 0.42rem 0.28rem 0.36rem;
  }

  .wuXingPaction {
    gap: 0.26rem;
  }

  .wuXingPbtnGold {
    width: min(100%, calc(2.4 * var(--wu-xing-orb-diameter)));
    min-height: 56px;
    padding: 0.58rem 0.45rem 0.5rem;
    font-size: clamp(1rem, 4.2vw, 1.2rem);
  }

  .wuXingPbtnGoldPen {
    font-size: clamp(0.54rem, 1.55vw, 0.64rem);
    line-height: 1.15;
  }

  .wuXingPbrand {
    margin-top: 0.16rem;
  }
  /* 命理报告：打字阶段弹窗 2 倍高；排盘出现后缩回正常高度 */
  .wuXingPmodal--report .wuXingPmodalPsheet--report {
    --report-sheet-h-normal: min(72dvh, 32rem);
    --report-sheet-h-typing: min(92dvh, 64rem);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: var(--report-sheet-h-normal);
    min-height: var(--report-sheet-h-normal);
    max-height: var(--report-sheet-h-normal);
    overflow: hidden;
    padding: 0.85rem 0.78rem 0.78rem;
    transition:
      height 0.42s ease,
      min-height 0.42s ease,
      max-height 0.42s ease;
  }

  .wuXingPmodal--report.wuXingPmodal--reportFirst .wuXingPmodalPsheet--report {
    height: var(--report-sheet-h-typing);
    min-height: var(--report-sheet-h-typing);
    max-height: var(--report-sheet-h-typing);
  }

  .wuXingPmodal--report.wuXingPmodal--reportExpanded .wuXingPmodalPsheet--report {
    height: var(--report-sheet-h-normal);
    min-height: var(--report-sheet-h-normal);
    max-height: var(--report-sheet-h-normal);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wuXingPmodalPsheet--report > .wuXingPmodalPtitle {
    flex: 0 0 auto;
    margin-bottom: 0.4rem;
  }

  .wuXingPreportPbody {
    flex: 1 1 0;
    min-height: 6.5rem;
    height: auto;
    max-height: none;
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.55rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wuXingPreportPmeta {
    flex: 0 0 auto;
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .wuXingPpaipanPsectionTitle {
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    font-size: 0.86rem;
  }

  .wuXingPpaipan {
    flex: 0 0 auto;
    margin-bottom: 0.45rem;
    padding: 0.5rem 0.45rem;
  }

  .wuXingPreportPactions {
    flex: 0 0 auto;
    margin-top: auto;
  }

  /* 打字阶段：不显示排盘、不占位，高度留给正文 */
  .wuXingPmodal--reportFirst #reportMeta,
  .wuXingPmodal--reportFirst #reportPaipanTitle,
  .wuXingPmodal--reportFirst .wuXingPpaipan {
    display: none !important;
  }

}

/* 矮屏手机：进一步压缩垂直占用，确保按钮进入第一屏 */
@media (max-width: 599px) and (max-height: 760px) {
  .wuXingPdiagram {
    max-width: min(17.2rem, 60vw);
    margin-bottom: 0.24rem;
  }

  .wuXingPtitle {
    font-size: clamp(1.45rem, 7.4vw, 1.86rem);
    margin-bottom: 0.28rem;
  }

  .wuXingPtitlePdivider {
    margin-bottom: 0.32rem;
  }

  .wuXingPfieldPwrap {
    margin-bottom: 0.28rem;
  }
}



/* Pad / 平板：整体加宽加高字号，五行图更大 */
@media (min-width: 600px) {
  :root {
    --wu-xing-orb-diameter: clamp(3.5rem, 14vw, 5.5rem);
  }

  html {
    font-size: 118%;
  }

  .wuXingPstack {
    max-width: min(40rem, 86vw);
  }

  .wuXingPshell {
    padding: 1.55rem 1.45rem 1.95rem;
    border-radius: 24px;
    min-height: clamp(34rem, 72vh, 56rem);
  }

  .wuXingPtitle {
    font-size: clamp(2.05rem, 3.4vw, 2.55rem);
    letter-spacing: 0.12em;
  }

  .wuXingPfieldPwrapPdate .wuXingPfieldPdate,
  .wuXingPfieldPwrapPplace .wuXingPlocationPwrap {
    width: min(32vw, 12.5rem);
    max-width: 72%;
  }

  .wuXingPfieldPwrapPgender .wuXingPgender {
    width: min(32vw, 12.5rem);
    max-width: 72%;
  }

  .wuXingPfieldPen {
    max-width: min(32vw, 12.5rem);
    font-size: 0.74rem;
  }

  .wuXingPfieldPdate,
  .wuXingPfieldPplace {
    min-height: 50px;
    font-size: 1.05rem;
    padding: 0.68rem 0.85rem;
  }

  .wuXingPdiagram {
    max-width: min(24rem, 72vw);
    margin: 0.3rem auto 0.95rem;
  }

  .wuXingPresult {
    font-size: clamp(2.475rem, 5.1vw, 3.15rem);
    padding: 0 0.75rem;
  }

  .wuXingPresult::before {
    margin-bottom: 1.425rem;
  }

  .wuXingPresult::after {
    margin-top: 1.425rem;
  }

  /* 用神行仍保持小于「缺五行」大字，避免 Pad 上再次与五球图视觉冲突 */
  .wuXingPresult--yongshen {
    font-size: clamp(1.72rem, 4.4vw, 2.38rem);
  }

  .wuXingPbtnGold {
    min-height: 70px;
    font-size: clamp(1.2rem, 2.6vw, 1.38rem);
    padding: 0.95rem 0.65rem 0.85rem;
  }

  .wuXingPbtnGoldPen {
    font-size: 0.72rem;
  }

  .wuXingPbrandImg {
    max-width: min(42%, 13rem);
  }
}

/* 横屏或大屏 Pad */
@media (min-width: 900px) {
  .wuXingPstack {
    max-width: min(42rem, 80vw);
  }

  .wuXingPdiagram {
    max-width: min(26rem, 58vw);
  }
}

@media (max-width: 340px) {
  html {
    font-size: 102%;
  }
}
