/* ============================================================
   通玄 TONGXUAN · 七政四余 qizheng.css
   页面两幕：录入生辰（星案）→ 命度 · 二十八宿横带 · 十一曜表（尾随 AI 深度解读入口）
   颜色仅取设计 token 及 base.css 既有的金 / 朱砂 / 纸墨 rgba，
   换肤全交 theme-xiu.css 的 token 覆盖。
   ============================================================ */

/* hidden 属性保险（避免被后续 display 规则覆盖） */
[hidden] { display: none !important; }

/* 锚点滚动让出固定导航 */
#chart { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ================= 页首（共享 .page-hero，仅补分隔饰入场） ================= */
.qz-hero-divider { animation: pageUp 1s var(--ease-out) 0.28s both; }

/* ================= 第一幕 · 星案表单 ================= */
.qz-entry { padding-top: 72px; }

/* ================= 第二幕 · 星案呈现 ================= */
.qz-chart {
  padding-top: 40px;
  border-top: 1px solid rgba(44, 42, 36, 0.08);
}
.qz-chart .section-head { margin-bottom: 52px; }
.qz-badge-row { margin-top: 16px; }

/* ---------- ① 命度卡：夜幕金框，衬线大字 ---------- */
.qz-mingdu {
  position: relative;
  max-width: 480px;
  margin-inline: auto;
  padding: 34px 30px 30px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 175, 106, 0.55);
  background:
    radial-gradient(ellipse 130% 120% at 50% -40%, rgba(212, 175, 106, 0.16), transparent 55%),
    linear-gradient(150deg, var(--ink-800), var(--ink-950) 85%);
  box-shadow:
    0 22px 52px rgba(44, 42, 36, 0.22),
    inset 0 1px 0 rgba(212, 175, 106, 0.22);
  overflow: hidden;
}
.qz-mingdu::after {  /* 内衬金色细框，星案双框感 */
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: calc(var(--radius-lg) - 7px);
  pointer-events: none;
}
.qz-mingdu-label {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-serif);
  font-size: 13px; letter-spacing: 0.42em; text-indent: 0.42em;
  color: var(--gold-500);
}
.qz-mingdu-label::before, .qz-mingdu-label::after {
  content: ""; width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}
.qz-mingdu-label::after { transform: scaleX(-1); }
.qz-mingdu-value {
  display: block;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 5.2vw, 50px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.14em; text-indent: 0.14em;
  background: linear-gradient(168deg, var(--gold-300) 8%, var(--gold-400) 38%, var(--gold-500) 62%, var(--gold-700) 95%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(212, 175, 106, 0.28));
}
.qz-mingdu-note {
  display: block;
  margin-top: 10px;
  font-size: 12.5px; letter-spacing: 0.16em;
  color: var(--text-low);
}

/* ---------- ② 二十八宿横带 ---------- */
.qz-band-wrap { max-width: 980px; margin: 48px auto 0; }
.qz-panel-title {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 16px; letter-spacing: 0.22em;
  color: var(--paper-ink);
}
.qz-panel-note {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--paper-ink-soft);
}
.qz-band-scroll {
  position: relative;
  margin-top: 18px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(184, 145, 75, 0.55);
  background:
    radial-gradient(ellipse 85% 100% at 50% -35%, rgba(212, 175, 106, 0.12), transparent 60%),
    linear-gradient(150deg, var(--ink-850), var(--ink-950));
  box-shadow:
    0 18px 44px rgba(44, 42, 36, 0.18),
    inset 0 1px 0 rgba(212, 175, 106, 0.16);
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 114, 58, 0.4) transparent;
}
.qz-band-scroll:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }
.qz-band {
  display: flex;
  min-width: 944px;
  padding: 16px 10px 0;
}
.qz-cell {
  position: relative;
  flex: 1 0 33px;
  min-width: 0;
  display: flex; flex-direction: column;
}
.qz-cell:not(:first-child) { border-left: 1px dashed rgba(212, 175, 106, 0.14); }

/* 曜标区：圆点在下、竖排曜名在上，自带 stagger 入场 */
.qz-cell-stars {
  position: relative;
  flex-grow: 1;
  min-height: 138px;
  display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}
.qz-star {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: qzStarIn 0.6s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
@keyframes qzStarIn {
  from { opacity: 0; transform: translateY(12px) scale(0.5); }
  to   { opacity: 1; transform: none; }
}
.qz-star-name {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-300);
}
.qz-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--gold-300), var(--gold-600));
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.16), 0 0 12px rgba(212, 175, 106, 0.6);
}
.qz-star.siyu .qz-star-name {
  color: var(--cinnabar);
  text-shadow: 0 0 10px rgba(184, 73, 62, 0.6);
}
.qz-star.siyu .qz-dot {
  background: linear-gradient(150deg, var(--cinnabar), var(--cinnabar-deep));
  box-shadow: 0 0 0 3px rgba(184, 73, 62, 0.16), 0 0 12px rgba(184, 73, 62, 0.55);
}

/* 宿名一行（每格上缘连成金色细线） */
.qz-cell-name {
  width: 100%;
  padding: 9px 0 10px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 15px; font-weight: 600;
  color: var(--text-mid);
  border-top: 1px solid rgba(212, 175, 106, 0.16);
}

/* 命度所在宿：金辉高亮 */
.qz-cell.is-ming {
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.12), rgba(212, 175, 106, 0.02));
}
.qz-cell.is-ming::after {  /* 命度垂线 */
  content: "";
  position: absolute;
  top: 40px; bottom: 42px; left: 50%;
  width: 1px;
  background: linear-gradient(180deg, rgba(212, 175, 106, 0.55), transparent);
  pointer-events: none;
}
.qz-cell.is-ming .qz-cell-stars::before {  /* 「命」印记 */
  content: "命";
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 21px; height: 21px;
  border: 1px solid rgba(212, 175, 106, 0.6);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 11px; font-weight: 700;
  color: var(--gold-300);
  background: rgba(212, 175, 106, 0.1);
}
.qz-cell.is-ming .qz-cell-name {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 60%, var(--gold-600));
  border-top-color: transparent;
  color: #241a08;
  font-weight: 700;
}

/* ---------- ③ 十一曜表（七政 / 四余 分组） ---------- */
.qz-tables {
  max-width: 980px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
  align-items: start;
}
.yao-panel {
  padding: 26px 28px 16px;
  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);
}
.yao-title {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 16px; letter-spacing: 0.22em;
  color: var(--paper-ink);
}
.yao-title-dot {
  align-self: center;
  width: 9px; height: 9px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.18);
}
.yao-panel--siyu .yao-title-dot {
  background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-deep));
  box-shadow: 0 0 0 3px rgba(184, 73, 62, 0.14);
}
.yao-title-note {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--paper-ink-soft);
}
.yao-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.yao-row {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 4px;
  border-top: 1px dashed rgba(150, 114, 58, 0.3);
  animation: qzRowIn 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 85ms);
  transition: background 0.3s;
}
.yao-row:first-child { border-top: none; }
.yao-row:hover { background: rgba(212, 175, 106, 0.07); }
@keyframes qzRowIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}

/* 曜名方印：七政金底 / 四余朱砂底 */
.yao-seal {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 10px;
  font-family: var(--font-serif);
  font-size: 15.5px; font-weight: 700;
  letter-spacing: 0.06em; text-indent: 0.06em;
}
.yao-seal.qizheng {
  color: #241a08;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 60%, var(--gold-600));
  box-shadow: 0 4px 12px rgba(212, 175, 106, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.yao-seal.siyu {
  color: #f8ecd8;
  background: linear-gradient(155deg, var(--cinnabar), var(--cinnabar-deep));
  box-shadow: 0 4px 12px rgba(150, 53, 44, 0.35), inset 0 0 0 1px rgba(248, 236, 216, 0.25);
}
.yao-xiu {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--paper-ink);
  white-space: nowrap;
}
.yao-du {
  font-size: 13px; letter-spacing: 0.08em;
  color: var(--paper-ink-soft);
  white-space: nowrap;
}
.yao-leader {
  flex: 1 1 14px;
  min-width: 14px;
  height: 1px;
  align-self: center;
  border-bottom: 1px dotted rgba(150, 114, 58, 0.4);
}
.yao-row .badge { flex-shrink: 0; }

/* ================= 动效尊重 ================= */
@media (prefers-reduced-motion: reduce) {
  .qz-hero-divider { animation: none; }
  .qz-star, .yao-row { animation: none; opacity: 1; transform: none; }
}

/* ================= 响应式 ================= */
@media (max-width: 960px) {
  .qz-tables { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .qz-entry { padding-top: 52px; }
  .qz-chart .section-head { margin-bottom: 44px; }
  .btn-cast { width: 100%; min-width: 0; }
  .qz-mingdu { padding: 28px 20px 24px; }
  .qz-band-wrap, .qz-tables { margin-top: 40px; }
  .qz-cell-stars { min-height: 126px; }
  .yao-panel { padding: 22px 18px 12px; }
  .yao-row { gap: 12px; }
  .yao-seal { width: 42px; height: 42px; font-size: 14px; border-radius: 9px; }
  .yao-xiu { font-size: 17px; }
}
