/* ============================================================
   通玄 TONGXUAN · 占星 zhanxing.css
   西方本命盘（SVG 星轮） × 印度吠陀盘（South Indian 方盘）
   颜色一律走 token 或金 / 朱砂 rgba —— 换肤全靠 token 覆盖
   ============================================================ */

/* [hidden] 守卫：确保 hidden 属性优先于任何 display 声明 */
[hidden] { display: none !important; }

/* ---------- 页头点缀 ---------- */
.zx-hero-divider { animation: pageUp 1s var(--ease-out) 0.28s both; }

/* ================= 第一幕 · 星帖 ================= */
.zx-entry { padding-top: 72px; }

/* ================= 第二幕 · 星盘呈现 ================= */
.zx-chart {
  padding-top: 40px;
  border-top: 1px solid rgba(44, 42, 36, 0.08);
}
.zx-chart .section-head { margin-bottom: 52px; }
.zx-summary { letter-spacing: 0.1em; }
.zx-badge-row {
  margin-top: 16px;
  display: flex; justify-content: center; align-items: center;
  gap: 10px; flex-wrap: wrap;
}

/* ========== 西方 · 本命盘星轮 ========== */
.zx-wheel-card {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(184, 145, 75, 0.55);
  background:
    radial-gradient(ellipse 120% 100% at 50% -20%, rgba(212, 175, 106, 0.14), transparent 55%),
    linear-gradient(155deg, var(--ink-800), var(--ink-950) 82%);
  box-shadow: 0 26px 64px rgba(44, 42, 36, 0.22), inset 0 1px 0 rgba(212, 175, 106, 0.2);
}
.zx-wheel-card::after {
  content: "";
  position: absolute; inset: 9px;
  border: 1px solid rgba(212, 175, 106, 0.24);
  border-radius: calc(var(--radius-lg) - 9px);
  pointer-events: none;
}
.zx-wheel svg { width: 100%; height: auto; display: block; }

/* —— 星轮线条与文字（全部走 CSS class，token 可换肤） —— */
.zxw-ring       { fill: none; stroke: rgba(212, 175, 106, 0.38); stroke-width: 1; }
.zxw-ring-outer { fill: none; stroke: rgba(212, 175, 106, 0.6);  stroke-width: 1.4; }
.zxw-ring-soft  { fill: none; stroke: rgba(212, 175, 106, 0.2);  stroke-width: 0.8; }
.zxw-band       { fill: none; stroke: rgba(212, 175, 106, 0.05); stroke-width: 36; }
.zxw-heart      { fill: rgba(212, 175, 106, 0.035); stroke: none; }
.zxw-tick       { stroke: rgba(212, 175, 106, 0.5);  stroke-width: 1; }
.zxw-tick-minor { stroke: rgba(212, 175, 106, 0.22); stroke-width: 0.7; }
.zxw-sign {
  font-family: var(--font-serif);
  font-size: 19px;
  fill: var(--gold-400);
}
.zxw-house      { stroke: rgba(212, 175, 106, 0.28); stroke-width: 0.8; }
.zxw-house-axis { stroke: rgba(212, 175, 106, 0.62); stroke-width: 1.7; }
.zxw-house-num {
  font-family: var(--font-serif);
  font-size: 10.5px;
  fill: var(--text-low);
}
.zxw-planet {
  font-family: var(--font-serif);
  font-size: 16px;
  fill: var(--gold-300);
}
.zxw-pl-tick { stroke: rgba(212, 175, 106, 0.5); stroke-width: 1; }
.zxw-retro {
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 700;
  fill: var(--cinnabar);
}
.zxw-asp { fill: none; stroke-width: 1.2; stroke-linecap: round; }
.zxw-asp-soft { stroke: rgba(212, 175, 106, 0.55); }
.zxw-asp-hard { stroke: rgba(184, 73, 62, 0.5); }
.zxw-center      { fill: rgba(212, 175, 106, 0.07); stroke: rgba(212, 175, 106, 0.5); stroke-width: 1; }
.zxw-center-line {
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  fill: var(--text-mid);
}
.zxw-center-line tspan.k { fill: var(--gold-400); font-weight: 600; }

/* —— 盘面元素 stagger 入场 —— */
.zxw-anim {
  animation: zxwIn 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms + 0.2s);
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes zxwIn {
  from { opacity: 0; transform: scale(0.55); }
  to   { opacity: 1; transform: scale(1); }
}
.zxw-asp {
  animation: zxwFade 0.8s ease both;
  animation-delay: calc(var(--i, 0) * 90ms + 0.9s);
}
@keyframes zxwFade { from { opacity: 0; } to { opacity: 1; } }

/* ========== 盘下双表（行星 / 相位） ========== */
.zx-panels {
  max-width: 980px;
  margin: 44px auto 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
  align-items: start;
}
.zx-panel {
  padding: 24px 26px 20px;
  background: rgba(250, 247, 239, 0.78);
  border: 1px solid rgba(44, 42, 36, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(44, 42, 36, 0.05);
}
.zx-panel-title {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--paper-ink);
}
.zx-panel-note {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--paper-ink-soft);
}
.zx-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 114, 58, 0.4) transparent;
}
.zx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  letter-spacing: 0.04em;
}
.zx-table th {
  padding: 8px 10px;
  font-family: var(--font-serif);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.2em;
  text-align: left;
  color: var(--gold-700);
  border-bottom: 1px solid rgba(150, 114, 58, 0.4);
  white-space: nowrap;
}
.zx-table td {
  padding: 9px 10px;
  color: var(--paper-ink);
  border-bottom: 1px dashed rgba(150, 114, 58, 0.22);
  white-space: nowrap;
}
.zx-table tr:last-child td { border-bottom: none; }
.zx-table .num { font-variant-numeric: tabular-nums; }
.zx-glyph-cell {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--gold-700);
}
.zx-retro { color: var(--cinnabar); font-weight: 600; }
.zx-dim { color: var(--paper-ink-soft); }
.zx-asp-type { font-family: var(--font-serif); font-weight: 600; }
.zx-asp-type.soft { color: var(--gold-700); }
.zx-asp-type.hard { color: var(--cinnabar); }
.zx-row {
  animation: zxRowIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + 0.15s);
}
@keyframes zxRowIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ========== 印度 · South Indian 方盘 ========== */
.rashi-wrap { max-width: 680px; margin-inline: auto; }
.rashi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(108px, auto);
  gap: 7px;
}
.rashi-cell {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px 9px 24px 10px;
  background: rgba(250, 247, 239, 0.85);
  border: 1px solid rgba(150, 114, 58, 0.4);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(44, 42, 36, 0.05);
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.35s var(--ease-out);
  animation: rashiIn 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + 0.1s);
}
.rashi-cell:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 145, 75, 0.75);
  box-shadow: 0 10px 22px rgba(120, 96, 50, 0.14);
}
@keyframes rashiIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.rashi-sign {
  position: absolute; top: 7px; right: 10px;
  font-family: var(--font-serif);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--paper-ink-soft);
}
.rashi-glyphmark {
  position: absolute; bottom: 4px; right: 9px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: rgba(150, 114, 58, 0.35);
  pointer-events: none;
}
.rashi-planets {
  display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 5px;
  flex-grow: 1;
}
.rashi-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px;
  padding: 0 4px;
  font-family: var(--font-serif);
  font-size: 13.5px; font-weight: 600;
  color: var(--gold-700);
  border: 1px solid rgba(150, 114, 58, 0.45);
  border-radius: 8px;
  background: rgba(212, 175, 106, 0.1);
}
/* Lagna 格：朱砂缎带 */
.rashi-cell.is-lagna {
  border-color: rgba(184, 73, 62, 0.65);
  box-shadow: 0 0 0 1px rgba(184, 73, 62, 0.25), 0 4px 14px rgba(150, 53, 44, 0.12);
}
.rashi-lagna {
  position: absolute; top: -1px; left: -1px;
  padding: 2px 10px 3px;
  font-family: var(--font-serif);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em;
  color: #f8ecd8;
  background: linear-gradient(155deg, var(--cinnabar), var(--cinnabar-deep));
  border-radius: 9px 0 9px 0;
  box-shadow: 0 3px 8px rgba(150, 53, 44, 0.35);
}
/* 中央 2×2 · 盘心 */
.rashi-center {
  grid-row: 2 / 4;
  grid-column: 2 / 4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 14px 12px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 106, 0.55);
  background:
    radial-gradient(ellipse 130% 130% at 50% -30%, rgba(212, 175, 106, 0.18), transparent 60%),
    linear-gradient(150deg, var(--ink-800), var(--ink-950));
  box-shadow: 0 12px 30px rgba(13, 20, 38, 0.28), inset 0 1px 0 rgba(212, 175, 106, 0.22);
  animation: rashiIn 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + 0.1s);
}
.rashi-center-title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.2em; text-indent: 0.2em;
  background: linear-gradient(160deg, var(--gold-300), var(--gold-500) 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.rashi-center-sub {
  font-size: 10px;
  letter-spacing: 0.3em; text-indent: 0.3em;
  color: var(--text-low);
}
.rashi-center-rows { margin-top: 9px; display: grid; gap: 4px; }
.rashi-center-row {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--text-mid);
}
.rashi-center-row b {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--gold-400);
  margin-right: 7px;
}

/* ========== Vimśottarī Daśā · 大运序列 ========== */
.dasha-panel { max-width: 680px; margin: 36px auto 0; }
.dasha-strip {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 114, 58, 0.4) transparent;
}
.dasha-strip:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }
.dasha-chip {
  flex-shrink: 0;
  min-width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 16px 10px;
  background: rgba(250, 247, 239, 0.6);
  border: 1px solid rgba(150, 114, 58, 0.45);
  border-radius: 12px;
  transition: transform 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s;
  animation: zxRowIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms + 0.25s);
}
.dasha-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 145, 75, 0.75);
  box-shadow: 0 8px 18px rgba(120, 96, 50, 0.14);
}
.dasha-lord {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 700;
  letter-spacing: 0.12em; text-indent: 0.12em;
  color: var(--paper-ink);
}
.dasha-years {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--paper-ink-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dasha-chip.on {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 60%, var(--gold-600));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(212, 175, 106, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.dasha-chip.on .dasha-lord { color: #241a08; }
.dasha-chip.on .dasha-years { color: #241a08; opacity: 0.72; }

/* ================= 减动效 ================= */
@media (prefers-reduced-motion: reduce) {
  .zx-hero-divider,
  .zxw-anim, .zxw-asp, .zx-row,
  .rashi-cell, .rashi-center, .dasha-chip {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* ================= 响应式 ================= */
@media (max-width: 960px) {
  .zx-panels { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .zx-entry { padding-top: 52px; }
  .zx-chart .section-head { margin-bottom: 40px; }
  .zx-wheel-card { padding: 12px; border-radius: var(--radius-md); }
  .zx-wheel-card::after { inset: 5px; border-radius: calc(var(--radius-md) - 5px); }
  .zx-panel { padding: 20px 16px 16px; }
  .zx-table { font-size: 12.5px; }
  .zx-table th, .zx-table td { padding: 7px 8px; }

  .rashi-grid { grid-auto-rows: minmax(76px, auto); gap: 5px; }
  .rashi-cell { padding: 23px 6px 18px 7px; border-radius: 8px; }
  .rashi-sign { font-size: 10px; top: 5px; right: 7px; }
  .rashi-glyphmark { font-size: 12px; bottom: 2px; right: 6px; }
  .rashi-chip { min-width: 21px; height: 21px; font-size: 11.5px; border-radius: 6px; gap: 0; }
  .rashi-planets { gap: 4px; }
  .rashi-lagna { padding: 1px 7px 2px; font-size: 9px; }
  .rashi-center { padding: 10px 8px; }
  .rashi-center-title { font-size: 14.5px; }
  .rashi-center-sub { font-size: 9px; }
  .rashi-center-rows { margin-top: 6px; gap: 2px; }
  .rashi-center-row { font-size: 10.5px; }
  .rashi-center-row b { margin-right: 4px; }

  .dasha-chip { min-width: 80px; padding: 9px 12px 8px; }
  .dasha-lord { font-size: 15px; }
}
