/* 衍天 · 宣纸墨韵 + 朱砂印章 + 国学纹样 */
:root {
  --paper: #f4efe4;
  --paper-deep: #ebe3d2;
  --ink: #1f1c18;
  --ink-soft: #4a433a;
  --muted: #7a6f60;
  --cinnabar: #b33a2b;
  --cinnabar-deep: #8f2d21;
  --gold: #a67c2e;
  --gold-soft: #c9a227;
  --jade: #2f6b57;
  --seal-red: #c23a2b;
  --line: rgba(31, 28, 24, 0.12);
  --card: rgba(255, 252, 245, 0.72);
  --shadow: 0 10px 30px rgba(31, 28, 24, 0.08);
  --radius: 14px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    /* 万字纹淡底 */
    repeating-linear-gradient(
      90deg,
      transparent 0 23px,
      rgba(31, 28, 24, 0.018) 23px 24px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 23px,
      rgba(31, 28, 24, 0.018) 23px 24px
    ),
    radial-gradient(circle at top left, rgba(179, 58, 43, 0.1), transparent 26%),
    radial-gradient(circle at 12% 8%, rgba(166, 124, 46, 0.07), transparent 22%),
    radial-gradient(circle at bottom right, rgba(166, 124, 46, 0.1), transparent 32%),
    linear-gradient(180deg, #f8f3ea 0%, var(--paper) 42%, var(--paper-deep) 100%);
  background-attachment: fixed;
}

/* 顶部水墨晕染条 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(31,28,24,0.15) 12%,
    rgba(179,58,43,0.35) 35%,
    rgba(166,124,46,0.45) 50%,
    rgba(179,58,43,0.35) 65%,
    rgba(31,28,24,0.15) 88%,
    transparent 100%
  );
  z-index: 100;
  pointer-events: none;
}

.app { max-width: 1180px; margin: 0 auto; padding: 32px 20px 48px; }

/* ===== 顶栏 · 国学 ===== */
.topbar {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* 品牌下方回纹装饰线 */
.topbar::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 4px;
  background:
    linear-gradient(90deg,
      transparent,
      rgba(166,124,46,0.15) 10%,
      rgba(179,58,43,0.4) 30%,
      rgba(166,124,46,0.55) 50%,
      rgba(179,58,43,0.4) 70%,
      rgba(166,124,46,0.15) 90%,
      transparent
    );
  position: relative;
}
.topbar::before {
  content: "❖";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 11px;
  background: transparent;
  z-index: 1;
  opacity: 0.85;
}

.topbar-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: start;
  gap: 16px;
  min-height: 52px;
  position: relative;
}
.topbar-side { min-height: 1px; position: relative; }

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: center;
  text-align: left;
  position: relative;
  /* 锁定品牌宽度，切换主题不跳 */
  min-width: 400px;
  /* 左对齐子项：Logo 坐标在中西切换时保持不变 */
  justify-content: flex-start;
}
/* 品牌两侧细金线 */
.brand::before,
.brand::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(166,124,46,0.55), transparent);
}
.brand::before { right: calc(100% + 12px); }
.brand::after { left: calc(100% + 12px); transform: scaleX(-1); }

.brand-seal {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(145deg, #d4453a 0%, var(--cinnabar) 45%, var(--cinnabar-deep) 100%);
  color: #fff7ea;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.22),
    inset 0 0 0 4px rgba(143,45,33,0.35),
    0 8px 18px rgba(143,45,33,0.28);
  position: relative;
  flex-shrink: 0;
}
/* 印章内框（旧文字版，新 Logo 用 SVG） */
.brand-seal::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,247,234,0.45);
  border-radius: 2px;
  pointer-events: none;
}
/* Logo 图片：东/西切换 · 位置锁定 · 柔边融入背景 */
.brand-seal.brand-logo-img {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px;
  min-height: 64px;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  padding: 0;
  display: block;
  flex-shrink: 0;
  /* 与品牌行垂直对齐固定 */
  margin: 0;
  align-self: center;
}
.brand-seal.brand-logo-img::after { display: none !important; }
.brand-logo-img .logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  /* 柔边圆形遮罩，边缘溶进背景 */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 62%, rgba(0,0,0,0.85) 74%, transparent 86%);
  mask-image: radial-gradient(circle at 50% 50%, #000 62%, rgba(0,0,0,0.85) 74%, transparent 86%);
  transition: opacity 0.3s ease, transform 0.25s ease, filter 0.3s ease;
}
.brand-logo-img .logo-east { opacity: 1; z-index: 1; }
.brand-logo-img .logo-west { opacity: 0; z-index: 0; }
body[data-scheme="west"] .brand-logo-img .logo-east { opacity: 0; z-index: 0; }
body[data-scheme="west"] .brand-logo-img .logo-west { opacity: 1; z-index: 1; }

/* 东方：印章略 multiply，融进宣纸 */
body:not([data-scheme="west"]) .brand-logo-img .logo-east {
  mix-blend-mode: multiply;
  filter: contrast(1.05) saturate(1.05);
}
/* 西方：星月盘柔光，融进夜空 */
body[data-scheme="west"] .brand-logo-img .logo-west {
  mix-blend-mode: screen;
  filter: brightness(1.05) contrast(1.05);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 58%, rgba(0,0,0,0.8) 72%, transparent 88%);
  mask-image: radial-gradient(circle at 50% 50%, #000 58%, rgba(0,0,0,0.8) 72%, transparent 88%);
}

.brand-logo-img:hover .logo-east,
.brand-logo-img:hover .logo-west {
  transform: scale(1.06);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: 0.28em;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
  min-width: 8em;
  text-align: center;
}
.brand-text h1::after {
  content: "YAN TIAN";
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.45em;
  color: var(--gold);
  font-weight: 400;
  margin-top: 4px;
  opacity: 0.85;
}
.brand-text p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-family: var(--font-serif);
  white-space: nowrap;
  min-width: 18em;
  text-align: center;
}
/* 副标题前装饰 */
.brand-text p::before {
  content: "〔 ";
  color: var(--cinnabar);
  opacity: 0.55;
}
.brand-text p::after {
  content: " 〕";
  color: var(--cinnabar);
  opacity: 0.55;
}

/* 右上角简报：绝对定位展开，不影响选项栏位置 */
.topbar-main {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(160px, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 52px;
  position: relative;
}
.topbar-side { min-height: 1px; position: relative; }

/* ===== 答案之书（西方 · 左上角 · 单层 · 窄栏绝对定位） ===== */
.book-answers {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 60;
  width: 136px;
  max-width: 136px;
  display: none;
  font-family: var(--font-sans);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(232, 197, 106, 0.4);
  background: linear-gradient(165deg, rgba(32, 28, 56, 0.94), rgba(18, 16, 36, 0.97));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
}
body[data-scheme="west"] .book-answers {
  display: block;
}
.topbar-side {
  min-height: 1px;
  position: relative;
  /* 占位但不撑高主栏，避免选项栏下移 */
  width: 160px;
  max-width: 160px;
  align-self: start;
}
.ba-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.ba-icon { font-size: 11px; color: #e8c56a; }
.ba-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #f0d878;
}
.ba-hint {
  margin: 0 0 6px;
  font-size: 10.5px;
  color: #a89ec4;
  line-height: 1.4;
}
.ba-page {
  border-radius: 8px;
  border: 1px solid rgba(232, 197, 106, 0.3);
  background:
    radial-gradient(circle at 20% 10%, rgba(155, 143, 212, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(40, 34, 68, 0.9), rgba(18, 16, 36, 0.95));
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: 8px 6px;
  margin-bottom: 8px;
  overflow: hidden;
}
.ba-page.ba-flip { animation: baFlip 0.4s ease; }
@keyframes baFlip {
  0% { transform: rotateX(0deg); opacity: 1; }
  40% { transform: rotateX(70deg); opacity: 0.35; }
  100% { transform: rotateX(0deg); opacity: 1; }
}
.ba-page-inner {
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 13px;
  line-height: 1.5;
  color: #f5f2ff;
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 1.5em;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-shadow: 0 0 12px rgba(232, 197, 106, 0.22);
}
.ba-draw {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: #1e1a2e;
  background: linear-gradient(180deg, #f0d878, #e8c56a 55%, #c9a227);
  box-shadow: 0 6px 16px rgba(232, 197, 106, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.ba-draw:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ba-draw:active { transform: translateY(0); }
.ba-note { margin: 6px 0 0; font-size: 9.5px; color: #6e678a; text-align: center; }

@media (max-width: 820px) {
  body[data-scheme="west"] .book-answers {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 10px;
  }
  body[data-scheme="west"] .topbar-side {
    width: 100%;
    max-width: 100%;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
  text-align: left;
  /* 固定宽度：中西切换与登录态下 Logo 坐标不漂移 */
  width: 460px;
  min-width: 460px;
  max-width: 460px;
  justify-content: flex-start;
  box-sizing: border-box;
}
.brand-seal {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--cinnabar), var(--cinnabar-deep));
  color: #fff7ea;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 8px 18px rgba(143,45,33,0.25);
  flex-shrink: 0;
}
/* Logo 图片优先于文字印章 */
.brand-seal.brand-logo-img {
  width: 64px !important;
  height: 64px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 50%;
}
.brand-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.brand-text p { margin: 4px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 0.12em; }

.mini-huangli {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 60;
  /* 展开只向下覆盖主内容右侧，不撑高、不移动选项栏 */
  width: 160px;
  max-width: 160px;
  background: rgba(255, 252, 245, 0.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  overflow: visible;
  box-sizing: border-box;
}
.mini-huangli .mh-body {
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 14px 28px rgba(31, 28, 24, 0.14);
}
.mini-huangli[data-mode="west"] {
  background: rgba(250, 248, 255, 0.97);
  border-color: rgba(91, 74, 138, 0.22);
}
.mini-huangli .mh-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  background: rgba(179, 58, 43, 0.06);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  border-radius: 12px;
}
.mini-huangli[data-mode="west"] .mh-toggle {
  background: rgba(91, 74, 138, 0.08);
}
.mini-huangli .mh-toggle:hover { background: rgba(179, 58, 43, 0.1); }
.mini-huangli[data-mode="west"] .mh-toggle:hover {
  background: rgba(91, 74, 138, 0.12);
}
.mini-huangli:not(.collapsed) .mh-toggle {
  border-radius: 12px 12px 0 0;
}
.mini-huangli .mh-label {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--cinnabar-deep);
  flex-shrink: 0;
}
.mini-huangli[data-mode="west"] .mh-label {
  color: #5b4a8a;
}
/* 收起：只显示日期与星期 */
.mini-huangli.collapsed .mh-label {
  display: none;
}
.mini-huangli.collapsed .mh-toggle {
  justify-content: space-between;
  gap: 10px;
}
.mini-huangli.collapsed .mh-date-inline {
  flex: 1;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.mini-huangli .mh-date-inline {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-huangli .mh-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -4px;
}
.mini-huangli.collapsed .mh-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
/* 流式展开：占文档高度，把选项栏往下推，而不是盖住它 */
.mini-huangli .mh-body {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: inherit;
}
.mini-huangli.collapsed .mh-body {
  display: none;
}
.mini-huangli .mh-date {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.mini-huangli .mh-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
}
.mini-huangli .mh-k {
  color: var(--muted);
  flex-shrink: 0;
}
.mini-huangli .mh-yi,
.mini-huangli .mh-ji {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  align-items: flex-start;
  font-size: 11.5px;
}
.mini-huangli .mh-yi span:last-child { color: var(--jade); }
.mini-huangli .mh-ji span:last-child { color: var(--cinnabar-deep); }
.mini-huangli .mh-chong {
  justify-content: flex-end;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.mini-huangli .mh-sign-blurb {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(91, 74, 138, 0.25);
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 11.5px;
}
.mini-huangli .mh-pane-west .mh-row span:last-child {
  color: #5b4a8a;
  font-family: var(--font-serif);
}
.mini-huangli .mh-label {
  font-size: 11px;
  letter-spacing: 0.1em;
}
.mini-huangli .mh-date-inline {
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  /* 左对齐：切换中西时按钮起点不跳 */
  justify-content: flex-start;
  gap: 10px 14px;
  padding: 8px 14px;
  background: rgba(255,252,245,0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  align-self: center;
  max-width: 100%;
  position: relative;
  z-index: 50;
  /* 切换中西时尺寸由 JS 锁定 min-width/min-height */
  box-sizing: border-box;
}
/* 组名标签 + 切换按钮（整体较原位上移20px：标签底边在虚线上方20px，切换钮顶部高出第二排20px） */
.nav-scheme {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 标签下移(34) + 间距(7) → 整列上移20px后的切换按钮顶边 */
  gap: 7px;
  flex-shrink: 0;
}
.nav-scheme-label {
  display: block;
  line-height: 20px;
  white-space: nowrap;
  /* 标签与切换钮整体上移20px（原49：底边贴虚线） */
  margin-top: 29px;
}
.nav-scheme-label[data-for="west"] { display: none; }
body[data-scheme="west"] .nav-scheme-label[data-for="east"] { display: none; }
body[data-scheme="west"] .nav-scheme-label[data-for="west"] { display: block; }
/* 功能组整体下压“标签行(16)+间距(14)=30px”，使首排按钮落在切换按钮的视觉带内 */
.nav-group { margin-top: 22px; }
/* 中/西切换按钮 */
.scheme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31,28,24,0.16);
  background: rgba(31,28,24,0.04);
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
  flex-shrink: 0;
}
.scheme-toggle:hover {
  background: rgba(31,28,24,0.08);
  color: var(--ink);
}
.scheme-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, #3d3358, #2a2438);
  border-color: rgba(91,74,138,0.45);
  color: #efe8ff;
}
.scheme-toggle-icon {
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
}
.scheme-toggle-label {
  letter-spacing: 0.04em;
}
.nav[data-scheme="west"] {
  background: rgba(250, 248, 255, 0.92);
  border-color: rgba(91, 74, 138, 0.18);
}
.nav-group {
  /* 4列×2行网格：同列上下按钮中心天然对齐；虚线贯穿两行正中 */
  display: grid;
  grid-template-columns: repeat(4, max-content);
  grid-template-rows: 40px 40px;
  column-gap: 6px;
  row-gap: 14px;
  justify-items: center;
  align-items: center;
  position: relative;
}
/* 两行之间的虚线（贯穿全部列） */
.nav-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 47px; /* 首行40 + 行隙14的一半 */
  border-top: 1px dashed rgba(31, 28, 24, 0.16);
  pointer-events: none;
}
body[data-scheme="west"] .nav[data-scheme="west"] .nav-group::after {
  border-top-color: rgba(91, 74, 138, 0.25);
}
.nav-group[hidden] { display: none !important; }
.nav-group-label {
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--muted);
  writing-mode: horizontal-tb;
  padding: 0 2px;
  user-select: none;
}
.nav-group-west .nav-group-label {
  color: #5b4a8a;
}
.nav-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  /* 左对齐：两排首按钮对齐，不受各排行数差影响 */
  justify-content: flex-start;
}
.nav-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(31,28,24,0.22), transparent);
  flex-shrink: 0;
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-btn:hover { background: rgba(179,58,43,0.08); color: var(--cinnabar); }
.nav-group-west .nav-btn:hover {
  background: rgba(91, 74, 138, 0.1);
  color: #5b4a8a;
}
.nav-btn.active {
  background: var(--ink);
  color: #f7f2e8;
  box-shadow: 0 8px 16px rgba(31,28,24,0.18);
}
.nav-group-west .nav-btn.active {
  background: linear-gradient(135deg, #3d3358, #2a2438);
  color: #efe8ff;
  box-shadow: 0 8px 16px rgba(42,36,56,0.28);
}

/* 西方板块面板大标题前星标 */
.panel-head.west h2 {
  color: #3d3358;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-head.west h2::before {
  content: "✦";
  font-size: 22px;
  line-height: 1;
  color: #a67c2e;
  text-shadow: 0 0 10px rgba(166, 124, 46, 0.45);
  flex-shrink: 0;
}
.panel-head.west p { color: #6b5f8f; padding-left: 32px; }

/* 切到西方主题时，东方面板标题也统一加星（若仍可见） */
body[data-scheme="west"] .panel-head:not(.west) h2::before {
  content: "✦" !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 22px !important;
  color: #e8c56a !important;
  text-shadow: 0 0 10px rgba(232, 197, 106, 0.5) !important;
  transform: none !important;
}
.placeholder-card {
  text-align: center;
  padding: 48px 24px;
  background:
    radial-gradient(circle at top, rgba(91,74,138,0.08), transparent 50%),
    rgba(255,252,245,0.72);
}
.placeholder-badge {
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #5b4a8a;
  border: 1px solid rgba(91,74,138,0.35);
  background: rgba(91,74,138,0.08);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}
.placeholder-card .analysis {
  max-width: 520px;
  margin: 0 auto;
  color: var(--ink-soft);
}

/* 星盘排盘 */
.btn.xp-btn {
  background: linear-gradient(135deg, #5b4a8a, #3d3358);
  box-shadow: 0 10px 20px rgba(61, 51, 88, 0.25);
}
.section-title.west-title {
  color: #5b4a8a;
}
.section-title.west-title::before {
  background: #5b4a8a;
}
.xp-big3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.xp-big-card {
  text-align: center;
  padding: 18px 10px;
  border-radius: 12px;
  background: rgba(91, 74, 138, 0.06);
  border: 1px solid rgba(91, 74, 138, 0.18);
}
.xp-big-glyph {
  font-size: 28px;
  color: #5b4a8a;
  line-height: 1;
}
.xp-big-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.xp-big-sign {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #3d3358;
  margin-top: 4px;
}
.xp-big-deg {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.xp-big-house {
  margin-top: 8px;
  font-size: 12px;
  color: #6b5f8f;
}
.xp-table-wrap { overflow-x: auto; }
.xp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.xp-table th,
.xp-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
.xp-table th {
  color: #5b4a8a;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.xp-table td:first-child {
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
}
.xp-interpret {
  color: var(--ink-soft);
  line-height: 1.7;
  min-width: 280px;
  font-size: 13.5px;
}
.xp-cell-muted {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
}
.xp-house-read {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.xp-houses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.xp-house {
  border: 1px solid rgba(91, 74, 138, 0.16);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  padding: 12px;
  min-height: 100px;
}
.xp-house-asc {
  border-color: rgba(91, 74, 138, 0.45);
  background: rgba(91, 74, 138, 0.1);
  box-shadow: inset 0 0 0 1px rgba(91, 74, 138, 0.15);
}
.xp-house-no {
  font-size: 12px;
  color: #5b4a8a;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.xp-house-planets {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.xp-star {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(61, 51, 88, 0.1);
  color: #3d3358;
  font-size: 12.5px;
}
.xp-empty { color: rgba(31,28,24,0.25); }
.xp-house-theme {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* 塔罗三牌阵 */
.tr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.tr-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.tr-cards.tr-shuffling .tr-card-back {
  animation: trShake 0.45s ease infinite alternate;
}
@keyframes trShake {
  from { transform: rotate(-6deg); }
  to { transform: rotate(6deg); }
}
.tr-slot {
  text-align: center;
}
.tr-slot-label {
  font-size: 13px;
  color: #5b4a8a;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 600;
}
.tr-slot-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.tr-card-back,
.tr-card {
  width: 100%;
  aspect-ratio: 5 / 8;
  border-radius: 12px;
  margin: 0 auto;
  max-width: 168px;
  overflow: hidden;
}
.tr-card-back {
  display: grid;
  place-items: center;
  background: #2a2438;
  border: none;
  box-shadow: 0 8px 18px rgba(42,36,56,0.25);
  padding: 0;
}
.tr-card-back .tr-svg,
.tr-card .tr-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tr-card {
  background: transparent;
  border: none;
  box-shadow: 0 10px 22px rgba(42,36,56,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  animation: trFlip 0.45s ease;
  position: relative;
}
@keyframes trFlip {
  from { opacity: 0; transform: rotateY(90deg) scale(0.92); }
  to { opacity: 1; transform: rotateY(0) scale(1); }
}
.tr-card-art {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tr-card-art .tr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  border-radius: 8px;
  image-rendering: auto;
  background: #1a1628;
}
.tr-card-art .tr-svg-fallback,
.tr-card-art .tr-svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}
.tr-card-pos {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(42, 36, 56, 0.82);
  color: #f0d878;
  letter-spacing: 0.08em;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tr-card-rev {
  /* 整卡不转，只倒置牌面插画，角标保持可读 */
  transform: none;
}
.tr-card-rev .tr-card-art {
  transform: rotate(180deg);
}
.tr-card-rev .tr-card-pos {
  background: rgba(179, 58, 43, 0.9);
  color: #fff0ea;
}

@media (max-width: 640px) {
  .tr-cards { grid-template-columns: 1fr; }
  .tr-card-back, .tr-card { max-width: 200px; }
}

/* ===== 凯尔特十字十牌阵 ===== */
.cx-board {
  margin-top: 18px;
}
.cx-cross {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}
.cx-cross-center {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  position: relative;
}
/* 十字：0 现状居中叠 1 阻碍，2 根基下，3 近期过去左 */
.cx-cross-center .cx-pos-present { grid-column: 1 / 3; justify-self: center; width: min(140px, 100%); }
.cx-cross-center .cx-pos-cross { grid-column: 1 / 3; justify-self: center; width: min(140px, 100%); margin-top: -8px; }
.cx-cross-center .cx-pos-foundation { grid-column: 1 / 3; justify-self: center; width: min(140px, 100%); }
.cx-cross-center .cx-pos-recent { grid-column: 1 / 3; justify-self: center; width: min(140px, 100%); }

.cx-arrow {
  display: grid;
  place-items: center;
  color: #9b8fd4;
  font-size: 22px;
  padding-top: 80px;
  opacity: 0.7;
}
.cx-right-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cx-right-col .cx-pos-outcome {
  grid-column: 1 / 3;
  justify-self: center;
  width: min(140px, 100%);
}

.cx-slot {
  background: rgba(18, 16, 36, 0.55);
  border: 1px solid rgba(155, 143, 212, 0.3);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}
.cx-no {
  font-family: Georgia, serif;
  font-size: 11px;
  color: #e8c56a;
  letter-spacing: 0.08em;
}
.cx-name {
  font-size: 12px;
  color: #e8e4f5;
  font-weight: 600;
  margin: 2px 0 6px;
  letter-spacing: 0.06em;
}
.cx-plain {
  margin-top: 6px;
  font-size: 10.5px;
  color: #8f87ad;
  line-height: 1.4;
}
.tr-card-compact {
  max-width: 110px !important;
  margin: 0 auto;
}
.tr-card-compact .tr-card-pos {
  font-size: 10px;
  padding: 1px 8px;
  bottom: 4px;
}
.cx-board.tr-shuffling .tr-card-back {
  animation: trShake 0.4s ease infinite alternate;
}

@media (max-width: 820px) {
  .cx-cross {
    grid-template-columns: 1fr;
  }
  .cx-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }
  .cx-right-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .cx-right-col { grid-template-columns: 1fr; }
  .cx-right-col .cx-pos-outcome { grid-column: auto; width: min(140px, 100%); }
}

@media (max-width: 820px) {
  .xp-big3 { grid-template-columns: 1fr; }
  .xp-houses { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .xp-houses { grid-template-columns: 1fr; }
}
/* ===== 注册 / 登录 ===== */
.brand-auth {
  margin-left: 8px;
  flex-shrink: 0;
  align-self: center;
}
.auth-guest {
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: 0.18s ease;
  white-space: nowrap;
}
.auth-btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(31, 28, 24, 0.2);
}
.auth-btn-ghost:hover {
  background: rgba(31, 28, 24, 0.06);
  color: var(--ink);
}
.auth-btn-primary {
  background: linear-gradient(180deg, #c23a2b, var(--cinnabar-deep));
  color: #fff8ef;
  box-shadow: 0 6px 14px rgba(143, 45, 33, 0.22);
}
.auth-btn-primary:hover { filter: brightness(1.06); }
body[data-scheme="west"] .auth-btn-ghost {
  color: #c4bdd8;
  border-color: rgba(155, 143, 212, 0.35);
}
body[data-scheme="west"] .auth-btn-ghost:hover {
  background: rgba(155, 143, 212, 0.15);
  color: #e8e4f5;
}
body[data-scheme="west"] .auth-btn-primary {
  background: linear-gradient(180deg, #9b8fd4, #3d3358);
  color: #f0d878;
  border: 1px solid rgba(232, 197, 106, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c9a227, var(--gold));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-serif);
  box-shadow: 0 4px 10px rgba(166, 124, 46, 0.3);
  flex-shrink: 0;
}
body[data-scheme="west"] .auth-avatar {
  background: linear-gradient(145deg, #e8c56a, #5b4a8a);
}
.auth-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.auth-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-role {
  font-size: 11px;
  color: var(--muted);
}
body[data-scheme="west"] .auth-name { color: #e8e4f5; }

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 16, 28, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.auth-modal[hidden] { display: none; }
.auth-dialog {
  width: min(400px, 100%);
  background: linear-gradient(180deg, #fffcf6, #f7f0e4);
  border: 1px solid rgba(166, 124, 46, 0.35);
  border-radius: 16px;
  padding: 28px 24px 22px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
body[data-scheme="west"] .auth-dialog {
  background: linear-gradient(180deg, #221c3a, #141022);
  border-color: rgba(232, 197, 106, 0.35);
  color: #e8e4f5;
}
.auth-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}
.auth-close:hover { color: var(--ink); }
body[data-scheme="west"] .auth-close { color: #8f87ad; }
body[data-scheme="west"] .auth-close:hover { color: #f0d878; }
.auth-seal {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #d4453a, var(--cinnabar-deep));
  color: #fff7ea;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
}
body[data-scheme="west"] .auth-seal {
  background: linear-gradient(145deg, #5b4a8a, #1e1a2e);
  color: #f0d878;
  box-shadow: inset 0 0 0 2px rgba(232,197,106,0.3);
}
.auth-title {
  margin: 0 0 6px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: 0.2em;
  color: var(--ink);
}
body[data-scheme="west"] .auth-title { color: #f0eefc; }
.auth-sub {
  margin: 0 0 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
body[data-scheme="west"] .auth-sub { color: #8f87ad; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
/* hidden 属性需盖过 display:flex，登录时不显示确认密码 */
.auth-field[hidden],
[hidden].auth-field,
.auth-field-register[hidden],
[hidden].auth-field-register {
  display: none !important;
}
.auth-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-code-row input {
  flex: 1;
  min-width: 0;
}
.auth-send-code {
  flex-shrink: 0;
  border: 1px solid rgba(179, 58, 43, 0.35);
  background: rgba(179, 58, 43, 0.08);
  color: var(--cinnabar-deep);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: 0.15s ease;
}
.auth-send-code:hover:not(:disabled) {
  background: rgba(179, 58, 43, 0.16);
}
.auth-send-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
body[data-scheme="west"] .auth-send-code {
  border-color: rgba(232, 197, 106, 0.4);
  background: rgba(232, 197, 106, 0.1);
  color: #e8c56a;
}
body[data-scheme="west"] .auth-field { color: #c4bdd8; }
.auth-field input {
  width: 100%;
  border: 1px solid rgba(31, 28, 24, 0.18);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: 0.18s ease;
}
.auth-field input:focus {
  border-color: rgba(179, 58, 43, 0.5);
  box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.12);
}
body[data-scheme="west"] .auth-field input {
  background: rgba(18, 16, 36, 0.8);
  border-color: rgba(155, 143, 212, 0.35);
  color: #e8e4f5;
}
body[data-scheme="west"] .auth-field input:focus {
  border-color: rgba(232, 197, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 197, 106, 0.12);
}
.auth-error {
  margin: 0;
  font-size: 13px;
  color: var(--cinnabar-deep);
  background: rgba(179, 58, 43, 0.1);
  border: 1px solid rgba(179, 58, 43, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}
.auth-error[hidden] { display: none; }
.auth-submit {
  width: 100%;
  margin-top: 4px;
}
.auth-switch {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--cinnabar-deep);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body[data-scheme="west"] .auth-switch { color: #e8c56a; }
.auth-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 300;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  background: rgba(31, 28, 24, 0.92);
  color: #f5f0e4;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.auth-toast[data-type="ok"] {
  background: linear-gradient(135deg, #2f6b57, #1e4a3c);
}
.auth-toast[data-type="error"] {
  background: linear-gradient(135deg, #b33a2b, #8f2d21);
}

@media (max-width: 820px) {
  .brand-auth { margin-left: 0; }
  .auth-user-meta { display: none; }
  .auth-guest .auth-btn { padding: 7px 10px; font-size: 12px; }
}

/* ===== 个人主页 ===== */
.auth-user { cursor: pointer; }
.auth-user:hover .auth-name { color: var(--cinnabar-deep); }
body[data-scheme="west"] .auth-user:hover .auth-name { color: #f0d878; }
.auth-user .auth-avatar {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.auth-user:hover .auth-avatar {
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(166, 124, 46, 0.4);
}
body[data-scheme="west"] .auth-user:hover .auth-avatar {
  box-shadow: 0 6px 16px rgba(232, 197, 106, 0.35);
}

.pf-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-bottom: 6px;
}
.pf-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c9a227, var(--cinnabar));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(143, 45, 33, 0.25);
  flex-shrink: 0;
}
body[data-scheme="west"] .pf-avatar {
  background: linear-gradient(145deg, #e8c56a, #5b4a8a);
  box-shadow: 0 10px 24px rgba(61, 51, 88, 0.35);
}
.pf-hero-meta { flex: 1; min-width: 160px; }
.pf-name {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 8px;
}
body[data-scheme="west"] .pf-name { color: #f0eefc; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(31, 28, 24, 0.06);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pf-tag-vip {
  background: linear-gradient(135deg, #f2dc8f, #d4af37);
  color: #5a430a;
  border-color: rgba(166, 124, 46, 0.55);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(166, 124, 46, 0.3);
}
body[data-scheme="west"] .pf-tag {
  background: rgba(155, 143, 212, 0.15);
  color: #d8d2ee;
  border-color: rgba(155, 143, 212, 0.3);
}
body[data-scheme="west"] .pf-tag-vip {
  background: linear-gradient(135deg, #e8c56a, #b8901f);
  color: #2e2204;
  border-color: rgba(232, 197, 106, 0.65);
  box-shadow: 0 2px 8px rgba(232, 197, 106, 0.25);
}

/* ===== VIP 金色视觉：头像金框 / 昵称金字 / 档位金字 ===== */
body[data-scheme] .pf-avatar.pf-avatar-vip {
  box-shadow: 0 0 0 3px rgba(240, 216, 120, 0.95),
              0 0 0 5px rgba(166, 124, 46, 0.55),
              0 0 18px rgba(212, 175, 55, 0.55),
              0 10px 24px rgba(143, 45, 33, 0.25) !important;
}
body[data-scheme] #pf-name.pf-name-vip {
  background: linear-gradient(135deg, #f2dc8f 0%, #d4af37 45%, #a67c2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body[data-scheme] .auth-user.is-vip .auth-avatar {
  box-shadow: 0 0 0 2px rgba(240, 216, 120, 0.95),
              0 0 0 3.5px rgba(166, 124, 46, 0.55),
              0 0 10px rgba(212, 175, 55, 0.5) !important;
}
body[data-scheme] .auth-user.is-vip .auth-name {
  color: #a67c2e !important;
  font-weight: 700;
}
body[data-scheme="west"] .auth-user.is-vip .auth-name { color: #f0d878 !important; }
body[data-scheme] .auth-user.is-vip .auth-role {
  background: linear-gradient(135deg, #f2dc8f, #d4af37);
  color: #5a430a;
  border: 1px solid rgba(166, 124, 46, 0.5);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(166, 124, 46, 0.28);
}
body[data-scheme="west"] .auth-user.is-vip .auth-role {
  background: linear-gradient(135deg, #e8c56a, #b8901f);
  color: #2e2204;
  border-color: rgba(232, 197, 106, 0.6);
}
.pf-actions { display: flex; gap: 8px; }

/* 修改信息弹窗（昵称 / 头像 / 手机号） */
.auth-avatar-img { object-fit: cover; display: block; }
.pf-avatar { cursor: pointer; overflow: hidden; }
.pf-avatar:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.pf-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px;
}
.profile-modal[hidden] { display: none; }
.profile-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 28, 0.55);
  backdrop-filter: blur(4px);
}
.pm-card {
  position: relative;
  width: min(540px, 100%);
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffcf6, #f7f0e4);
  border: 1px solid rgba(166, 124, 46, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
body[data-scheme="west"] .pm-card {
  background: linear-gradient(180deg, #221c3a, #141022);
  border-color: rgba(232, 197, 106, 0.35);
}
.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 4px;
}
.pm-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
}
body[data-scheme="west"] .pm-title { color: #f0eefc; }
.pm-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}
.pm-close:hover { color: var(--ink); }
body[data-scheme="west"] .pm-close { color: #8f87ad; }
body[data-scheme="west"] .pm-close:hover { color: #f0d878; }
.pm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 20px 4px;
}
.pm-section {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.pm-section:last-child { border-bottom: 0; }
.pm-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cinnabar-deep);
  margin-bottom: 10px;
}
body[data-scheme="west"] .pm-label { color: #f0d878; }
.pm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.pm-input {
  flex: 1 1 150px;
  min-width: 0;
  border: 1px solid rgba(31, 28, 24, 0.18);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.pm-input:focus {
  border-color: rgba(179, 58, 43, 0.45);
  box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.1);
}
.pm-input-code { flex: 0 1 110px; }
.pm-phone-current { font-size: 13px; margin-bottom: 8px; }
.pm-avatar-row { display: flex; gap: 16px; align-items: center; }
.pm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c9a227, var(--cinnabar));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(143, 45, 33, 0.25);
}
body[data-scheme="west"] .pm-avatar {
  background: linear-gradient(145deg, #e8c56a, #5b4a8a);
}
.pm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-avatar-actions { min-width: 0; }
.pm-avatar-actions .btn { margin-right: 8px; }
.pm-avatar-actions .note { margin-top: 6px; }
.pm-foot {
  padding: 10px 20px 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(166, 124, 46, 0.06);
}
body[data-scheme="west"] .pm-foot {
  color: #8f87ad;
  background: rgba(232, 197, 106, 0.06);
  border-top-color: rgba(155, 143, 212, 0.25);
}

/* ===== 购买 VIP 弹窗 ===== */
.vip-modal {
  position: fixed;
  inset: 0;
  z-index: 215;
  display: grid;
  place-items: center;
  padding: 24px;
}
.vip-modal[hidden] { display: none; }
.vip-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 28, 0.6);
  backdrop-filter: blur(4px);
}
.vm-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffcf6, #f7f0e4);
  border: 1px solid rgba(166, 124, 46, 0.45);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}
body[data-scheme="west"] .vm-card {
  background: linear-gradient(180deg, #221c3a, #141022);
  border-color: rgba(232, 197, 106, 0.4);
}
.vm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 6px;
}
.vm-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}
body[data-scheme="west"] .vm-title { color: #f0eefc; }
.vm-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}
.vm-close:hover { color: var(--ink); }
body[data-scheme="west"] .vm-close { color: #8f87ad; }
body[data-scheme="west"] .vm-close:hover { color: #f0d878; }
.vm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 22px 6px;
}
.vm-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) {
  .vm-tiers { grid-template-columns: 1fr; }
}
.vm-tier {
  position: relative;
  border: 1px solid rgba(31, 28, 24, 0.14);
  border-radius: 14px;
  padding: 16px 14px 14px;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
body[data-scheme="west"] .vm-tier {
  background: rgba(18, 16, 36, 0.55);
  border-color: rgba(155, 143, 212, 0.3);
}
.vm-tier-current {
  border-color: rgba(166, 124, 46, 0.75);
  box-shadow: inset 0 0 0 1px rgba(166, 124, 46, 0.35), 0 10px 24px rgba(166, 124, 46, 0.12);
  background: rgba(166, 124, 46, 0.07);
}
body[data-scheme="west"] .vm-tier-current {
  border-color: rgba(232, 197, 106, 0.7);
  background: rgba(232, 197, 106, 0.08);
}
.vm-tier-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cinnabar-deep);
}
body[data-scheme="west"] .vm-tier-name { color: #f0d878; }
.vm-price {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-family: Georgia, "Times New Roman", serif;
}
body[data-scheme="west"] .vm-price { color: #f0eefc; }
.vm-cur { font-size: 15px; margin-right: 2px; vertical-align: 6px; color: var(--gold); }
.vm-per { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.vm-perks {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  flex: 1 1 auto;
}
body[data-scheme="west"] .vm-perks { color: #c4bdd8; }
.vm-perks li::before { content: "· "; color: var(--gold); }
.vm-perks .vm-gift {
  color: var(--gold);
  font-weight: 700;
  margin-top: 4px;
}
body[data-scheme="west"] .vm-perks .vm-gift { color: #f0d878; }
.vm-gift-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4453a, #a67c2e);
  color: #fff7ea;
  box-shadow: 0 3px 10px rgba(143, 45, 33, 0.35);
  z-index: 2;
}
body[data-scheme="west"] .vm-gift-badge {
  background: linear-gradient(135deg, #e8c56a, #8a6a12);
  color: #2e2204;
}
.vm-buy { width: 100%; }
.vm-buy[disabled] { opacity: 0.75; cursor: default; }
.vm-demo-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.7;
}
.vm-foot {
  padding: 10px 22px 14px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(166, 124, 46, 0.06);
}
body[data-scheme="west"] .vm-foot {
  color: #8f87ad;
  background: rgba(232, 197, 106, 0.06);
  border-top-color: rgba(155, 143, 212, 0.25);
}

/* 付费功能按钮 · 未解锁/次数用完时的角标（按钮仍可点击，出模糊预览） */
.btn.is-locked {
  position: relative;
}
.btn.is-locked::after {
  content: "VIP";
  position: absolute;
  top: -8px;
  right: -7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c9a227, var(--gold));
  color: #fffdf5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}
.btn.is-locked.is-exhausted::after {
  content: "用完";
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #8a8478, #6b655c);
}
body[data-scheme="west"] .btn.is-locked::after {
  background: linear-gradient(135deg, #5b4a8a, #3d3358);
  color: #f0d878;
}
body[data-scheme="west"] .btn.is-locked.is-exhausted::after {
  background: linear-gradient(135deg, #6b6784, #4a4664);
  color: #e8e4f5;
}

/* ===== 付费功能 · 未解锁结果模糊预览 ===== */
.result-card.vip-locked { position: relative; }
.result-card.vip-locked > :not(.vip-lock-mask) {
  filter: blur(7px);
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
.vip-lock-mask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(250, 247, 240, 0.28);
  border-radius: inherit;
}
body[data-scheme="west"] .vip-lock-mask {
  background: rgba(14, 12, 28, 0.32);
}
.vip-lock-card {
  max-width: 400px;
  text-align: center;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(166, 124, 46, 0.5);
  border-radius: 14px;
  padding: 18px 22px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
body[data-scheme="west"] .vip-lock-card {
  background: rgba(30, 26, 48, 0.97);
  border-color: rgba(232, 197, 106, 0.45);
}
.vip-lock-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cinnabar-deep);
  margin-bottom: 8px;
}
body[data-scheme="west"] .vip-lock-title { color: #f0d878; }
.vip-lock-text {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
body[data-scheme="west"] .vip-lock-text { color: #c4bdd8; }
.vip-lock-cta { min-width: 140px; }

/* 会员状态 · 用量行 */
.pf-vip-usage { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pf-vip-usage-row {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.pf-vip-usage-row strong { min-width: 76px; font-weight: 600; color: var(--ink); }
body[data-scheme="west"] .pf-vip-usage-row { color: #c4bdd8; }
body[data-scheme="west"] .pf-vip-usage-row strong { color: #f0eefc; }
.pf-vip-support { margin-top: 6px; color: var(--jade) !important; }
body[data-scheme="west"] .pf-vip-support { color: #9b8fd4 !important; }

/* VIP 实物赠礼 · 会员卡区块 */
.pf-vip-gift {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(166, 124, 46, 0.4);
}
body[data-scheme="west"] .pf-vip-gift {
  border-top-color: rgba(232, 197, 106, 0.35);
}
.pf-vip-gift-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #a67c2e;
  margin-bottom: 4px;
}
body[data-scheme="west"] .pf-vip-gift-title { color: #f0d878; }
.pf-vip-gift-btn { margin-top: 8px; }
.pf-vip-gift-edit {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--cinnabar-deep);
  text-decoration: underline;
  cursor: pointer;
}
body[data-scheme="west"] .pf-vip-gift-edit { color: #f0d878; }

.pf-vip-card {
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px dashed rgba(166, 124, 46, 0.4);
  background: rgba(166, 124, 46, 0.06);
}
body[data-scheme="west"] .pf-vip-card {
  border-color: rgba(232, 197, 106, 0.35);
  background: rgba(232, 197, 106, 0.06);
}
.pf-vip-title {
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--cinnabar-deep);
  margin-bottom: 6px;
}
body[data-scheme="west"] .pf-vip-title { color: #f0d878; }
.pf-vip-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.pf-vip-on .pf-vip-title {
  background: linear-gradient(135deg, #f2dc8f 0%, #d4af37 50%, #a67c2e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body[data-scheme="west"] .pf-vip-on .pf-vip-title { color: #f0d878; -webkit-text-fill-color: initial; background: none; }

/* 使用记录 */
.pf-history-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.pf-hist-search {
  flex: 1 1 200px;
  min-width: 0;
  border: 1px solid rgba(31, 28, 24, 0.18);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.pf-hist-search:focus {
  border-color: rgba(179, 58, 43, 0.45);
  box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.1);
}
.pf-hist-filter {
  border: 1px solid rgba(31, 28, 24, 0.18);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  color: var(--ink);
}
.pf-hist-clear { align-self: stretch; }
body[data-scheme="west"] .pf-hist-search,
body[data-scheme="west"] .pf-hist-filter {
  background: rgba(18, 16, 36, 0.75);
  border-color: rgba(155, 143, 212, 0.35);
  color: #e8e4f5;
}
body[data-scheme="west"] .pf-hist-search::placeholder { color: #6e678a; }
.pf-hist-summary {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
body[data-scheme="west"] .pf-hist-summary { color: #a89ec4; }
.pf-hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.pf-hist-item {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
body[data-scheme="west"] .pf-hist-item {
  background: rgba(18, 16, 36, 0.55);
  border-color: rgba(155, 143, 212, 0.25);
}
.pf-hist-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.pf-hist-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
body[data-scheme="west"] .pf-hist-name { color: #f0eefc; }
.pf-hist-vip {
  font-size: 10px;
  font-family: Georgia, serif;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(184, 134, 11, 0.15);
  color: #a67c2e;
  border: 1px solid rgba(166, 124, 46, 0.4);
  font-weight: 700;
}
.pf-hist-q {
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(31, 28, 24, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
}
body[data-scheme="west"] .pf-hist-q {
  color: #c4bdd8;
  background: rgba(155, 143, 212, 0.12);
}
.pf-hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
body[data-scheme="west"] .pf-hist-meta { color: #8f87ad; }
.pf-hist-ago { color: var(--gold); }
.pf-hist-empty { margin-top: 8px; }

/* ===== 周公解梦 ===== */
.form-card textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(31, 28, 24, 0.18);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  font-family: var(--font-sans);
  outline: none;
  resize: vertical;
  min-height: 96px;
}
.form-card textarea:focus {
  border-color: rgba(179, 58, 43, 0.45);
  box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.1);
}
body[data-scheme="west"] .form-card textarea {
  background: rgba(18, 16, 36, 0.75);
  border-color: rgba(155, 143, 212, 0.3);
  color: #e8e4f5;
}
.jm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.jm-chip {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(166, 124, 46, 0.12);
  border: 1px solid rgba(166, 124, 46, 0.4);
  color: #8a6516;
}
body[data-scheme="west"] .jm-chip {
  background: rgba(155, 143, 212, 0.15);
  border-color: rgba(155, 143, 212, 0.4);
  color: #c4bdd8;
}
.jm-chip-none { background: rgba(31, 28, 24, 0.06); border-color: var(--line); color: var(--muted); }
.jm-list { display: flex; flex-direction: column; gap: 12px; }
.jm-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.5);
}
body[data-scheme="west"] .jm-item {
  background: rgba(18, 16, 36, 0.5);
  border-color: rgba(155, 143, 212, 0.25);
}
.jm-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.jm-item-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--cinnabar-deep);
}
body[data-scheme="west"] .jm-item-title { color: #f0d878; }
.jm-item-text { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); }
body[data-scheme="west"] .jm-item-text { color: #c4bdd8; }
.jm-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.jm-tag-good { background: rgba(47, 107, 87, 0.12); color: #2f6b57; border-color: rgba(47, 107, 87, 0.4); }
.jm-tag-bad { background: rgba(179, 58, 43, 0.1); color: #b33a2b; border-color: rgba(179, 58, 43, 0.4); }
.jm-tag-flat { background: rgba(31, 28, 24, 0.06); color: var(--muted); border-color: var(--line); }
body[data-scheme="west"] .jm-tag-good { background: rgba(105, 196, 155, 0.12); color: #7fd4b2; border-color: rgba(105, 196, 155, 0.4); }
body[data-scheme="west"] .jm-tag-bad { background: rgba(224, 108, 117, 0.12); color: #e88a92; border-color: rgba(224, 108, 117, 0.4); }
body[data-scheme="west"] .jm-tag-flat { background: rgba(155, 143, 212, 0.12); color: #a89ec4; border-color: rgba(155, 143, 212, 0.35); }

/* ===== 占星骰子 ===== */
.ad-dice {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin: 8px 0 4px;
}
.ad-die {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(160deg, rgba(40, 34, 70, 0.96), rgba(22, 18, 42, 0.98));
  border: 1px solid rgba(232, 197, 106, 0.45);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 106, 0.18), 0 10px 22px rgba(0, 0, 0, 0.3);
}
body:not([data-scheme="west"]) .ad-die {
  background: linear-gradient(160deg, #fffcf6, #f4ecdc);
  border-color: rgba(166, 124, 46, 0.5);
  box-shadow: inset 0 0 0 1px rgba(166, 124, 46, 0.2), 0 8px 18px rgba(31, 28, 24, 0.12);
}
.ad-die-glyph {
  font-size: 34px;
  line-height: 1.1;
  color: #f0d878;
  font-family: "Segoe UISymbol", "Arial Unicode MS", serif;
}
body:not([data-scheme="west"]) .ad-die-glyph { color: #a67c2e; }
.ad-die-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #f0eefc;
  letter-spacing: 0.08em;
}
body:not([data-scheme="west"]) .ad-die-name { color: var(--ink); }
.ad-die-label {
  font-size: 10.5px;
  color: #a89ec4;
  letter-spacing: 0.16em;
}
body:not([data-scheme="west"]) .ad-die-label { color: var(--muted); }
.ad-glyph-inline {
  display: inline-block;
  margin-right: 6px;
  color: var(--gold);
  font-family: "Segoe UISymbol", "Arial Unicode MS", serif;
}

/* 白话合解 · 人话行与断语块 */
.jm-item-plain { margin-top: 5px; }
.jm-item-plain strong { color: var(--gold); font-weight: 700; }
body:not([data-scheme="west"]) .jm-item-plain strong { color: #a67c2e; }
.ad-sum-block { line-height: 1.95; }
.ad-sum-h {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 15.5px;
  letter-spacing: 0.06em;
  color: var(--cinnabar-deep);
  margin-bottom: 4px;
}
body[data-scheme="west"] .ad-sum-h { color: #f0d878; }

/* ===== 生命灵数 ===== */
.ns-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.ns-chip {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(155, 143, 212, 0.12);
  border: 1px solid rgba(155, 143, 212, 0.35);
  color: #d8d2ee;
  font-family: Georgia, "Times New Roman", serif;
}
.ns-chip-main {
  background: linear-gradient(135deg, rgba(232, 197, 106, 0.25), rgba(184, 134, 11, 0.2));
  border-color: rgba(232, 197, 106, 0.55);
  color: #f0d878;
  font-weight: 700;
}
.ns-op { color: #a89ec4; font-size: 15px; }
.ns-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 1px solid rgba(232, 197, 106, 0.4);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 20%, rgba(232, 197, 106, 0.16), rgba(232, 197, 106, 0.04));
}
.ns-big-num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: #f0d878;
  text-shadow: 0 4px 18px rgba(232, 197, 106, 0.35);
}
.ns-big-key {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #f0eefc;
}
.ns-big-sub {
  font-size: 13px;
  line-height: 1.7;
  color: #a89ec4;
  text-align: center;
  max-width: 460px;
}
.ns-miss-text {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: #c4bdd8;
}
.ns-py-row { display: flex; align-items: center; gap: 14px; }
/* 称骨题词（居中四句） */
.cg-poem {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.12em;
  line-height: 2.1;
  color: var(--ink-soft);
}
/* 观音灵签：签筒与摇动动画 */
.gy-stage {
  display: flex;
  justify-content: center;
  padding: 10px 0 2px;
}
.gy-tube {
  position: relative;
  width: 58px;
  height: 74px;
  border-radius: 6px 6px 12px 12px;
  background: linear-gradient(180deg, #b8874a, #8a5f33);
  border: 1px solid rgba(90, 60, 30, 0.45);
  box-shadow: inset -6px 0 10px rgba(0, 0, 0, 0.18);
  transform-origin: 50% 100%;
}
.gy-stick {
  position: absolute;
  top: -24px;
  width: 5px;
  height: 40px;
  border-radius: 3px;
  background: #efe3c2;
  border: 1px solid rgba(120, 90, 50, 0.4);
  z-index: 1;
}
.gy-stick:nth-child(1) { left: 10px; top: -20px; transform: rotate(-8deg); }
.gy-stick:nth-child(2) { left: 22px; transform: rotate(-2deg); }
.gy-stick:nth-child(3) { left: 33px; top: -26px; transform: rotate(3deg); }
.gy-stick:nth-child(4) { left: 44px; top: -18px; transform: rotate(9deg); }
.gy-mouth {
  position: absolute;
  left: -3px;
  right: -3px;
  top: -5px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(180deg, #c99a5a, #9a6c3a);
  border: 1px solid rgba(90, 60, 30, 0.5);
  z-index: 2;
}
.gy-tube.shake { animation: gy-shake 0.15s ease-in-out 8; }
@keyframes gy-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
/* 签诗与解曰 */
.gy-poem {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.14em;
  line-height: 2.2;
  color: var(--ink);
}
.gy-jie-text {
  text-align: center;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
/* 梅花易数：卦符与布局 */
.mh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.mh-hexagram {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 72px;
  flex-shrink: 0;
  padding-top: 2px;
}
.mh-line {
  height: 8px;
  display: flex;
  justify-content: space-between;
}
.mh-yang {
  background: var(--ink);
  border-radius: 2px;
}
.mh-yin span {
  width: calc(50% - 5px);
  background: var(--ink);
  border-radius: 2px;
}
.mh-primary-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.mh-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.mh-img {
  color: var(--ink-soft);
  line-height: 1.75;
}
.mh-advice {
  margin-top: 10px;
  line-height: 1.75;
  color: var(--ink-soft);
}
/* 档案记录（个人主页管理 + 功能内调取） */
.arc-add { margin-bottom: 4px; }
.arc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.arc-msg { font-size: 13px; color: var(--jade); }
.arc-msg.is-bad { color: var(--cinnabar-deep); }
.arc-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.arc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line);
}
.arc-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.arc-name { font-weight: 600; color: var(--ink); }
.arc-birth, .arc-gender { color: var(--ink-soft); font-size: 13px; }
.arc-src { font-size: 11px; color: var(--muted); }
.arc-ops { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.arc-ops select {
  padding: 5px 8px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}
.arc-ops .btn { white-space: nowrap; }
/* 档案详情弹窗（复用 auth 弹窗外壳） */
.arc-detail {
  margin-top: 8px;
  text-align: left;
  min-width: 300px;
}
.arc-d-row {
  display: flex;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.arc-d-row:last-child { border-bottom: 0; }
.arc-d-k {
  width: 78px;
  flex-shrink: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.arc-d-v { color: var(--ink); line-height: 1.6; word-break: break-all; }
/* 档案编辑（详情弹窗编辑模式） */
.arc-e-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
}
.arc-e-row .arc-d-k { margin-bottom: 0; }
.arc-e-row input,
.arc-e-row select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.arc-e-msg {
  min-height: 18px;
  padding: 4px 4px 0;
  text-align: right;
  font-size: 13px;
  color: var(--cinnabar-deep);
}
.arc-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.arc-modal-foot[hidden] { display: none; }
body[data-scheme="west"] .arc-e-row input,
body[data-scheme="west"] .arc-e-row select {
  background: rgba(18, 16, 36, 0.75);
  border-color: rgba(155, 143, 212, 0.3);
  color: #e8e4f5;
}
/* 功能表单顶部「档案」条 */
.arc-fetch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px dashed rgba(166, 124, 46, 0.45);
  border-radius: 10px;
  background: rgba(166, 124, 46, 0.05);
  font-size: 13px;
}
.arc-fetch-label {
  color: var(--muted);
  letter-spacing: 0.1em;
}
.arc-fetch-sel {
  flex: 1;
  min-width: 190px;
  max-width: 320px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.arc-fetch-msg { font-size: 12.5px; color: var(--jade); }
.arc-fetch-msg.is-bad { color: var(--cinnabar-deep); }
body[data-scheme="west"] .arc-fetch {
  border-color: rgba(155, 143, 212, 0.45);
  background: rgba(91, 74, 138, 0.08);
}
body[data-scheme="west"] .arc-ops select { background: rgba(18, 16, 36, 0.75); color: #e8e4f5; border-color: rgba(155, 143, 212, 0.3); }
.ns-py-num {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #2a2438;
  background: linear-gradient(135deg, #f0d878, #d4af37);
  box-shadow: 0 6px 16px rgba(232, 197, 106, 0.3);
  flex-shrink: 0;
}
.ns-py-label {
  font-size: 14.5px;
  font-weight: 700;
  color: #f0d878;
  letter-spacing: 0.06em;
}
body:not([data-scheme="west"]) .ns-chip {
  background: rgba(166, 124, 46, 0.1);
  border-color: rgba(166, 124, 46, 0.4);
  color: var(--ink);
}
body:not([data-scheme="west"]) .ns-big-key { color: var(--ink); }
body:not([data-scheme="west"]) .ns-big-sub,
body:not([data-scheme="west"]) .ns-miss-text { color: var(--ink-soft); }
body:not([data-scheme="west"]) .ns-py-label { color: #a67c2e; }

/* ===== 马蹄铁牌阵（七牌弧形） ===== */
.hs-arc {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 6px 74px; /* 底部预留弧线下坠空间 */
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 260px;
}
.hs-slot {
  width: 104px;
  flex-shrink: 0;
  text-align: center;
  transform-origin: center top;
}
.hs-slot .tr-card-back,
.hs-slot .tr-card { max-width: 104px; }
.hs-slot-label {
  margin-top: 10px;
  font-size: 12.5px;
  color: #5b4a8a;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}
body:not([data-scheme="west"]) .hs-slot-label { color: var(--muted); }
.hs-arc.tr-shuffling .tr-card-back {
  animation: trShake 0.45s ease infinite alternate;
}
@media (max-width: 760px) {
  .hs-slot { width: 88px; }
  .hs-slot .tr-card-back,
  .hs-slot .tr-card { max-width: 88px; }
}

/* ===== 爱情十字（五牌十字阵） ===== */
.lc-verdict {
  border-radius: 14px;
  padding: 16px 20px 14px;
  border: 1px solid rgba(232, 197, 106, 0.45);
  background: rgba(232, 197, 106, 0.08);
}
.lc-verdict-good { border-color: rgba(232, 197, 106, 0.6); background: rgba(232, 197, 106, 0.1); }
.lc-verdict-mid { border-color: rgba(155, 143, 212, 0.5); background: rgba(155, 143, 212, 0.1); }
.lc-verdict-care { border-color: rgba(232, 138, 146, 0.55); background: rgba(232, 138, 146, 0.09); }
.lc-verdict-head {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: #f0d878;
  margin-bottom: 7px;
}
.lc-verdict-mid .lc-verdict-head { color: #cfc4f2; }
.lc-verdict-care .lc-verdict-head { color: #f0959d; }
.lc-verdict-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: #e8e4f5;
}
.lc-verdict-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #a89ec4;
}
body:not([data-scheme="west"]) .lc-verdict-text { color: var(--ink-soft); }
body:not([data-scheme="west"]) .lc-verdict-note { color: var(--muted); }
.lc-hint {
  text-align: center;
  margin: 12px 0 0;
}
.lc-cross {
  display: grid;
  grid-template-columns: repeat(3, 168px);
  grid-template-areas:
    ".    you    ."
    "them now    block"
    ".    next   .";
  gap: 16px 18px;
  justify-content: center;
  justify-items: center;
  margin-top: 12px;
}
.lc-slot[data-pos="you"] { grid-area: you; }
.lc-slot[data-pos="them"] { grid-area: them; }
.lc-slot[data-pos="now"] { grid-area: now; }
.lc-slot[data-pos="block"] { grid-area: block; }
.lc-slot[data-pos="next"] { grid-area: next; }
.lc-cross .tr-slot { width: 100%; }
.lc-cross .tr-slot-hint { display: none; }
/* 中心「现状」牌加金色描边强调 */
.lc-slot[data-pos="now"] .tr-card,
.lc-slot[data-pos="now"] .tr-card-back {
  box-shadow: 0 0 0 2px rgba(232, 197, 106, 0.55), 0 10px 22px rgba(42, 36, 56, 0.2);
}
.lc-cross.tr-shuffling .tr-card-back {
  animation: trShake 0.45s ease infinite alternate;
}
@media (max-width: 700px) {
  .lc-cross {
    grid-template-columns: minmax(140px, 200px);
    grid-template-areas:
      "you"
      "them"
      "now"
      "block"
      "next";
    gap: 14px;
  }
}

/* 摇骰动画 */
.ad-roll {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
  margin: 14px 0 6px;
}
.ad-roll[hidden] { display: none !important; }
.ad-roll-die {
  animation: ad-tumble 0.32s linear infinite;
  will-change: transform;
}
.ad-roll-die:nth-child(2) { animation-delay: 0.08s; }
.ad-roll-die:nth-child(3) { animation-delay: 0.16s; }
@keyframes ad-tumble {
  0%   { transform: rotate(-10deg) translateY(0) scale(1); }
  25%  { transform: rotate(7deg) translateY(-9px) scale(1.04); }
  50%  { transform: rotate(-5deg) translateY(2px) scale(0.97); }
  75%  { transform: rotate(9deg) translateY(-5px) scale(1.03); }
  100% { transform: rotate(-10deg) translateY(0) scale(1); }
}
.ad-roll-hint {
  flex-basis: 100%;
  text-align: center;
  margin: 2px 0 0;
  font-size: 13px;
  color: #a89ec4;
  letter-spacing: 0.2em;
  animation: ad-hint-blink 0.9s ease-in-out infinite;
}
body:not([data-scheme="west"]) .ad-roll-hint { color: var(--muted); }
@keyframes ad-hint-blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.btn:disabled { opacity: 0.6; cursor: default; }

/* 记录 · 回看按钮 */
.pf-hist-view {
  margin-left: auto;
  border: 1px solid rgba(166, 124, 46, 0.5);
  background: rgba(166, 124, 46, 0.12);
  color: #a67c2e;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pf-hist-view:hover {
  background: rgba(166, 124, 46, 0.22);
  border-color: rgba(166, 124, 46, 0.75);
}
body[data-scheme="west"] .pf-hist-view {
  color: #f0d878;
  border-color: rgba(232, 197, 106, 0.5);
  background: rgba(232, 197, 106, 0.1);
}
body[data-scheme="west"] .pf-hist-view:hover {
  background: rgba(232, 197, 106, 0.2);
}

/* 使用记录 · 结果回看弹层 */
.hist-view {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px;
}
.hist-view[hidden] { display: none; }
.hist-view-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 28, 0.55);
  backdrop-filter: blur(4px);
}
.hist-view-card {
  position: relative;
  width: min(900px, 100%);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffcf6, #f7f0e4);
  border: 1px solid rgba(166, 124, 46, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
body[data-scheme="west"] .hist-view-card {
  background: linear-gradient(180deg, #221c3a, #141022);
  border-color: rgba(232, 197, 106, 0.35);
}
.hist-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 6px;
}
.hv-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hv-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.hv-vip {
  font-size: 10px;
  font-family: Georgia, serif;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(184, 134, 11, 0.15);
  color: #a67c2e;
  border: 1px solid rgba(166, 124, 46, 0.4);
}
.hv-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}
.hv-close:hover { color: var(--ink); }
body[data-scheme="west"] .hv-close { color: #8f87ad; }
body[data-scheme="west"] .hv-close:hover { color: #f0d878; }
.hist-view-meta {
  padding: 0 20px 10px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}
body[data-scheme="west"] .hist-view-meta { color: #a89ec4; }
.hist-view-body {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.hist-view-body .section-title { margin-top: 14px; }
.hist-view-body .section-title:first-child { margin-top: 0; }
.hist-view-foot {
  padding: 10px 20px 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(166, 124, 46, 0.06);
}
body[data-scheme="west"] .hist-view-foot {
  color: #8f87ad;
  background: rgba(232, 197, 106, 0.06);
  border-top-color: rgba(155, 143, 212, 0.25);
}

/* VIP · 简洁金字 */
.vip-tag {
  display: inline-block;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 3px;
  color: #b8860b;
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid rgba(184, 134, 11, 0.35);
  vertical-align: middle;
  transform: translateY(-1px);
}
.nav-btn.active .vip-tag {
  color: #f0d878;
  background: rgba(240, 216, 120, 0.12);
  border-color: rgba(240, 216, 120, 0.4);
}

.main { min-height: 560px; }
.panel { display: none; animation: fadeUp 0.35s ease; }
.panel.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav[data-scheme="east"] {
  background:
    linear-gradient(180deg, rgba(255,252,245,0.97), rgba(244,239,228,0.95));
  border: 1px solid rgba(166, 124, 46, 0.28);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  border-radius: 4px;
  /* 国学选项栏：略方 + 双线 */
  outline: 1px solid rgba(179, 58, 43, 0.12);
  outline-offset: 3px;
}
.nav[data-scheme="east"] .nav-group-label {
  color: var(--cinnabar-deep);
  font-family: var(--font-serif);
  letter-spacing: 0.22em;
  font-weight: 600;
}
.nav[data-scheme="east"] .nav-btn {
  border-radius: 2px;
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
  padding: 9px 16px;
}
.nav[data-scheme="east"] .nav-btn:hover {
  background: rgba(179, 58, 43, 0.08);
  color: var(--cinnabar-deep);
}
.nav[data-scheme="east"] .nav-btn.active {
  background: linear-gradient(180deg, #2a241c, var(--ink));
  color: #f3e6c8;
  box-shadow:
    0 8px 16px rgba(31,28,24,0.2),
    inset 0 0 0 1px rgba(166,124,46,0.35);
  border: 1px solid rgba(166,124,46,0.45);
}
.nav[data-scheme="east"] .nav-btn.active .vip-tag {
  color: #f0d878;
}

.panel-head {
  margin-bottom: 18px;
  position: relative;
}
.panel-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 30px;
  letter-spacing: 0.16em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
/* 东方面板标题：朱砂竖线 + 印章点 */
.panel-head:not(.west) h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep));
  border-radius: 1px;
  flex-shrink: 0;
  box-shadow: 2px 0 0 rgba(179,58,43,0.2);
}
.panel-head:not(.west) h2::after {
  content: "国学";
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  border: 1px solid rgba(166,124,46,0.45);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 400;
  margin-left: 4px;
  align-self: center;
}
.panel-head:not(.west) p {
  color: var(--muted);
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
  padding-left: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(8px);
  position: relative;
}
/* 国学卡片四角：回纹角标 */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(166, 124, 46, 0.4);
  pointer-events: none;
  opacity: 0.7;
}
.card::before {
  top: 8px; left: 8px;
  border-right: 0; border-bottom: 0;
  border-radius: 2px 0 0 0;
}
.card::after {
  bottom: 8px; right: 8px;
  border-left: 0; border-top: 0;
  border-radius: 0 0 2px 0;
}
.panel.west-panel .card::before,
.panel.west-panel .card::after,
#panel-xingpan .card::before,
#panel-xingpan .card::after,
#panel-tarot .card::before,
#panel-tarot .card::after,
#panel-xingpan-hepan .card::before,
#panel-xingpan-hepan .card::after,
#panel-celtic .card::before,
#panel-celtic .card::after {
  border-color: rgba(91, 74, 138, 0.35);
}
.form-card { margin-bottom: 18px; }
.result-card { margin-top: 4px; }

.btn.primary {
  background: linear-gradient(180deg, #c23a2b 0%, var(--cinnabar) 40%, var(--cinnabar-deep) 100%);
  color: #fff8ef;
  box-shadow:
    0 10px 20px rgba(143,45,33,0.22),
    inset 0 1px 0 rgba(255,255,255,0.2);
  border-radius: 3px;
  letter-spacing: 0.14em;
  font-family: var(--font-serif);
  font-size: 15px;
  padding: 12px 24px;
  border: 1px solid rgba(255,247,234,0.25);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
label, .block-label, .inline-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.check-label { justify-content: flex-end; align-items: center; }
.check-label .cl-spacer { min-width: 1px; }
.inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  cursor: pointer;
  color: var(--ink-soft);
  min-height: 44px;
  white-space: nowrap;
}
.check-label > .inline-check { min-height: auto; }
.inline-check label {
  display: inline !important;
  flex-direction: row !important;
  gap: 0 !important;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
}
.inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  padding: 0;
  accent-color: var(--cinnabar);
  cursor: pointer;
  flex-shrink: 0;
}
.inline-check input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.inline-check input[type="checkbox"]:checked {
  outline: 2px solid rgba(179,58,43,0.25);
  outline-offset: 1px;
}
.inline-check input { width: auto; }
.inline-label { flex-direction: row; align-items: center; gap: 10px; }
.block-label { margin-bottom: 14px; }

input, select {
  width: 100%;
  border: 1px solid rgba(31,28,24,0.16);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  transition: 0.2s ease;
}
.inline-label input { width: auto; min-width: 180px; }
input:focus, select:focus {
  border-color: rgba(179,58,43,0.45);
  box-shadow: 0 0 0 3px rgba(179,58,43,0.1);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn.primary {
  background: linear-gradient(180deg, #c23a2b 0%, var(--cinnabar) 42%, var(--cinnabar-deep) 100%);
  color: #fff8ef;
  box-shadow:
    0 10px 20px rgba(143,45,33,0.22),
    inset 0 1px 0 rgba(255,255,255,0.2);
  border-radius: 3px;
  letter-spacing: 0.14em;
  font-family: var(--font-serif);
  font-size: 15px;
  padding: 12px 24px;
  border: 1px solid rgba(255,247,234,0.25);
}
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(31,28,24,0.18);
  border-radius: 3px;
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
}
.btn.ghost:hover { background: rgba(31,28,24,0.05); }

.section-title {
  margin: 22px 0 10px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--cinnabar-deep);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px rgba(166,124,46,0.15);
}
/* 国学小节标题右侧回纹尾 */
.section-title:not(.west-title)::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(166,124,46,0.45), transparent 85%);
}

.muted { color: var(--muted); font-size: 13px; }
.note { margin-top: 12px; }
.analysis {
  margin: 0;
  line-height: 1.8;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.plain-reading .analysis {
  font-size: 14.5px;
  line-height: 1.9;
}
.plain-reading .db-item,
.plain-reading {
  line-height: 1.9;
}
.detail-block {
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--ink-soft);
  line-height: 1.85;
  font-size: 14.5px;
}
.detail-block .db-item {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(31,28,24,0.1);
}
.detail-block .db-item:last-child { border-bottom: 0; }
.detail-block .db-title {
  font-family: var(--font-serif);
  color: var(--cinnabar-deep);
  font-size: 15px;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}
.detail-block .db-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.detail-block strong { color: var(--ink); font-weight: 600; }
.detail-block .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(179,58,43,0.1);
  color: var(--cinnabar-deep);
  font-size: 12px;
  margin-right: 6px;
}
.classic {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 2;
  color: var(--ink);
}

/* 八字 */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.pillar {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.pillar .label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 10px;
}
.pillar .gan, .pillar .zhi {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.1;
}
.pillar .gan { color: var(--cinnabar-deep); }
.pillar .zhi { color: var(--ink); margin-top: 4px; }
.pillar .hidden {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31,28,24,0.06);
  color: var(--ink-soft);
  font-size: 13px;
}
.chip strong { color: var(--cinnabar-deep); font-weight: 600; }

.wuxing-bars { display: grid; gap: 10px; }
.wx-row {
  display: grid;
  grid-template-columns: 48px 1fr 40px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.wx-bar {
  height: 12px;
  background: rgba(31,28,24,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.wx-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
}

/* 易经 */
.form-row input[type="text"] { flex: 1; min-width: 220px; }
.hex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.hex-item {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: 0.18s ease;
  text-align: center;
}
.hex-item:hover, .hex-item.active {
  border-color: rgba(179,58,43,0.4);
  background: rgba(179,58,43,0.06);
}
.hex-item .no { color: var(--muted); font-size: 12px; }
.hex-item .nm {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-top: 4px;
}
.hex-item .bits {
  margin-top: 6px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  font-size: 14px;
}
.hex-head {
  display: flex;
  gap: 18px;
  align-items: center;
}
.hex-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  letter-spacing: 0.12em;
}
.hex-symbols {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1;
  color: var(--cinnabar-deep);
  min-width: 48px;
  text-align: center;
}

/* 六爻 */
.cast-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background:
    radial-gradient(circle at center, rgba(166,124,46,0.12), transparent 55%),
    rgba(255,255,255,0.4);
  border: 1px dashed rgba(166,124,46,0.35);
}
.coins { display: flex; gap: 16px; }
.coin {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 22px;
  color: #fff7ea;
  background: linear-gradient(145deg, #c4922f, #8a6218);
  box-shadow: inset 0 0 0 4px rgba(255,244,214,0.35), 0 10px 18px rgba(138,98,24,0.25);
  transition: transform 0.25s ease;
}
.coin.flip { animation: coinFlip 0.55s ease; }
@keyframes coinFlip {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(360deg) scale(1); }
}
.cast-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cast-log {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}
.cast-log span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31,28,24,0.06);
  font-size: 13px;
  color: var(--ink-soft);
}
.hex-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hex-box {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.hex-box .title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.1em;
}
.hex-box .bits {
  margin-top: 8px;
  letter-spacing: 3px;
  color: var(--cinnabar-deep);
  font-size: 20px;
}
.yao-table { width: 100%; border-collapse: collapse; }
.yao-table th, .yao-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
}
.yao-table th { color: var(--muted); font-weight: 500; }
.yao-table .moving { color: var(--cinnabar-deep); font-weight: 600; }

/* 姓名 */
.ge-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.ge-cell {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}
.ge-cell .name { color: var(--muted); font-size: 13px; }
.ge-cell .num {
  font-family: var(--font-serif);
  font-size: 32px;
  margin-top: 6px;
  color: var(--cinnabar-deep);
}
.ge-cell .luck { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }

/* 黄历 */
.source-toggle {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 14px;
}
.source-toggle label { flex-direction: row; align-items: center; gap: 6px; }
.hl-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.hl-date-main {
  font-family: var(--font-serif);
  font-size: 40px;
  letter-spacing: 0.08em;
  color: var(--cinnabar-deep);
}
.hl-week { color: var(--ink-soft); margin-top: 4px; }
.hl-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.tag-list.good li { background: rgba(47,107,87,0.12); color: var(--jade); }
.tag-list.bad li { background: rgba(179,58,43,0.1); color: var(--cinnabar-deep); }
.hl-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.hl-meta .item {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.hl-meta .k { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.hl-meta .v { color: var(--ink); font-family: var(--font-serif); font-size: 18px; }

/* 合盘：甲乙上下整行，字段横排 */
.hp-forms {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.hp-person-form {
  background: rgba(255,255,255,0.4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.hp-form-title {
  font-family: var(--font-serif);
  color: var(--cinnabar-deep);
  letter-spacing: 0.16em;
  margin-bottom: 10px;
  font-size: 15px;
}
.hp-person-form .form-grid {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
}
.hp-person-form .form-grid > label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
}
.hp-person-form .form-grid > label > span {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12.5px;
}
.hp-person-form .form-grid > label input,
.hp-person-form .form-grid > label select {
  width: auto;
  min-width: 64px;
  max-width: 130px;
  padding: 8px 10px;
  font-size: 13.5px;
}
.hp-person-form .form-grid > label input[type="text"] {
  width: 100px;
}
.hp-person-form .form-grid > label input[type="time"] {
  width: 112px;
}
.hp-person-form .form-grid > .check-label {
  flex: 0 0 auto;
}
.hp-person-form .form-grid > .check-label .inline-check {
  min-height: auto;
  font-size: 13px;
  white-space: nowrap;
}
.hp-person-form .form-grid > .check-label .inline-check input {
  width: auto;
  min-width: 0;
  max-width: none;
}
/* 闰月行由 JS 控制显隐 */
.check-label[style*="display: none"],
.inline-check[style*="display: none"] {
  display: none !important;
}
.hp-person-form .note {
  margin-top: 2px;
  margin-bottom: 0;
  font-size: 12px;
}
.hp-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.hp-mode-row .btn { flex-shrink: 0; align-self: center; }
/* 姻缘/合作：文字横版，各占一行（两排） */
.hp-mode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.hp-mode label {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  cursor: pointer;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.45);
  font-size: 15px;
  letter-spacing: 0.08em;
  transition: 0.18s ease;
}
.hp-mode label:hover {
  border-color: rgba(179,58,43,0.35);
  background: rgba(179,58,43,0.06);
}
.hp-mode label:has(input:checked) {
  border-color: rgba(179,58,43,0.55);
  background: rgba(179,58,43,0.1);
  color: var(--cinnabar-deep);
  font-weight: 600;
}
.hp-mode label input {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  accent-color: var(--cinnabar);
}
.hp-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}
.hp-person {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.hp-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(179,58,43,0.12);
  color: var(--cinnabar-deep);
  font-size: 12px;
  margin-bottom: 8px;
}
.hp-name {
  font-family: var(--font-serif);
  font-size: 24px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.hp-meta {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.hp-vs {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cinnabar), var(--cinnabar-deep));
  color: #fff7ea;
  font-family: var(--font-serif);
  font-size: 20px;
  align-self: center;
  box-shadow: 0 8px 16px rgba(143,45,33,0.25);
}
.hp-score {
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}
.hp-score-num {
  font-family: var(--font-serif);
  font-size: 56px;
  color: var(--cinnabar-deep);
  line-height: 1;
}
.hp-score-num span { font-size: 18px; margin-left: 4px; color: var(--muted); }
.hp-score-grade {
  margin: 8px 0 16px;
  font-family: var(--font-serif);
  letter-spacing: 0.12em;
  color: var(--ink);
}
.hp-bars { text-align: left; max-width: 480px; margin: 0 auto; }

/* 星盘合盘 · 姻缘评分 */
.hp-score .sh-score-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
  text-align: left;
}
.hp-score .sh-score-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.hp-score .sh-score-ring {
  --p: 60;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: conic-gradient(#a67c2e calc(var(--p) * 1%), rgba(166, 124, 46, 0.15) 0);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 0 6px rgba(166, 124, 46, 0.08);
}
.hp-score .sh-score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(166, 124, 46, 0.25);
}
.hp-score .sh-score-inner {
  position: relative;
  z-index: 1;
  line-height: 1.1;
}
.hp-score .sh-score-num {
  font-family: var(--font-serif);
  font-size: 48px;
  color: var(--cinnabar-deep);
  line-height: 1;
}
.hp-score .sh-score-unit {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-top: 4px;
}
.hp-score .sh-score-grade {
  margin: 10px 0 0;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--ink);
  font-weight: 700;
}
.hp-score .sh-score-mode {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--cinnabar-deep);
  background: rgba(179, 58, 43, 0.1);
  border: 1px solid rgba(179, 58, 43, 0.25);
  padding: 3px 12px;
  border-radius: 999px;
}
.hp-score .sh-score-tip {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 180px;
}
.hp-score .sh-score-side {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.hp-score .sh-score-side-title {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--cinnabar-deep);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-score .sh-score-side-title::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 1px;
}
.hp-score .sh-bar-row { margin-bottom: 12px; }
.hp-score .sh-bar-row:last-child { margin-bottom: 0; }
.hp-score .sh-bar-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 5px;
}
.hp-score .sh-bar-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
}
.hp-score .sh-bar-hint {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}
.hp-score .sh-bar-val {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--cinnabar-deep);
  min-width: 2em;
  text-align: right;
}
.hp-score .sh-bar-track {
  height: 8px;
  background: rgba(31, 28, 24, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.hp-score .sh-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9a227, #b33a2b);
  box-shadow: 0 0 8px rgba(179, 58, 43, 0.25);
  transition: width 0.45s ease;
}
.hp-score .sh-bar-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .hp-score .sh-score-layout { grid-template-columns: 1fr; gap: 16px; }
  .hp-score .sh-score-tip { max-width: none; }
}

@media (max-width: 820px) {
  .hp-pair { grid-template-columns: 1fr; }
  .hp-vs { margin: 0 auto; }
  .hp-person-form .form-grid > label {
    flex: 1 1 140px;
  }
  .hp-person-form .form-grid > label input,
  .hp-person-form .form-grid > label select {
    max-width: none;
    flex: 1;
    width: auto;
  }
}

/* 紫微 */
.ziwei-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.zw-cell {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  padding: 10px;
  position: relative;
}
.zw-cell.center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(179,58,43,0.08), transparent 60%),
    rgba(255,255,255,0.35);
}
.zw-palace {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.zw-stars {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.6;
}
.zw-stars .major { color: var(--cinnabar-deep); font-weight: 700; }
.zw-branch {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: rgba(31,28,24,0.25);
  font-family: var(--font-serif);
  font-size: 14px;
}
.zw-center-title {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: 0.2em;
  color: var(--cinnabar-deep);
}
.zw-center-sub { margin-top: 8px; color: var(--ink-soft); line-height: 1.8; }

.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(166,124,46,0.25);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.12em;
  font-family: var(--font-serif);
  position: relative;
}
.footer::before {
  content: "☯";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper-deep);
  padding: 0 12px;
  color: var(--gold);
  font-size: 14px;
}

/* ===== 中国元素装饰 ===== */
.ornament-cloud {
  position: absolute;
  top: -4px;
  width: 120px;
  height: 40px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
.ornament-cloud-l { left: 8px; }
.ornament-cloud-r { right: 8px; }

.ornament-knot {
  width: 36px;
  height: 48px;
  flex-shrink: 0;
  margin-left: 4px;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(179,58,43,0.2));
}

.ornament-ruyi {
  display: block;
  width: min(420px, 90%);
  height: 22px;
  margin: 8px auto 0;
  position: relative;
  z-index: 51;
  pointer-events: none;
}

.ornament-footer {
  display: block;
  width: min(240px, 70%);
  height: 28px;
  margin: 0 auto 8px;
  pointer-events: none;
}

/* 东方面板：窗棂淡纹 */
#panel-bazi,
#panel-ziwei,
#panel-hepan,
#panel-liuyao {
  position: relative;
}
#panel-bazi::before,
#panel-ziwei::before,
#panel-hepan::before,
#panel-liuyao::before {
  content: "";
  position: absolute;
  inset: -8px -12px auto;
  height: 56px;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(45deg, transparent 46%, rgba(166,124,46,0.25) 47%, rgba(166,124,46,0.25) 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(166,124,46,0.25) 47%, rgba(166,124,46,0.25) 53%, transparent 54%);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
  z-index: 0;
}
#panel-bazi > *,
#panel-ziwei > *,
#panel-hepan > *,
#panel-liuyao > * {
  position: relative;
  z-index: 1;
}

.panel-head:not(.west)::after {
  content: "☁";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 22px;
  color: rgba(166,124,46,0.35);
  pointer-events: none;
  line-height: 1;
}

.form-card {
  border-top: 2px solid rgba(179, 58, 43, 0.18);
}
.form-card::before {
  border-color: rgba(166, 124, 46, 0.5);
}

#panel-bazi input,
#panel-bazi select,
#panel-ziwei input,
#panel-ziwei select,
#panel-hepan input,
#panel-hepan select,
#panel-liuyao input {
  border-radius: 2px;
  border-color: rgba(31, 28, 24, 0.2);
  background: rgba(255, 253, 248, 0.85);
  font-family: var(--font-serif);
}
#panel-bazi input:focus,
#panel-bazi select:focus,
#panel-ziwei input:focus,
#panel-ziwei select:focus,
#panel-hepan input:focus,
#panel-hepan select:focus,
#panel-liuyao input:focus {
  border-color: rgba(179, 58, 43, 0.45);
  box-shadow: 0 0 0 3px rgba(179, 58, 43, 0.1);
}

.pillar {
  background: linear-gradient(180deg, rgba(255,253,248,0.95), rgba(244,239,228,0.9));
  border: 1px solid rgba(166,124,46,0.28);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.pillar .gan { text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.pillar .zhi { text-shadow: 0 1px 0 rgba(255,255,255,0.5); }

.nav[data-scheme="east"] {
  position: relative;
}
.nav[data-scheme="east"] .vip-tag {
  border-radius: 1px;
  letter-spacing: 0.12em;
  border-color: rgba(179, 58, 43, 0.45);
  color: var(--cinnabar-deep);
  background: rgba(179, 58, 43, 0.1);
  font-family: var(--font-serif);
}
.nav[data-scheme="east"] .nav-btn.active .vip-tag {
  color: #f0d878;
  background: rgba(240,216,120,0.12);
  border-color: rgba(240,216,120,0.4);
}
.nav[data-scheme="east"]::before,
.nav[data-scheme="east"]::after {
  content: "☁";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(166,124,46,0.4);
  font-size: 14px;
  pointer-events: none;
}
.nav[data-scheme="east"]::before { left: -22px; }
.nav[data-scheme="east"]::after {
  right: -22px;
  transform: translateY(-50%) scaleX(-1);
}

@media (max-width: 820px) {
  .ornament-cloud,
  .ornament-knot,
  .ornament-ruyi,
  .ornament-footer { display: none; }
  #panel-bazi::before,
  #panel-ziwei::before,
  #panel-hepan::before,
  #panel-liuyao::before { display: none; }
  .nav[data-scheme="east"]::before,
  .nav[data-scheme="east"]::after { display: none; }
  .panel-head:not(.west)::after { display: none; }
  .brand { min-width: 0; width: auto; max-width: 100%; }
  .brand-text p { min-width: 0; white-space: normal; }
  .topbar-main {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 52px;
    padding-top: 0;
  }
  /* 西方保留答案之书；东方侧栏为空可隐藏 */
  body:not([data-scheme="west"]) .topbar-side { display: none; }
  body[data-scheme="west"] .topbar-side {
    display: block;
    width: 100%;
    justify-self: stretch;
  }
  .brand { justify-self: center; text-align: center; flex-direction: column; }
  .mini-huangli {
    position: relative;
    top: auto;
    right: auto;
    justify-self: center;
    width: min(196px, 100%);
    max-width: 196px;
    margin-top: 10px;
  }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .ge-grid { grid-template-columns: repeat(3, 1fr); }
  .hl-cols, .hex-pair { grid-template-columns: 1fr; }
  .ziwei-board { grid-template-columns: repeat(2, 1fr); }
  .zw-cell.center {
    grid-column: 1 / 3;
    grid-row: auto;
    min-height: 140px;
  }
  .brand-text h1 { font-size: 22px; }
  .panel-head h2 { font-size: 26px; }

  /* ---- 导航：4列在窄屏溢出（第4列出屏）→ 2列×4行居中 ---- */
  .nav {
    flex-direction: column;
    align-items: center;
  }
  .nav-scheme {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .nav-scheme-label { margin-top: 0; } /* 桌面端为贴虚线做的下移，窄屏横排不需要 */
  .nav-group {
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    column-gap: 14px;
  }
  .nav-group::after { display: none; } /* 变4行后单一中线不再适用 */

  /* ---- 弹窗（登录/档案详情等）：不超出视口，超高可滚 ---- */
  .auth-dialog {
    box-sizing: border-box;
    width: calc(100vw - 28px);
    max-width: 400px;
    min-width: 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
  /* ---- 简繁切换钮：品牌列竖排时居中 ---- */
  #lang-toggle {
    align-self: center;
    margin-top: 2px;
  }
}

/* =========================================================
   西方玄学 · 星夜主题（切换时布局稳定，不跳动）
   ========================================================= */
body[data-scheme="west"] {
  --paper: #0f0e1a;
  --paper-deep: #141228;
  --ink: #e8e4f5;
  --ink-soft: #c4bdd8;
  --muted: #8f87ad;
  --cinnabar: #9b8fd4;
  --cinnabar-deep: #c4b5ff;
  --gold: #e8c56a;
  --gold-soft: #f0d878;
  --jade: #6ec6c0;
  --line: rgba(196, 181, 255, 0.16);
  --card: rgba(28, 24, 48, 0.78);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  /* 梵高星夜感：深蓝旋涡 + 金黄星斑 */
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(122, 107, 181, 0.25), transparent 55%),
    radial-gradient(circle at 85% 12%, rgba(232, 197, 106, 0.18) 0%, rgba(232, 197, 106, 0.06) 8%, transparent 18%),
    radial-gradient(circle at 20% 30%, rgba(74, 124, 155, 0.16), transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(40, 32, 80, 0.4), transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(91, 74, 138, 0.2), transparent 50%),
    linear-gradient(180deg, #12102a 0%, #0f0e1a 45%, #0c0b16 100%);
  background-attachment: fixed;
  /* 保证不因滚动条变化导致横向跳动 */
  scrollbar-gutter: stable;
}

/* 星夜固定装饰层（绝对定位，不占布局） */
body[data-scheme="west"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  background-image:
    /* 旋涡笔触感（简化） */
    radial-gradient(ellipse 18% 10% at 22% 18%, transparent 40%, rgba(155,143,212,0.12) 42%, transparent 55%),
    radial-gradient(ellipse 14% 8% at 78% 35%, transparent 40%, rgba(232,197,106,0.1) 42%, transparent 55%),
    radial-gradient(ellipse 20% 12% at 60% 70%, transparent 45%, rgba(74,124,155,0.12) 47%, transparent 60%),
    /* 星点 */
    radial-gradient(1.5px 1.5px at 8% 12%, #f0d878 50%, transparent 51%),
    radial-gradient(1px 1px at 18% 28%, #e8e4f5 50%, transparent 51%),
    radial-gradient(2px 2px at 32% 8%, #f0d878 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 22%, #c4b5ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 14%, #f0d878 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 30%, #e8e4f5 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 8%, #f0d878 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 40%, #c4b5ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 12% 55%, #e8e4f5 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #f0d878 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 88%, #c4b5ff 50%, transparent 51%),
    radial-gradient(1px 1px at 65% 60%, #f0d878 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 82% 78%, #e8e4f5 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 65%, #f0d878 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 85%, #c4b5ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 50% 45%, #f0d878 50%, transparent 51%);
  /* 大月亮光晕 */
  radial-gradient(circle 48px at 88% 10%, rgba(240,216,120,0.22), rgba(240,216,120,0.05) 45%, transparent 70%);
}

/* 内容层抬到星夜之上 */
body[data-scheme="west"] .app {
  position: relative;
  z-index: 1;
}
body {
  position: relative;
}
body[data-scheme="west"] .app { z-index: 2; }

/* 顶栏：深色半透明，压在星空上 */
body[data-scheme="west"]::before {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(155, 143, 212, 0.25) 15%,
    rgba(232, 197, 106, 0.45) 50%,
    rgba(155, 143, 212, 0.25) 85%,
    transparent 100%
  );
  opacity: 0.85;
}

/* ===== 布局稳定：装饰用 visibility，不用 display:none ===== */
body[data-scheme="west"] .ornament-cloud,
body[data-scheme="west"] .ornament-ruyi,
body[data-scheme="west"] .ornament-footer {
  visibility: hidden;
  opacity: 0;
}
/* 中国结：同尺寸换成星徽，避免品牌区宽度变化 */
body[data-scheme="west"] .ornament-knot {
  visibility: visible;
  opacity: 1;
}
body[data-scheme="west"] .ornament-knot path,
body[data-scheme="west"] .ornament-knot rect,
body[data-scheme="west"] .ornament-knot circle {
  stroke: #e8c56a;
}
body[data-scheme="west"] .ornament-knot circle[fill] {
  fill: #e8c56a;
}

body[data-scheme="west"] .topbar::before,
body[data-scheme="west"] .topbar::after {
  visibility: hidden;
  opacity: 0;
}
body[data-scheme="west"] #panel-bazi::before,
body[data-scheme="west"] #panel-ziwei::before,
body[data-scheme="west"] #panel-hepan::before,
body[data-scheme="west"] #panel-liuyao::before {
  visibility: hidden;
  opacity: 0;
}
/* 标题装饰：同样尺寸，只换字符颜色 */
body[data-scheme="west"] .panel-head:not(.west)::after {
  content: "✦";
  color: rgba(232, 197, 106, 0.55);
  font-size: 20px;
}
body[data-scheme="west"] .section-title:not(.west-title)::after {
  background: linear-gradient(90deg, rgba(155, 143, 212, 0.5), transparent 85%);
}
body[data-scheme="west"] .section-title:not(.west-title)::before {
  background: #e8c56a;
  border-radius: 50%;
  transform: none;
  box-shadow: 0 0 8px rgba(232, 197, 106, 0.45);
}
body[data-scheme="west"] .section-title {
  color: #c4b5ff;
}

/* 品牌：夜空紫水晶 */
body[data-scheme="west"] .brand-seal {
  background: linear-gradient(145deg, #5b4a8a 0%, #3d3358 45%, #1e1a2e 100%);
  box-shadow:
    inset 0 0 0 2px rgba(232, 197, 106, 0.35),
    inset 0 0 0 4px rgba(30, 26, 46, 0.5),
    0 8px 22px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(155, 143, 212, 0.25);
  color: #f0d878;
}
body[data-scheme="west"] .brand-logo-img .logo-img {
  filter: none;
}
body[data-scheme="west"] .brand::before,
body[data-scheme="west"] .brand::after {
  background: linear-gradient(90deg, transparent, rgba(232, 197, 106, 0.55), transparent);
}
body[data-scheme="west"] .brand-text h1 {
  color: #e8e4f5;
  text-shadow: 0 0 18px rgba(155, 143, 212, 0.35);
}
body[data-scheme="west"] .brand-text h1::after {
  color: #e8c56a;
  text-shadow: 0 0 8px rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .brand-text p {
  letter-spacing: 0.14em;
  color: #8f87ad;
  font-family: var(--font-serif); /* 不换字体，避免宽度变化 */
}
body[data-scheme="west"] .brand-text p::before,
body[data-scheme="west"] .brand-text p::after {
  color: #e8c56a;
}

/* 选项栏：夜空胶囊 */
body[data-scheme="west"] .nav {
  /* 夜空方角：由胶囊(999px)改为长方形，与东方方角呼应 */
  border-radius: 4px;
  outline: none;
  background: rgba(18, 16, 36, 0.82);
  border-color: rgba(155, 143, 212, 0.35);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(232, 197, 106, 0.15),
    0 0 0 1px rgba(232, 197, 106, 0.12);
  backdrop-filter: blur(10px);
}
body[data-scheme="west"] .nav::before,
body[data-scheme="west"] .nav::after {
  visibility: hidden;
  opacity: 0;
}
body[data-scheme="west"] .nav-btn {
  border-radius: 999px;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  color: #c4bdd8;
}
body[data-scheme="west"] .nav-btn:hover {
  background: rgba(155, 143, 212, 0.18);
  color: #e8e4f5;
}
body[data-scheme="west"] .nav-btn.active {
  background: linear-gradient(135deg, #5b4a8a, #2a2438);
  color: #f0d878;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(232, 197, 106, 0.35);
  border-color: transparent;
}
body[data-scheme="west"] .nav-group-label {
  font-family: Georgia, serif;
  letter-spacing: 0.14em;
  color: #9b8fd4;
}
body[data-scheme="west"] .scheme-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, #e8c56a, #b8860b);
  color: #1e1a2e;
  border-color: rgba(232, 197, 106, 0.5);
}

/* 面板标题 */
body[data-scheme="west"] .panel-head:not(.west) h2 {
  color: #e8e4f5;
  text-shadow: 0 0 20px rgba(155, 143, 112, 0.2);
}
body[data-scheme="west"] .panel-head:not(.west) h2::before {
  background: linear-gradient(180deg, #e8c56a, #9b8fd4);
  box-shadow: 0 0 8px rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .panel-head:not(.west) h2::after {
  content: "✦ WEST";
  font-family: Georgia, serif;
  color: #e8c56a;
  border-color: rgba(232, 197, 106, 0.4);
  letter-spacing: 0.16em;
  background: rgba(232, 197, 106, 0.08);
}
body[data-scheme="west"] .panel-head:not(.west) p {
  font-family: var(--font-sans);
  color: #8f87ad;
}
body[data-scheme="west"] .panel-head.west h2 {
  color: #c4b5ff;
}
body[data-scheme="west"] .panel-head.west p {
  color: #8f87ad;
}

/* 卡片：夜空玻璃 */
body[data-scheme="west"] .card {
  background: linear-gradient(165deg, rgba(32, 28, 56, 0.88), rgba(18, 16, 36, 0.92));
  border-color: rgba(155, 143, 212, 0.22);
  border-radius: 16px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(232, 197, 106, 0.12);
  backdrop-filter: blur(12px);
}
body[data-scheme="west"] .card::before,
body[data-scheme="west"] .card::after {
  border-color: rgba(232, 197, 106, 0.35);
  border-radius: 8px;
}
body[data-scheme="west"] .form-card {
  border-top: 2px solid rgba(155, 143, 212, 0.4);
}
body[data-scheme="west"] .form-card::before {
  border-color: rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .detail-block {
  background: rgba(18, 16, 36, 0.55);
  border-color: rgba(155, 143, 212, 0.18);
  color: #d8d2ee;
}
body[data-scheme="west"] .detail-block .db-title {
  color: #e8d5ff;
}
body[data-scheme="west"] .analysis {
  color: #ddd6f5;
}
body[data-scheme="west"] .muted,
body[data-scheme="west"] .note {
  color: #a89ec4;
}
/* 星盘可读性（星夜深色底） */
body[data-scheme="west"] .xp-table th {
  color: #e8c56a;
  background: rgba(155, 143, 212, 0.12);
}
body[data-scheme="west"] .xp-table td {
  color: #e8e4f5;
  border-bottom-color: rgba(155, 143, 212, 0.2);
}
body[data-scheme="west"] .xp-table td:first-child {
  color: #f0d878;
}
body[data-scheme="west"] .xp-interpret {
  color: #d8d2ee;
  line-height: 1.75;
}
body[data-scheme="west"] .xp-cell-muted,
body[data-scheme="west"] .xp-house-read,
body[data-scheme="west"] .xp-house-theme {
  color: #a89ec4;
}
body[data-scheme="west"] .xp-big-card {
  background: rgba(155, 143, 212, 0.14);
  border-color: rgba(232, 197, 106, 0.3);
}
body[data-scheme="west"] .xp-big-glyph {
  color: #e8c56a;
  text-shadow: 0 0 12px rgba(232, 197, 106, 0.45);
}
body[data-scheme="west"] .xp-big-sign {
  color: #f0d878;
}
body[data-scheme="west"] .xp-big-deg {
  color: #d8d2ee;
}
body[data-scheme="west"] .xp-big-house {
  color: #a89ec4;
}
body[data-scheme="west"] .xp-house {
  background: rgba(18, 16, 36, 0.65);
  border-color: rgba(155, 143, 212, 0.28);
}
body[data-scheme="west"] .xp-house-no {
  color: #e8c56a;
}
body[data-scheme="west"] .xp-house-planets {
  min-height: 32px;
}
body[data-scheme="west"] .xp-star {
  background: rgba(232, 197, 106, 0.16);
  color: #f0d878;
}
body[data-scheme="west"] .xp-empty {
  color: #6e678a;
}
body[data-scheme="west"] .xp-house-asc {
  background: rgba(232, 197, 106, 0.1);
  border-color: rgba(232, 197, 106, 0.45);
  box-shadow: inset 0 0 0 1px rgba(232, 197, 106, 0.25);
}
body[data-scheme="west"] #xp-summary {
  color: #e8e4f5;
  line-height: 1.9;
  font-size: 14.5px;
  white-space: pre-wrap;
  background: rgba(18, 16, 36, 0.5);
  border: 1px solid rgba(155, 143, 212, 0.2);
  border-radius: 12px;
  padding: 16px 18px;
}
body[data-scheme="west"] .xp-table th,
body[data-scheme="west"] .xp-table td {
  font-size: 13.5px;
}
body[data-scheme="west"] .chip {
  background: rgba(155, 143, 212, 0.18);
  color: #d8d2ee;
  border-color: rgba(155, 143, 212, 0.3);
}
body[data-scheme="west"] .chip strong {
  color: #f0d878;
}
/* 东方主题下星盘也保证可读 */
#xp-summary {
  white-space: pre-wrap;
  line-height: 1.85;
}
.xp-table th {
  background: rgba(91, 74, 138, 0.06);
}

/* 表单 */
body[data-scheme="west"] input,
body[data-scheme="west"] select {
  border-radius: 12px;
  background: rgba(18, 16, 36, 0.75);
  border-color: rgba(155, 143, 212, 0.3);
  color: #e8e4f5;
  font-family: var(--font-sans);
}
body[data-scheme="west"] input::placeholder {
  color: #6e678a;
}
body[data-scheme="west"] input:focus,
body[data-scheme="west"] select:focus {
  border-color: rgba(232, 197, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 197, 106, 0.15);
}
body[data-scheme="west"] select option {
  background: #1e1a2e;
  color: #e8e4f5;
}

/* 按钮：金紫星夜 */
body[data-scheme="west"] .btn.primary {
  background: linear-gradient(180deg, #9b8fd4 0%, #5b4a8a 50%, #2a2438 100%);
  border-radius: 999px;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
  color: #f0d878;
  border: 1px solid rgba(232, 197, 106, 0.4);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 16px rgba(155, 143, 212, 0.25);
}
body[data-scheme="west"] .btn.ghost {
  border-radius: 999px;
  font-family: var(--font-sans);
  color: #c4bdd8;
  border-color: rgba(155, 143, 212, 0.35);
}
body[data-scheme="west"] .btn.ghost:hover {
  background: rgba(155, 143, 212, 0.15);
  color: #e8e4f5;
}
body[data-scheme="west"] .xp-btn {
  background: linear-gradient(135deg, #9b8fd4, #3d3358) !important;
  color: #1e1a2e !important;
  border-color: rgba(232, 197, 106, 0.35) !important;
}

/* 四柱纸签在西式下不出现，但若残留则深色化 */
body[data-scheme="west"] .pillar {
  border-radius: 10px;
  border-color: rgba(155, 143, 212, 0.3);
  background: rgba(18, 16, 36, 0.7);
}
body[data-scheme="west"] .pillar .gan {
  color: #f0d878;
  text-shadow: none;
}
body[data-scheme="west"] .pillar .zhi {
  color: #e8e4f5;
  text-shadow: none;
}

/* 页脚 */
body[data-scheme="west"] .footer {
  border-top-color: rgba(155, 143, 212, 0.3);
  color: #8f87ad;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
}
body[data-scheme="west"] .footer::before {
  content: "✦";
  background: #0f0e1a;
  color: #e8c56a;
}

/* 简报 */
body[data-scheme="west"] .mini-huangli {
  background: rgba(24, 20, 42, 0.92);
  border-color: rgba(155, 143, 212, 0.3);
  color: #c4bdd8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
body[data-scheme="west"] .mini-huangli .mh-body {
  background: rgba(24, 20, 42, 0.96);
}
body[data-scheme="west"] .mini-huangli .mh-date,
body[data-scheme="west"] .mini-huangli .mh-date-inline {
  color: #f0d878;
}
body[data-scheme="west"] .mini-huangli .mh-label {
  color: #9b8fd4;
}
body[data-scheme="west"] .mini-huangli .mh-k {
  color: #8f87ad;
}
body[data-scheme="west"] .mini-huangli .mh-toggle {
  background: rgba(155, 143, 212, 0.12);
}
body[data-scheme="west"] .mini-huangli .mh-toggle:hover {
  background: rgba(155, 143, 212, 0.2);
}

/* VIP */
body[data-scheme="west"] .nav[data-scheme="west"] .vip-tag {
  border-radius: 999px;
  font-family: Georgia, serif;
  color: #f0d878;
  background: rgba(232, 197, 106, 0.12);
  border-color: rgba(232, 197, 106, 0.4);
}

/* chip / meta */
body[data-scheme="west"] .chip {
  background: rgba(155, 143, 212, 0.15);
  color: #c4bdd8;
}
body[data-scheme="west"] .chip strong {
  color: #f0d878;
}

/* 星盘合盘可读性（星夜深色） */
body[data-scheme="west"] .hp-person {
  background: rgba(18, 16, 36, 0.78);
  border-color: rgba(155, 143, 212, 0.4);
  color: #e8e4f5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
body[data-scheme="west"] .hp-name { color: #f0d878; }
body[data-scheme="west"] .hp-meta { color: #ddd6f5; }
body[data-scheme="west"] .hp-meta strong { color: #f0d878; }
body[data-scheme="west"] .hp-tag {
  background: rgba(232, 197, 106, 0.22);
  color: #f0d878;
  border: 1px solid rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .hp-vs {
  background: linear-gradient(145deg, #e8c56a, #b8860b);
  color: #1e1a2e;
  box-shadow: 0 0 20px rgba(232, 197, 106, 0.45);
  font-weight: 700;
}
body[data-scheme="west"] .hp-score {
  background: linear-gradient(165deg, rgba(32,28,56,0.95), rgba(18,16,36,0.95));
  border-color: rgba(232, 197, 106, 0.4);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  text-align: left;
}
body[data-scheme="west"] .hp-score .sh-score-ring {
  background: conic-gradient(#e8c56a calc(var(--p) * 1%), rgba(155, 143, 212, 0.2) 0);
  box-shadow: 0 0 0 6px rgba(232, 197, 106, 0.12), 0 0 28px rgba(232, 197, 106, 0.25);
}
body[data-scheme="west"] .hp-score .sh-score-ring::before {
  background: rgba(18, 16, 36, 0.97);
  border-color: rgba(232, 197, 106, 0.35);
}
body[data-scheme="west"] .hp-score .sh-score-num {
  color: #f0d878;
  text-shadow: 0 0 20px rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .hp-score .sh-score-unit { color: #a89ec4; }
body[data-scheme="west"] .hp-score .sh-score-grade {
  color: #f5f2ff;
  text-shadow: 0 0 16px rgba(232, 197, 106, 0.3);
}
body[data-scheme="west"] .hp-score .sh-score-mode {
  color: #f0d878;
  background: rgba(232, 197, 106, 0.12);
  border-color: rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .hp-score .sh-score-tip { color: #a89ec4; }
body[data-scheme="west"] .hp-score .sh-score-side {
  background: rgba(18, 16, 36, 0.55);
  border-color: rgba(155, 143, 212, 0.3);
}
body[data-scheme="west"] .hp-score .sh-score-side-title { color: #e8c56a; }
body[data-scheme="west"] .hp-score .sh-bar-label { color: #e8e4f5; }
body[data-scheme="west"] .hp-score .sh-bar-hint { color: #a89ec4; }
body[data-scheme="west"] .hp-score .sh-bar-val { color: #f0d878; }
body[data-scheme="west"] .hp-score .sh-bar-sub { color: #8f87ad; }
body[data-scheme="west"] .hp-score .sh-bar-track { background: rgba(155, 143, 212, 0.2); }
body[data-scheme="west"] .hp-score .sh-bar-fill {
  background: linear-gradient(90deg, #e8c56a, #9b8fd4);
  box-shadow: 0 0 10px rgba(232, 197, 106, 0.35);
}
body[data-scheme="west"] .hp-score-num {
  color: #f0d878;
  text-shadow: 0 0 24px rgba(232, 197, 106, 0.4);
}
body[data-scheme="west"] .hp-score-num span { color: #a89ec4; }
body[data-scheme="west"] .hp-score-grade { color: #f0eefc; }
body[data-scheme="west"] .hp-bars .wx-row > div:first-child { color: #c4bdd8; }
body[data-scheme="west"] .hp-bars .wx-row > div:last-child { color: #f0d878; }
body[data-scheme="west"] .hp-bars .wx-bar { background: rgba(155, 143, 212, 0.22); }
body[data-scheme="west"] .hp-bars .wx-fill { background: linear-gradient(90deg, #e8c56a, #9b8fd4); }
body[data-scheme="west"] .hp-person-form {
  background: rgba(18, 16, 36, 0.6);
  border-color: rgba(155, 143, 212, 0.32);
}
body[data-scheme="west"] .hp-form-title { color: #e8c56a; }
body[data-scheme="west"] #sh-core,
body[data-scheme="west"] #sh-aspects {
  background: rgba(18, 16, 36, 0.78);
  border-color: rgba(155, 143, 212, 0.32);
  color: #e8e4f5;
}
body[data-scheme="west"] #sh-core .db-title,
body[data-scheme="west"] #sh-aspects .db-title { color: #f0d878; }
body[data-scheme="west"] #sh-core .db-sub,
body[data-scheme="west"] #sh-aspects .db-sub { color: #a89ec4; }
body[data-scheme="west"] #sh-core .tag,
body[data-scheme="west"] #sh-aspects .tag {
  background: rgba(232, 197, 106, 0.2);
  color: #f0d878;
  border: 1px solid rgba(232, 197, 106, 0.4);
}
.analysis-card { border-radius: 12px; padding: 4px; }
body[data-scheme="west"] .analysis-card {
  background: rgba(18, 16, 36, 0.8);
  border: 1px solid rgba(155, 143, 212, 0.35);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
body[data-scheme="west"] #sh-summary {
  color: #f5f2ff !important;
  background: transparent;
  border: none;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.95;
}
#sh-summary {
  white-space: pre-wrap;
  line-height: 1.9;
  font-size: 14.5px;
}
#sh-core .db-item,
#sh-aspects .db-item { line-height: 1.7; }

/* 仅颜色过渡，禁止 background-image / 尺寸过渡导致跳动 */
body,
.card,
.nav,
.brand-seal,
.btn.primary,
.panel-head h2,
.section-title,
.mini-huangli,
.chip,
.detail-block {
  transition:
    background-color 0.28s ease,
    color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}


/* ===== 自托管思源宋体（简 Noto Serif SC / 繁 Noto Serif TC）=====
   解决系统宋体点阵/轮廓混排导致的字号不一；繁体版由 build-hant 切换为 TC 族 */
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../assets/fonts/noto-serif-sc-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../assets/fonts/noto-serif-sc-500.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../assets/fonts/noto-serif-sc-700.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../assets/fonts/noto-serif-tc-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../assets/fonts/noto-serif-tc-500.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../assets/fonts/noto-serif-tc-700.woff2") format("woff2");
}

/* 简繁切换钮：置于品牌金线装饰(::after)之上，避免装饰线劫持点击 */
#lang-toggle { position: relative; z-index: 2; }


.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--cinnabar); }


/* ===== 微信私域入口（VIP 下线后的引流位） ===== */
.wechat-modal { position: fixed; inset: 0; z-index: 960; display: grid; place-items: center; }
.wechat-modal[hidden] { display: none; }
.wechat-modal-mask { position: absolute; inset: 0; background: rgba(20, 16, 12, 0.55); }
.wm-card {
  position: relative; width: min(360px, calc(100vw - 32px));
  background: #fffdf8; border: 1px solid rgba(166, 124, 46, 0.35);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(31, 28, 24, 0.25);
  overflow: hidden;
}
.wm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(166, 124, 46, 0.2);
}
.wm-title { font-weight: 600; letter-spacing: 0.06em; color: #2c261e; }
.wm-close { border: 0; background: none; font-size: 22px; line-height: 1; color: #8a8070; cursor: pointer; }
.wm-close:hover { color: #b33a2b; }
.wm-body { padding: 18px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.wm-qr {
  width: 220px; height: 220px; object-fit: contain; background: #fff;
  border: 1px solid rgba(166, 124, 46, 0.3); border-radius: 10px;
}
.wm-id-row { display: flex; align-items: center; gap: 10px; }
.wm-id { font-weight: 600; color: #b33a2b; letter-spacing: 0.04em; word-break: break-all; }
.pf-wechat-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; background: rgba(179, 58, 43, 0.05);
  border: 1px solid rgba(179, 58, 43, 0.25); border-radius: 12px;
}
.pf-wechat-title { font-weight: 600; color: #2c261e; margin-bottom: 4px; }
.pf-wechat-sub { font-size: 13px; color: #8a8070; line-height: 1.7; }
.pf-wechat-card .wechat-cta { flex: 0 0 auto; }
@media (max-width: 820px) {
  .pf-wechat-card { flex-direction: column; align-items: stretch; text-align: center; }
  .wm-qr { width: min(220px, 60vw); height: min(220px, 60vw); }
}


/* ===== 答案之书移动端隐藏（≤820px 不展示该挂件） ===== */
@media (max-width: 820px) {
  .book-answers { display: none !important; }
}
