/* divination-meihua.css — 梅花法阵演卦+奇门四层盘面+tooltip+标签色+用神+沉浸头部+Hero+三法子+响应式 */

/* ═══════════════════════════════════════════════════════
   梅花易数 — 法阵演卦动画系统（五幕史诗级）
   ═══════════════════════════════════════════════════════ */

/* ── 法阵舞台 — 毛玻璃卡片 ── */
.mh-taiji-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 32px 24px;
  overflow: hidden;
  /* 毛玻璃卡片效果 */
  border-radius: 20px;
  background: linear-gradient(
    165deg,
    rgba(248, 245, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.55) 40%,
    rgba(245, 240, 255, 0.50) 100%
  );
  border: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow:
    0 8px 32px rgba(139, 92, 246, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}
.mh-taiji-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* 背景暗化层 — 已移除，法阵直接浮于毛玻璃上 */
.mh-fazhen-backdrop {
  display: none;
}

/* 粒子层 */
.mh-fazhen-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ── 法阵容器 ── */
.mh-fazhen-formation {
  position: relative;
  width: 280px;
  height: 280px;
  z-index: 2;
  opacity: 0;
  transform: scale(0.3) rotate(-30deg);
  will-change: transform, opacity;
}
.mh-fazhen-formation.phase-1 {
  animation: mhFazhenAppear 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.mh-fazhen-formation.phase-4a {
  animation: mhEnergyCollapse 0.5s ease-in forwards;
}
.mh-fazhen-formation.phase-4b {
  transform: scale(1);
  opacity: 1;
}
.mh-fazhen-formation.fade-out {
  transition: opacity 0.5s ease;
  opacity: 0;
}

/* ── 八卦符文环 ── */
.mh-fazhen-ring {
  position: absolute;
  inset: 0;
  animation: mhRingSpin 40s linear infinite;
}
@keyframes mhRingSpin {
  to { transform: rotate(360deg); }
}

/* 单个符文节点 */
.mh-fazhen-node {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1.5px solid rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(139, 92, 246, 0.30);
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity, box-shadow;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* 节点位置 — 圆形排布（280px容器，半径110px，从正上方顺时针） */
.mh-fazhen-node[data-idx="0"] { top: 4px;   left: 50%; transform: translateX(-50%); }
.mh-fazhen-node[data-idx="1"] { top: 19%;  right: 4px; transform: none; }
.mh-fazhen-node[data-idx="2"] { top: 50%;  right: -2px; transform: translateY(-50%); }
.mh-fazhen-node[data-idx="3"] { bottom: 19%; right: 4px; transform: none; }
.mh-fazhen-node[data-idx="4"] { bottom: 4px; left: 50%; transform: translateX(-50%); }
.mh-fazhen-node[data-idx="5"] { bottom: 19%; left: 4px; transform: none; }
.mh-fazhen-node[data-idx="6"] { top: 50%;  left: -2px; transform: translateY(-50%); }
.mh-fazhen-node[data-idx="7"] { top: 19%;  left: 4px; transform: none; }

/* 点亮状态 */
.mh-fazhen-node.lit {
  color: var(--div-gold, #d4950c);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(212, 149, 12, 0.45);
  box-shadow: 0 0 12px rgba(212, 149, 12, 0.3), 0 0 24px rgba(212, 149, 12, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: mhNodePop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 主卦高亮 — 上卦紫色 */
.mh-fazhen-node.lit.is-upper {
  color: var(--div-purple, #8b5cf6);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3), 0 0 24px rgba(139, 92, 246, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
}
/* 主卦高亮 — 下卦金色增强 */
.mh-fazhen-node.lit.is-lower {
  color: var(--rt-gold-light, #e8a006);
  border-color: rgba(232, 160, 6, 0.50);
  box-shadow: 0 0 12px rgba(232, 160, 6, 0.35), 0 0 24px rgba(232, 160, 6, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
}
/* 能量回收闪烁 */
.mh-fazhen-node.lit.collapsing {
  animation: mhNodeFlicker 0.15s linear infinite alternate;
}
@keyframes mhNodeFlicker {
  from { opacity: 0.6; filter: brightness(1.2); }
  to   { opacity: 1;   filter: brightness(1.8); }
}

/* ── SVG 连线层 ── */
.mh-fazhen-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.mh-fazhen-lines line {
  stroke: rgba(139, 92, 246, 0.10);
  stroke-width: 0.8;
  transition: stroke 0.4s ease, stroke-opacity 0.4s ease;
}
.mh-fazhen-lines line.lit {
  stroke: rgba(139, 92, 246, 0.25);
  stroke-width: 1;
}

/* ── 涟漪层 ── */
.mh-fazhen-ripples {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1;
}
.mh-fazhen-ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(139, 92, 246, 0.30);
  top: 50%;
  left: 50%;
  animation: rtRippleExpand 0.8s ease-out forwards;
  pointer-events: none;
}

/* ── 核心太极 — 淡紫+暖白柔和太极 ── */
.mh-fazhen-taiji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  opacity: 0.2;
  filter: blur(4px);
  z-index: 3;
  transition: all 0.3s;
  will-change: transform, opacity, filter;
}
.mh-fazhen-taiji.activated {
  animation: mhTaijiActivate 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.mh-fazhen-taiji.spinning {
  animation: taiji-spin var(--taiji-speed, 0.8s) linear infinite;
  opacity: 1;
  filter: blur(0) drop-shadow(0 0 12px rgba(139, 92, 246, 0.25));
  transform: translate(-50%, -50%) scale(1);
}
.mh-fazhen-taiji.dissolve {
  animation: taiji-dissolve 0.5s ease-out forwards;
}

.mh-fazhen-taiji-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(to right, #c4b5fd 50%, #fef3e2 50%);
  box-shadow:
    0 0 16px rgba(139, 92, 246, 0.15),
    inset 0 0 8px rgba(255, 255, 255, 0.3);
}
.mh-fazhen-taiji-inner::before,
.mh-fazhen-taiji-inner::after {
  content: '';
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.mh-fazhen-taiji-inner::before {
  top: 0; left: 50%; transform: translateX(-50%);
  background: #fef3e2;
  box-shadow: inset 0 0 0 8px #fef3e2, inset 0 0 0 10px #c4b5fd;
}
.mh-fazhen-taiji-inner::after {
  bottom: 0; left: 50%; transform: translateX(-50%);
  background: #c4b5fd;
  box-shadow: inset 0 0 0 8px #c4b5fd, inset 0 0 0 10px #fef3e2;
}
.mh-taiji-eye-yang, .mh-taiji-eye-yin {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
}
.mh-taiji-eye-yang { top: 12px; background: #c4b5fd; }
.mh-taiji-eye-yin  { bottom: 12px; background: #fef3e2; }

/* ── 能量爆发环 ── */
.mh-fazhen-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.45), rgba(232, 160, 6, 0.2) 50%, transparent 70%);
  animation: energyBurst 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 4;
}

/* ── 卦象凝结区 ── */
.mh-fazhen-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.4s ease;
}
.mh-fazhen-result.visible {
  opacity: 1;
  pointer-events: auto;
}
.mh-fazhen-symbols {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  opacity: 0;
}
.mh-fazhen-result.visible .mh-fazhen-symbols {
  animation: rtFadeUp 0.6s ease forwards;
}
.mh-fazhen-symbol {
  font-size: 36px;
  line-height: 1;
  color: var(--div-gold, #d4950c);
  text-shadow: 0 0 20px rgba(232, 160, 6, 0.4);
}
.mh-fazhen-symbol.upper-sym {
  animation: mhSymbolDropIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.mh-fazhen-symbol.lower-sym {
  animation: mhSymbolRiseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes mhSymbolDropIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.5); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mhSymbolRiseIn {
  from { opacity: 0; transform: translateY(30px) scale(0.5); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mh-fazhen-guaming {
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 900;
  color: #a78bfa;
  letter-spacing: 6px;
  opacity: 0;
}
.mh-fazhen-result.visible .mh-fazhen-guaming {
  animation: rtBrushWrite 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
.mh-fazhen-guaci {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: var(--div-text-tertiary);
  margin-top: 4px;
  opacity: 0;
}
.mh-fazhen-result.visible .mh-fazhen-guaci {
  animation: rtFadeUp 0.6s ease 0.8s forwards;
}
.mh-fazhen-seal {
  display: inline-block;
  padding: 3px 10px;
  border: 2px solid var(--rt-cinnabar, #8b2500);
  border-radius: 3px;
  color: var(--rt-cinnabar, #8b2500);
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: 12px;
  opacity: 0;
}
.mh-fazhen-result.visible .mh-fazhen-seal {
  animation: rtSealStamp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

/* ── 屏幕震动 ── */
.mh-taiji-stage.screen-shake {
  animation: rtScreenShake 0.5s ease-in-out;
}

/* ── 粒子基础 ── */
.mh-orbit-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.6);
  pointer-events: none;
  animation: mhParticleOrbit var(--orbit-dur, 3s) linear infinite;
  will-change: transform;
}
.mh-burst-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--p-size, 4px);
  height: var(--p-size, 4px);
  border-radius: 50%;
  background: var(--p-color, rgba(139, 92, 246, 0.7));
  pointer-events: none;
  animation: rtInkBurst 0.7s ease-out forwards;
}
.mh-fade-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--div-purple, #8b5cf6);
  pointer-events: none;
  opacity: 0;
  animation: goldParticle 2s ease-out forwards;
}

/* ── 提示文字 ── */
.mh-hint-text {
  font-size: 13px;
  color: var(--div-text-tertiary);
  text-align: center;
  margin-top: 16px;
  transition: all 0.4s;
  position: relative;
  z-index: 7;
}
.mh-hint-text.active {
  color: var(--div-purple, #8b5cf6);
  text-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

/* ═══════════════════════════════════════════════════════
   法阵新增 @keyframes
   ═══════════════════════════════════════════════════════ */

/* 舞台毛玻璃微光脉冲 */
@keyframes mhGlassGlow {
  0%, 100% {
    box-shadow:
      0 8px 32px rgba(139, 92, 246, 0.10),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  }
  50% {
    box-shadow:
      0 8px 40px rgba(139, 92, 246, 0.18),
      0 2px 12px rgba(0, 0, 0, 0.06),
      inset 0 0 0 1px rgba(255, 255, 255, 0.65),
      inset 0 0 30px rgba(139, 92, 246, 0.04);
  }
}
.mh-taiji-stage.mh-glass-active {
  animation: mhGlassGlow 3s ease-in-out infinite;
}

@keyframes mhFazhenAppear {
  0%   { transform: scale(0.3) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.05) rotate(5deg); opacity: 0.9; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes mhTaijiActivate {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.2; filter: blur(4px); }
  50%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; filter: blur(0); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; filter: blur(0); }
}
@keyframes mhNodePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes mhEnergyCollapse {
  0%   { transform: scale(1); }
  100% { transform: scale(0.92); filter: brightness(1.3); }
}
@keyframes mhBackdropFlash {
  0%   { background: rgba(139, 92, 246, 0.08); }
  100% { background: rgba(0, 0, 0, 0); }
}
@keyframes mhParticleOrbit {
  0%   { transform: rotate(0deg) translateX(var(--orbit-r, 80px)) rotate(0deg); opacity: 0.7; }
  50%  { opacity: 1; }
  100% { transform: rotate(360deg) translateX(var(--orbit-r, 80px)) rotate(-360deg); opacity: 0.7; }
}
/* 旧版兼容：太极旋转 & 消散 */
@keyframes taiji-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes taiji-dissolve {
  0%   { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; filter: blur(0) drop-shadow(0 0 12px rgba(139, 92, 246, 0.25)); }
  50%  { transform: translate(-50%, -50%) rotate(540deg); opacity: 0.7; filter: blur(2px) drop-shadow(0 0 20px rgba(139, 92, 246, 0.4)); }
  100% { transform: translate(-50%, -50%) rotate(1080deg) scale(1.8); opacity: 0; filter: blur(8px) drop-shadow(0 0 0 transparent); }
}

/* ═══════════════════════════════════════════════════════
   梅花易数 — 英雄卡（紫色主题）
   ═══════════════════════════════════════════════════════ */
.mh-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 32px 24px 28px;
  text-align: center;
  background: linear-gradient(165deg, rgba(248, 245, 255, 0.9) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 250, 245, 0.82) 100%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  margin-bottom: 16px;
}
.mh-hero-card .div-hero-glow {
  background: radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.10) 0%, transparent 60%);
}
.mh-hero-card .div-hero-name {
  background: linear-gradient(135deg, #5b4cc7, #8B5CF6, #5b4cc7);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroNameShimmer 3s ease-in-out infinite;
}
.mh-hero-card .div-hero-tag.upper {
  background: rgba(139, 92, 246, 0.10);
  color: #5b4cc7;
  border: 1px solid rgba(139, 92, 246, 0.20);
}
.mh-hero-card .div-hero-tag.lower {
  background: rgba(232, 160, 6, 0.08);
  color: #9a6b08;
  border: 1px solid rgba(232, 160, 6, 0.18);
}
.mh-hero-judge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.mh-hero-judge.ji {
  background: rgba(46, 204, 113, 0.12);
  color: #2ECC71;
  border: 1px solid rgba(46, 204, 113, 0.25);
}
.mh-hero-judge.xiong {
  background: rgba(231, 76, 60, 0.12);
  color: #E74C3C;
  border: 1px solid rgba(231, 76, 60, 0.25);
}

/* ═══════════════════════════════════════════════════════
   梅花易数 — 三卦横排可视化（本卦→互卦→变卦）
   ═══════════════════════════════════════════════════════ */
.mh-trigua-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
}
.mh-trigua-card {
  flex: 1;
  padding: 16px 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.3s;
}
.mh-trigua-card:hover {
  background: rgba(255, 255, 255, 0.04);
}
.mh-trigua-card-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 1px;
}
.mh-trigua-card-label.ti-label { color: #60a5fa; }
.mh-trigua-card-label.yong-label { color: #a78bfa; }
.mh-trigua-card-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--div-text-primary);
  margin-bottom: 8px;
}
.mh-trigua-arrow {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--div-text-tertiary);
  font-size: 16px;
  flex-shrink: 0;
}
.mh-trigua-arrow i { opacity: 0.5; }

/* 爻线可视化 */
.mh-yao-lines {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  align-items: center;
  padding: 8px 0;
}
.mh-yao-line {
  position: relative;
  height: 4px;
  width: 48px;
  border-radius: 2px;
  transition: all 0.3s;
}
.mh-yao-line.yang {
  background: var(--div-text-secondary);
}
.mh-yao-line.yin {
  display: flex;
  gap: 6px;
  background: transparent;
}
.mh-yao-line.yin span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--div-text-secondary);
}
/* 动爻高亮 */
.mh-yao-line.dong {
  position: relative;
}
.mh-yao-line.dong::after {
  content: '○';
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--div-gold);
  animation: mh-dong-pulse 1.5s ease-in-out infinite;
}
@keyframes mh-dong-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; text-shadow: 0 0 6px rgba(232, 160, 6, 0.5); }
}
/* 体/用色标 */
.mh-yao-line.ti-mark { box-shadow: -6px 0 0 0 rgba(96, 165, 250, 0.5); }
.mh-yao-line.yong-mark { box-shadow: -6px 0 0 0 rgba(167, 139, 250, 0.5); }
.mh-yao-line.yin.ti-mark span:first-child { box-shadow: -6px 0 0 0 rgba(96, 165, 250, 0.5); }
.mh-yao-line.yin.yong-mark span:first-child { box-shadow: -6px 0 0 0 rgba(167, 139, 250, 0.5); }

/* ═══════════════════════════════════════════════════════
   梅花易数 — 体用五行关系（增强版）
   ═══════════════════════════════════════════════════════ */
.mh-tiyong-extended {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mh-tiyong-ext-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}
.mh-tiyong-ext-label {
  color: var(--div-text-tertiary);
  font-size: 11px;
  white-space: nowrap;
}
.mh-tiyong-ext-value {
  font-weight: 600;
  font-size: 12px;
}

/* 卦气徽章 */
.mh-guaqi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.mh-guaqi-badge.wang { background: rgba(46, 204, 113, 0.15); color: #2ECC71; border: 1px solid rgba(46, 204, 113, 0.25); }
.mh-guaqi-badge.xiang { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.25); }
.mh-guaqi-badge.xiu { background: rgba(149, 165, 166, 0.15); color: #95A5A6; border: 1px solid rgba(149, 165, 166, 0.25); }
.mh-guaqi-badge.qiu { background: rgba(230, 126, 34, 0.15); color: #E67E22; border: 1px solid rgba(230, 126, 34, 0.25); }
.mh-guaqi-badge.si { background: rgba(231, 76, 60, 0.15); color: #E74C3C; border: 1px solid rgba(231, 76, 60, 0.25); }

/* ═══════════════════════════════════════════════════════
   梅花易数 — 万物类象卡片
   ═══════════════════════════════════════════════════════ */
.mh-leixiang-section {
  margin-bottom: 12px;
}
.mh-leixiang-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mh-leixiang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mh-leixiang-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--div-text-secondary);
  transition: all 0.2s;
}
.mh-leixiang-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
.mh-leixiang-item i {
  font-size: 14px;
  color: var(--div-text-tertiary);
  flex-shrink: 0;
}
.mh-leixiang-item.ti i { color: #60a5fa; }
.mh-leixiang-item.yong i { color: #a78bfa; }

/* ═══════════════════════════════════════════════════════
   梅花易数 — 响应式适配
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .mh-trigua-row {
    flex-direction: column;
    gap: 8px;
  }
  .mh-trigua-arrow {
    justify-content: center;
    padding: 4px 0;
    transform: rotate(90deg);
  }
  .mh-trigua-card {
    flex: none;
  }
  .mh-leixiang-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mh-tiyong-extended {
    grid-template-columns: 1fr;
  }
  .mh-hero-card {
    padding: 24px 16px 20px;
  }
  .mh-taiji-stage {
    min-height: 280px;
    padding: 24px 16px;
    border-radius: 16px;
  }
  .mh-fazhen-formation {
    width: 220px;
    height: 220px;
  }
  .mh-fazhen-taiji {
    width: 56px;
    height: 56px;
  }
}

/* ═══════════════════════════════════════════════════
   梅花易数增强样式 — 排盘级展示
   ═══════════════════════════════════════════════════ */

/* 信息概要条（与六爻 div-paipan-info-bar 齐平） */
.mh-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 12px;
}
.mh-info-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--div-text-secondary);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  white-space: nowrap;
}
.mh-info-tag i { font-size: 13px; }
.mh-guaqi-badge-sm {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.mh-guaqi-badge-sm.wang { background: rgba(46, 204, 113, 0.15); color: #2ECC71; }
.mh-guaqi-badge-sm.xiang { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.mh-guaqi-badge-sm.xiu { background: rgba(149, 165, 166, 0.15); color: #95A5A6; }
.mh-guaqi-badge-sm.qiu { background: rgba(230, 126, 34, 0.15); color: #E67E22; }
.mh-guaqi-badge-sm.si { background: rgba(231, 76, 60, 0.15); color: #E74C3C; }

/* 英雄卡起卦信息 */
.mh-hero-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--div-text-tertiary);
}
.mh-hero-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mh-hero-meta i { font-size: 12px; color: #a78bfa; }

/* 排盘级布局 — 本卦排盘 + 互/变卦侧栏 */
.mh-paipan-compare {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.mh-paipan-main {
  flex: 1.2;
  min-width: 0;
}
.mh-paipan-side {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.mh-paipan-header {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mh-paipan-gua-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--div-text-primary);
  letter-spacing: 2px;
}
.mh-paipan-gua-sub {
  font-size: 12px;
  color: var(--div-text-tertiary);
  margin-top: 4px;
}
.mh-paipan-wx-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.mh-paipan-wx-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  background: rgba(255, 255, 255, 0.03);
}

/* 排盘爻行 */
.mh-paipan-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  animation: revealIn 0.4s ease-out both;
}
.mh-paipan-row:hover { background: rgba(255, 255, 255, 0.04); }
.mh-paipan-row.is-dong { background: rgba(231, 76, 60, 0.06); }
.mh-paipan-label {
  font-size: 10px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.mh-paipan-label.ti { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.mh-paipan-label.yong { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.mh-paipan-yaoname {
  font-size: 11px;
  color: var(--div-text-tertiary);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.mh-paipan-yao {
  flex: 1;
  min-width: 0;
}
.mh-paipan-guaname {
  font-size: 11px;
  color: var(--div-text-secondary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.mh-paipan-dong-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #E74C3C;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.12);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
.mh-paipan-dong-badge i { font-size: 11px; }
.mh-paipan-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.2), transparent);
  margin: 4px 0;
}

/* 侧栏互/变卦卡片 */
.mh-paipan-side-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s;
}
.mh-paipan-side-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.2);
}
.mh-paipan-side-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  margin-bottom: 4px;
}
.mh-paipan-side-hint {
  font-size: 10px;
  color: var(--div-text-tertiary);
  opacity: 0.6;
}
.mh-paipan-side-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--div-text-primary);
  margin-bottom: 8px;
}
.mh-paipan-side-yao {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  margin-bottom: 8px;
}
.mh-paipan-side-yao .mh-yao-line {
  height: 3px;
  width: 80%;
}
.mh-paipan-side-yao .mh-yao-line.yin span {
  height: 3px;
}
.mh-paipan-side-wx {
  font-size: 11px;
}
.mh-paipan-side-arrow {
  display: flex;
  justify-content: center;
  color: var(--div-text-tertiary);
  font-size: 14px;
  opacity: 0.5;
}

/* 五行全景图 */
.mh-wuxing-panorama {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 8px;
}
.mh-wuxing-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--node-color, rgba(255,255,255,0.1));
  border-radius: 14px;
  min-width: 100px;
  transition: all 0.3s;
  position: relative;
}
.mh-wuxing-node::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  background: var(--node-color, #a78bfa);
  opacity: 0.05;
  z-index: 0;
}
.mh-wuxing-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.mh-wuxing-node > * { position: relative; z-index: 1; }
.mh-wuxing-node-icon {
  font-size: 28px;
  opacity: 0.9;
}
.mh-wuxing-node-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--div-text-primary);
}
.mh-wuxing-node-wx {
  font-size: 11px;
  color: var(--node-color, var(--div-text-secondary));
  font-weight: 600;
}
.mh-wuxing-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}
.mh-wuxing-relation-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}
.mh-wuxing-arrow {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  opacity: 0.6;
  animation: arrowPulse 2s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* 五行关系环 */
.mh-wuxing-ring {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mh-wuxing-ring-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.mh-wuxing-ring-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.mh-wuxing-ring-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mh-wuxing-ring-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  font-weight: 600;
}
.mh-wuxing-ring-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.mh-wuxing-ring-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bar-color, #a78bfa);
  opacity: 0.5;
}

/* 万物类象增强 — 带标签名 */
.mh-leixiang-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}
.mh-leixiang-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.mh-leixiang-item i {
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}
.mh-leixiang-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mh-leixiang-label {
  font-size: 10px;
  color: var(--div-text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mh-leixiang-value {
  font-size: 12px;
  color: var(--div-text-secondary);
  line-height: 1.4;
}
.mh-leixiang-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 卦辞双栏对比 */
.mh-guaci-compare {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.mh-guaci-col {
  flex: 1;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.mh-guaci-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mh-guaci-col-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.mh-guaci-col-badge.main {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.mh-guaci-col-badge.bian {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
}
.mh-guaci-col-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--div-text-primary);
}
.mh-guaci-advice {
  font-size: 12px;
  color: var(--div-text-secondary);
  line-height: 1.7;
  margin-top: 10px;
}
.mh-guaci-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 2px;
}
.mh-guaci-divider-line {
  width: 1px;
  flex: 1;
  background: linear-gradient(180deg, transparent, rgba(167, 139, 250, 0.2), transparent);
}
.mh-guaci-divider i {
  font-size: 12px;
  color: var(--div-text-tertiary);
  opacity: 0.5;
}

/* 起卦数理详情 */
.mh-qigua-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mh-qigua-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.mh-qigua-detail-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  font-weight: 600;
  white-space: nowrap;
  width: 64px;
  flex-shrink: 0;
}
.mh-qigua-detail-value {
  font-size: 12px;
  color: var(--div-text-secondary);
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* 响应式优化 */
@media (max-width: 600px) {
  .mh-paipan-compare {
    flex-direction: column;
  }
  .mh-paipan-side {
    flex-direction: row;
    gap: 8px;
  }
  .mh-paipan-side-card {
    flex: 1;
  }
  .mh-paipan-side-arrow {
    align-self: center;
    transform: rotate(-90deg);
  }
  .mh-wuxing-panorama {
    padding: 12px 4px;
    gap: 8px;
  }
  .mh-wuxing-node {
    padding: 12px 14px;
    min-width: 80px;
  }
  .mh-wuxing-node-icon { font-size: 22px; }
  .mh-wuxing-ring {
    grid-template-columns: 1fr;
  }
  .mh-guaci-compare {
    flex-direction: column;
  }
  .mh-guaci-divider {
    flex-direction: row;
    padding: 2px 0;
  }
  .mh-guaci-divider-line {
    width: auto;
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.2), transparent);
  }
  .mh-info-bar {
    gap: 6px;
    padding: 10px 12px;
  }
  .mh-info-tag { font-size: 11px; padding: 3px 8px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .mh-paipan-row { animation: none; opacity: 1; }
  .mh-wuxing-arrow { animation: none; opacity: 0.6; }
  .mh-paipan-dong-badge { animation: none; }
  .mh-fazhen-formation { animation: none !important; opacity: 1; transform: scale(1) rotate(0deg); }
  .mh-fazhen-ring { animation: none; }
  .mh-fazhen-taiji { animation: none !important; }
  .mh-fazhen-node { animation: none !important; transition: none; }
  .mh-orbit-particle,
  .mh-burst-particle,
  .mh-fade-particle { display: none; }
  .mh-taiji-stage.screen-shake { animation: none; }
}

@keyframes revealIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 英雄卡「暖玉流金」
   ═══════════════════════════════════════════════════ */
.qm-hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 32px 24px 28px;
  margin: 0 16px 20px;
  background: linear-gradient(135deg, #fffbf5 0%, #fdf2e0 30%, #fef8ef 55%, #fffdfb 80%, #fefaf3 100%);
  border: 1px solid rgba(212, 168, 80, 0.2);
  text-align: center;
  box-shadow: 0 4px 24px rgba(180, 140, 60, 0.06), 0 1px 6px rgba(180, 140, 60, 0.04);
}
.qm-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(232, 190, 80, 0.10) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(212, 149, 12, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, rgba(245, 220, 160, 0.06) 0%, transparent 40%);
  animation: qmHeroShimmer 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes qmHeroShimmer {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.02); }
}
.qm-hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 168, 80, 0.15) 0%, rgba(232, 190, 100, 0.05) 40%, transparent 70%);
  animation: qmGlow 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes qmGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.9; }
}
.qm-hero-content {
  position: relative;
  z-index: 1;
}
.qm-hero-bagua {
  font-size: 42px;
  margin-bottom: 8px;
  opacity: 0.35;
  filter: drop-shadow(0 0 12px rgba(212, 168, 80, 0.35));
  animation: qmBaguaSpin 20s linear infinite;
}
@keyframes qmBaguaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.qm-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: #8b6914;
  text-shadow: 0 0 24px rgba(184, 134, 11, 0.12);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.qm-hero-sub {
  font-size: 13px;
  color: rgba(120, 90, 50, 0.55);
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.qm-hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.qm-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  color: #5c4a2a;
  background: rgba(255, 252, 245, 0.75);
  border: 1px solid rgba(212, 168, 80, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  transition: all 0.3s;
}
.qm-hero-tag:hover {
  background: rgba(255, 248, 230, 0.85);
  border-color: rgba(212, 168, 80, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 168, 80, 0.1);
}
.qm-hero-tag i {
  font-size: 13px;
  color: #b8860b;
}

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 概要信息条
   ═══════════════════════════════════════════════════ */
.qm-info-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(212, 168, 80, 0.04);
  border: 1px solid rgba(212, 168, 80, 0.10);
}
.qm-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--div-text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
.qm-info-tag i {
  font-size: 13px;
  color: #b8860b;
}
.qm-info-tag b {
  color: #e8a006;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 方位吉凶速览
   ═══════════════════════════════════════════════════ */
.qm-fengshui-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.qm-fs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, border-color 0.2s;
}
.qm-fs-item:hover {
  transform: translateY(-2px);
  border-color: var(--fs-color, rgba(255, 255, 255, 0.15));
}
.qm-fs-dir {
  font-size: 13px;
  font-weight: 600;
  color: var(--div-text-primary);
}
.qm-fs-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.qm-fs-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease-out;
}
.qm-fs-level {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 次要用神宫位高亮
   ═══════════════════════════════════════════════════ */
.div-qimen-cell.qm-secondary {
  border-color: rgba(96, 165, 250, 0.35) !important;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.15), inset 0 0 8px rgba(96, 165, 250, 0.05);
  animation: qmSecondaryPulse 2.5s ease-in-out infinite;
}
@keyframes qmSecondaryPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(96, 165, 250, 0.15), inset 0 0 8px rgba(96, 165, 250, 0.05); }
  50% { box-shadow: 0 0 20px rgba(96, 165, 250, 0.3), inset 0 0 12px rgba(96, 165, 250, 0.1); }
}

/* 九宫格五行背景微色 */
.div-qimen-cell[data-gong="1"] { background: linear-gradient(135deg, rgba(52, 152, 219, 0.06), transparent); }
.div-qimen-cell[data-gong="2"] { background: linear-gradient(135deg, rgba(139, 105, 20, 0.06), transparent); }
.div-qimen-cell[data-gong="3"] { background: linear-gradient(135deg, rgba(39, 174, 96, 0.06), transparent); }
.div-qimen-cell[data-gong="4"] { background: linear-gradient(135deg, rgba(39, 174, 96, 0.06), transparent); }
.div-qimen-cell[data-gong="6"] { background: linear-gradient(135deg, rgba(243, 156, 18, 0.06), transparent); }
.div-qimen-cell[data-gong="7"] { background: linear-gradient(135deg, rgba(243, 156, 18, 0.06), transparent); }
.div-qimen-cell[data-gong="8"] { background: linear-gradient(135deg, rgba(139, 105, 20, 0.06), transparent); }
.div-qimen-cell[data-gong="9"] { background: linear-gradient(135deg, rgba(231, 76, 60, 0.06), transparent); }

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 分事选择器样式（复用tianji-qtype-*）
   ═══════════════════════════════════════════════════ */

/* ── 四层盘面图例 ── */
.qm-layer-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--div-text-tertiary);
}
.qm-layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ── 九宫格四层视觉增强 ── */
.div-qm-layer {
  line-height: 1.3;
}
.qm-layer-shen {
  font-size: 11px;
  color: #b07df0;
  font-weight: 500;
  margin-bottom: 2px;
}
.qm-layer-men {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}
.qm-layer-men.ji { color: #2ECC71; }
.qm-layer-men.xiong { color: #E74C3C; }
.qm-layer-men.zhong { color: var(--div-text-secondary); }
.qm-layer-star {
  font-size: 11px;
  color: #e8a006;
  margin-bottom: 2px;
}
.div-qm-bottom strong { font-weight: 600; }

/* ── Tooltip行样式 ── */
.qm-tip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 12px;
  line-height: 1.6;
}
.qm-tip-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  min-width: 36px;
}

/* ── 英雄卡标签颜色变体 ── */
.qm-hero-tag.tag-zhifu {
  background: rgba(232, 160, 6, 0.12);
  border-color: rgba(232, 160, 6, 0.25);
  color: #92600a;
}
.qm-hero-tag.tag-zhifu i { color: #b8860b; }
.qm-hero-tag.tag-zhishi {
  background: rgba(139, 105, 20, 0.08);
  border-color: rgba(139, 105, 20, 0.18);
  color: #6b5200;
}
.qm-hero-tag.tag-zhishi i { color: #8b6914; }
.qm-hero-tag.tag-day {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.2);
  color: #991b1b;
}
.qm-hero-tag.tag-day i { color: #dc2626; }
.qm-hero-tag.tag-hour {
  background: rgba(39, 174, 96, 0.1);
  border-color: rgba(39, 174, 96, 0.2);
  color: #166534;
}
.qm-hero-tag.tag-hour i { color: #16a34a; }

/* ── 概要条颜色分类 ── */
.qm-info-kong b { color: #E74C3C !important; }
.qm-info-ma b { color: #F39C12 !important; }
.qm-info-geju b { color: #a78bfa !important; }
.qm-info-ff b { color: #6B7280 !important; }

/* ── 用神定位卡片 ── */
.qm-ys-item {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}
.qm-ys-item:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.qm-ys-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  display: block;
  margin-bottom: 3px;
}
.qm-ys-value {
  font-size: 14px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   奇门遁甲 — 响应式适配
   ═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .qm-hero-card { padding: 24px 16px 20px; margin: 0 8px 16px; }
  .qm-hero-bagua { font-size: 32px; }
  .qm-hero-title { font-size: 18px; }
  .qm-hero-sub { font-size: 12px; }
  .qm-hero-tags { gap: 6px; }
  .qm-hero-tag { font-size: 11px; padding: 4px 8px; }
  .qm-info-bar { gap: 6px; padding: 8px; }
  .qm-info-tag { font-size: 11px; padding: 3px 8px; }
  .qm-fengshui-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .qm-fs-item { padding: 8px 2px; }
  .qm-fs-dir { font-size: 12px; }
  .qm-fs-level { font-size: 10px; }
}
@media (max-width: 380px) {
  .qm-hero-card { padding: 20px 12px 16px; border-radius: 16px; }
  .qm-hero-title { font-size: 16px; }
  .qm-fengshui-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .qm-hero-card::before { animation: none; }
  .qm-hero-glow { animation: none; }
  .qm-hero-bagua { animation: none; }
  .div-qimen-cell.qm-secondary { animation: none; }
}

/* ═══════════════════════════════════════════════════
   天机问卦 — 高级选择界面 (dms- namespace)
 * ══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   梅花易数 — 问题校验引导样式
   ═══════════════════════════════════════════════════ */

/* 输入框晃动动画 */
@keyframes mhQuestionShake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}
.mh-question-shake {
  animation: mhQuestionShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* 输入框高亮 — 柔和紫金边框 */
.mh-question-highlight {
  border-color: rgba(139, 92, 246, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12), 0 0 16px rgba(139, 92, 246, 0.08) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 友善 Toast 提醒 */
.mh-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 10000;
  padding: 12px 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 14px;
  font-weight: 500;
  color: #5b4cc7;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}
.mh-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════
   梅花易数 — 英雄卡用户问题展示
   ═══════════════════════════════════════════════════ */
.mh-hero-question {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.04);
  border: 1px dashed rgba(139, 92, 246, 0.15);
  text-align: left;
}
.mh-hero-question-label {
  font-size: 11px;
  color: var(--div-text-tertiary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.mh-hero-question-label i {
  font-size: 13px;
  color: #a78bfa;
}
.mh-hero-question-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--div-text-primary);
  line-height: 1.7;
  margin: 0;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   梅花易数 — 数字输入优化
   ═══════════════════════════════════════════════════ */
.mh-num-input {
  border-radius: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.mh-num-input:focus {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

/* 换一组随机数按钮 hover */
#btn-meihua-refresh-nums:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.25);
}

/* 响应式：toast 在小屏上缩小间距 */
@media (max-width: 480px) {
  .mh-toast {
    top: 40px;
    padding: 10px 18px;
    font-size: 13px;
    border-radius: 12px;
  }
  .mh-hero-question {
    padding: 10px 12px;
  }
  .mh-hero-question-text {
    font-size: 13px;
  }
}

/* ── 沉浸式头部 ── */
.dms-header {
  text-align: center;
  padding: 44px 20px 20px;
  position: relative;
}
.dms-header-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(108,92,231,0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: dms-glow-pulse 4s ease-in-out infinite;
}
@keyframes dms-glow-pulse {
  0%,100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%     { opacity: 1; transform: translateX(-50%) scale(1.15); }
}
.dms-header-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  position: relative;
  box-shadow: 0 8px 32px rgba(108,92,231,0.3);
  overflow: hidden;
}
.dms-icon-ring {
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  border: 1.5px solid rgba(108,92,231,0.25);
  animation: dms-ring-spin 12s linear infinite;
  border-top-color: rgba(232,160,6,0.4);
  border-right-color: transparent;
}
@keyframes dms-ring-spin {
  to { transform: rotate(360deg); }
}
.dms-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--div-text-primary);
  margin: 0 0 6px;
  letter-spacing: 2px;
}
.dms-subtitle {
  font-size: 13px;
  color: var(--div-text-secondary);
  margin: 0 0 16px;
}
.dms-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.dms-divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--div-gold);
  opacity: 0.5;
}
.dms-divider-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,160,6,0.3), transparent);
}
.dms-divider-icon {
  font-size: 14px;
  color: var(--div-gold);
  opacity: 0.5;
}

/* ── 八字提示条 ── */
.dms-bazi-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(232,160,6,0.05);
  border: 1px solid rgba(232,160,6,0.1);
}
.dms-bazi-hint i {
  color: var(--div-gold);
  flex-shrink: 0;
  font-size: 15px;
}
.dms-bazi-hint span {
  font-size: 12px;
  color: var(--div-text-secondary);
  flex: 1;
}
.dms-bazi-hint a {
  font-size: 12px;
  color: var(--div-gold);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}
.dms-bazi-hint a:hover { opacity: 0.8; }

/* ── Hero 主打卡片 ── */
.dms-hero-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 16px;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), box-shadow 0.4s;
  border: 1px solid rgba(232,160,6,0.15);
}
.dms-hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(232,160,6,0.15);
}
.dms-hero-card:active {
  transform: translateY(-2px) scale(0.99);
}
.dms-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,135,58,0.08), rgba(232,160,6,0.04));
  pointer-events: none;
}
.dms-hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(232,160,6,0.1), transparent 60%);
  animation: dms-hero-orb 6s ease-in-out infinite;
}
@keyframes dms-hero-orb {
  0%,100% { transform: translate(0,0) scale(1); opacity: 0.5; }
  50%     { transform: translate(-20px,20px) scale(1.2); opacity: 0.8; }
}
.dms-hero-inner {
  position: relative;
  z-index: 1;
  padding: 24px;
}
.dms-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.dms-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(232,160,6,0.3);
  position: relative;
}
.dms-hero-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 19px;
  border: 1.5px dashed rgba(255,255,255,0.15);
  animation: dms-ring-spin 10s linear infinite reverse;
}
.dms-hero-info { flex: 1; min-width: 0; }
.dms-hero-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.dms-hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--div-text-primary);
  margin: 0;
}
.dms-hero-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  font-weight: 600;
  white-space: nowrap;
}
.dms-hero-desc {
  font-size: 13px;
  color: var(--div-text-secondary);
  line-height: 1.6;
  margin: 0;
}
.dms-hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.dms-hero-feature {
  font-size: 11px;
  color: var(--div-gold);
  background: rgba(232,160,6,0.06);
  border: 1px solid rgba(232,160,6,0.12);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dms-hero-feature i { font-size: 12px; }
.dms-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(232,160,6,0.08);
}
.dms-hero-quote {
  font-size: 12px;
  color: var(--div-text-tertiary);
  font-style: italic;
  font-family: 'Noto Serif SC', serif;
}
.dms-hero-enter {
  font-size: 13px;
  font-weight: 600;
  color: var(--div-gold);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.3s;
}
.dms-hero-card:hover .dms-hero-enter { gap: 8px; }

/* ── 三法子卡片网格 ── */
.dms-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dms-sub-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 14px;
  cursor: pointer;
  background: var(--div-glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--div-glass-border);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.dms-sub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border-color: rgba(108,92,231,0.15);
}
.dms-sub-card:active {
  transform: translateY(-1px) scale(0.98);
}
.dms-sub-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.dms-sub-card:hover .dms-sub-glow { opacity: 1; }
.dms-sub-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 0.3s;
}
.dms-sub-card:hover .dms-sub-icon { transform: scale(1.08); }
.dms-sub-body { width: 100%; }
.dms-sub-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.dms-sub-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--div-text-primary);
}
.dms-sub-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid;
  font-weight: 600;
  white-space: nowrap;
}
.dms-sub-desc {
  font-size: 11px;
  color: var(--div-text-secondary);
  line-height: 1.5;
  margin: 0 0 8px;
}
.dms-sub-brief {
  font-size: 10px;
  color: var(--div-text-tertiary);
  font-style: italic;
  font-family: 'Noto Serif SC', serif;
}
.dms-sub-arrow {
  display: none; /* 移动端显示 */
  color: var(--div-text-tertiary);
  font-size: 18px;
  transition: transform 0.2s;
}
.dms-sub-card:hover .dms-sub-arrow { transform: translateX(2px); }

/* ── 信息条 ── */
.dms-info-strip {
  margin-bottom: 40px;
}
.dms-last-record {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--div-glass-bg);
  border: 1px solid var(--div-glass-border);
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 10px;
}
.dms-last-record:hover {
  background: var(--div-glass-bg-hover);
  border-color: rgba(232,160,6,0.15);
}
.dms-last-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(232,160,6,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--div-gold);
  flex-shrink: 0;
}
.dms-last-body { flex: 1; min-width: 0; }
.dms-last-label {
  display: block;
  font-size: 10px;
  color: var(--div-text-tertiary);
  margin-bottom: 2px;
}
.dms-last-text {
  display: block;
  font-size: 13px;
  color: var(--div-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dms-last-arrow {
  color: var(--div-text-tertiary);
  font-size: 16px;
}
.dms-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dms-stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--div-text-tertiary);
}
.dms-stat-badge i {
  font-size: 14px;
  color: var(--div-gold);
  opacity: 0.6;
}
.dms-stat-badge strong {
  color: var(--div-gold);
  font-weight: 700;
}
.dms-history-btn {
  font-size: 12px;
  color: var(--div-gold);
  background: rgba(232,160,6,0.06);
  border: 1px solid rgba(232,160,6,0.12);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s;
}
.dms-history-btn:hover {
  background: rgba(232,160,6,0.1);
  border-color: rgba(232,160,6,0.2);
}

/* ── 响应式 ── */
@media (max-width: 640px) {
  .dms-sub-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dms-sub-card {
    flex-direction: row;
    text-align: left;
    padding: 14px;
    gap: 12px;
  }
  .dms-sub-icon {
    margin-bottom: 0;
    width: 40px;
    height: 40px;
    font-size: 18px;
    flex-shrink: 0;
  }
  .dms-sub-title-row { justify-content: flex-start; }
  .dms-sub-desc { margin-bottom: 4px; }
  .dms-sub-brief { display: none; }
  .dms-sub-arrow {
    display: block;
    flex-shrink: 0;
    margin-left: auto;
  }
  .dms-hero-inner { padding: 18px 16px; }
  .dms-hero-icon { width: 48px; height: 48px; font-size: 22px; }
  .dms-hero-title { font-size: 18px; }
  .dms-hero-desc { font-size: 12px; }
  .dms-hero-features { gap: 6px; }
  .dms-hero-feature { font-size: 10px; padding: 3px 8px; }
  .dms-hero-quote { font-size: 11px; }
  .dms-title { font-size: 22px; }
}
@media (max-width: 380px) {
  .dms-hero-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dms-hero-features { flex-direction: column; gap: 4px; }
  .dms-hero-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dms-header-icon { width: 58px; height: 58px; font-size: 24px; }
  .dms-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .dms-header-glow { animation: none; }
  .dms-icon-ring { animation: none; }
  .dms-hero-bg::before { animation: none; }
  .dms-hero-icon::after { animation: none; }
}

