/* 灵算台 · 全局视觉（深墨底 + 金色点缀 + 水墨风 · 移动端优先 390px）
   动画只动 transform/opacity；prefers-reduced-motion 全量降级 */
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --bg: #0a0a0e;
  --bg1: #101218;
  --bg2: #161a22;
  --line: rgba(212, 175, 55, 0.28);
  --line-dim: rgba(212, 175, 55, 0.14);
  --gold: #d4af37;
  --gold-hi: #f0d78c;
  --red: #b03a2e;
  --tx: #e8e6df;
  --tx-dim: #b9b5a6;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 14px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
img, svg { vertical-align: middle; }
::selection { background: rgba(212, 175, 55, 0.3); }
:focus-visible { outline: 2px solid rgba(212, 175, 55, 0.7); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #262b36; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 水墨晕染背景（径向墨晕，静态无动画） */
.lz-ink {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(640px 460px at 88% -6%, rgba(212, 175, 55, 0.07), transparent 62%),
    radial-gradient(520px 420px at -8% 12%, rgba(96, 118, 156, 0.10), transparent 60%),
    radial-gradient(760px 520px at 50% 118%, rgba(212, 175, 55, 0.05), transparent 62%),
    radial-gradient(420px 360px at 70% 62%, rgba(38, 43, 54, 0.6), transparent 70%);
}
#lz-particles { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.lz-app {
  position: relative; z-index: 1; max-width: 960px; margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) 16px calc(64px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 首页 ---------- */
.lz-hero { text-align: center; padding: 16px 8px 10px; }
.lz-taiji { width: 52px; height: 52px; margin: 0 auto 8px; animation: lz-spin 60s linear infinite; }
.lz-taiji svg { display: block; width: 100%; height: 100%; }
.lz-title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  background: linear-gradient(180deg, #f5e2a8, #d4af37 62%, #b8912c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lz-subtitle {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0; font-size: 11px; color: var(--gold); letter-spacing: 0.2em; opacity: 0.9;
}
.lz-subtitle::before, .lz-subtitle::after {
  content: ""; width: 36px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}
.lz-subtitle::after { background: linear-gradient(90deg, var(--line), transparent); }

.lz-schools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 0 16px;
}
.lz-footer-note {
  margin: 0; text-align: center;
  font-size: 10px; letter-spacing: 0.16em; color: #8a8676;
}

/* ---------- 流派卡片（流光边框 / 悬浮光影 / 按下反馈） ---------- */
.lz-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 13px 10px 12px;
  min-height: 108px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: linear-gradient(180deg, rgba(32, 38, 52, 0.96), rgba(22, 26, 36, 0.96));
  color: var(--tx);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lz-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 22px rgba(212, 175, 55, 0.10);
}
.lz-card:active { transform: scale(0.97); }

/* ① 流光边框：conic-gradient 旋转描边 */
.lz-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle, 0deg),
    transparent 0 28%, var(--gold) 50%, var(--gold-hi) 56%, transparent 64% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.lz-card:hover::before, .lz-card:focus-visible::before, .lz-card.selected::before {
  opacity: 1;
  animation: lz-angle 3s linear infinite;
}
/* ⑤ 悬浮光影：radial 光斑跟随光标（--mx/--my 由 JS 写入，各卡独立） */
.lz-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(240, 215, 140, 0.11), transparent 62%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.lz-card:hover::after { opacity: 1; }

.lz-card-icon { display: flex; align-items: center; justify-content: center; min-height: 26px; font-size: 26px; line-height: 1; color: var(--gold); }
.lz-card-icon svg { width: 28px; height: 28px; }
.lz-card-name { font-family: var(--serif); font-size: 15px; letter-spacing: 0.14em; color: var(--gold-hi); }
.lz-card-tag { font-size: 10.5px; letter-spacing: 0.04em; color: var(--gold); opacity: 1; }
.lz-card-desc {
  font-size: 11px; line-height: 1.55; color: var(--tx-dim);
}
.lz-card-uses {
  font-size: 10px; line-height: 1.45; color: rgba(212, 175, 55, 0.7); letter-spacing: 0.02em;
}

/* 即将上线 / 禁用态 */
.lz-card-soon {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--red);
  border: 1px solid rgba(176, 58, 46, 0.5);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(176, 58, 46, 0.08);
}
.lz-card:disabled { opacity: 0.55; cursor: default; }
.lz-card:disabled:hover { transform: none; border-color: rgba(212, 175, 55, 0.20); box-shadow: none; }
.lz-card:disabled::before, .lz-card:disabled::after { display: none; }

.lz-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  border-style: dashed;
  color: var(--tx-dim);
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: default;
}

/* ---------- 顶栏 / 返回 ---------- */
.lz-topbar { display: flex; align-items: center; gap: 12px; padding: 18px 0 6px; }
.lz-back {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg1); color: var(--gold);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.lz-back:hover { border-color: var(--gold); }
.lz-back:active { transform: scale(0.94); }
.lz-topbar-title { font-family: var(--serif); font-size: 15px; letter-spacing: 0.1em; color: var(--tx); }

.lz-page-head { text-align: center; padding: 6px 0 2px; }
.lz-school-icon-lg { display: flex; justify-content: center; font-size: 32px; color: var(--gold); min-height: 38px; align-items: center; }
.lz-school-icon-lg svg { width: 38px; height: 38px; }
.lz-school-name-lg { margin: 4px 0 2px; font-family: var(--serif); font-size: 20px; letter-spacing: 0.14em; color: var(--gold-hi); }
.lz-school-desc { margin: 0 auto; max-width: 460px; font-size: 12px; color: var(--tx-dim); }

/* ---------- 用途 chips（流派页头部） ---------- */
.lz-uses { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px auto 0; max-width: 420px; }
.lz-use-chip {
  font-size: 11px; letter-spacing: 0.05em; color: var(--gold);
  padding: 2px 9px; border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 999px;
  background: rgba(212, 175, 55, 0.07); white-space: nowrap;
}

/* ---------- 表单 ---------- */
.lz-form { display: flex; flex-direction: column; gap: 20px; max-width: 520px; margin: 0 auto; padding: 22px 0 8px; }
.lz-field { display: flex; flex-direction: column; gap: 8px; }
.lz-label { font-size: 14px; letter-spacing: 0.08em; color: var(--tx); }
.lz-req { color: var(--red); }
.lz-help { font-size: 12px; color: var(--tx-dim); line-height: 1.6; }
.lz-field-error { display: none; font-size: 12px; color: var(--red); }
.lz-field-error.show { display: block; }

.lz-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  background: var(--bg1);
  color: var(--tx);
  font-size: 16px;
  font-family: var(--sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lz-input::placeholder { color: #6b6f7a; }
.lz-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14); }
.lz-input.invalid { border-color: var(--red); }
input[type="datetime-local"], input[type="date"], input[type="number"] { color-scheme: dark; }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.lz-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23d4af37' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.lz-select option { background: var(--bg1); color: var(--tx); }

/* ---- 三排 0-9 点选（小六壬报数） ---- */
.lz-digits { display: flex; flex-direction: column; gap: 9px; }
.lz-digit-row { display: flex; align-items: center; gap: 4px; }
.lz-digit-label {
  flex: 0 0 22px; text-align: center;
  font-size: 12.5px; letter-spacing: 0.04em; color: var(--gold);
}
.lz-digit {
  flex: 1 1 0; min-width: 0; height: 40px; padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 10px;
  background: rgba(18, 22, 30, 0.92);
  color: var(--tx);
  font: inherit; font-size: 15px; line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.lz-digit:hover { border-color: rgba(212, 175, 55, 0.6); }
.lz-digit:active { transform: scale(0.93); }
.lz-digit.on {
  background: linear-gradient(160deg, #f0d78c, #d4af37 62%, #b8901f);
  color: #14171f;
  border-color: #f0d78c;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(240, 215, 140, 0.32), 0 0 18px rgba(212, 175, 55, 0.34);
}
@media (max-width: 380px) {
  .lz-digit { height: 36px; font-size: 14px; border-radius: 9px; }
  .lz-digit-row { gap: 3px; }
  .lz-digit-label { flex-basis: 18px; font-size: 11.5px; }
}

.lz-radios { display: flex; flex-wrap: wrap; gap: 10px; }
.lz-radio-pill { flex: 1 1 auto; min-width: 88px; }
.lz-radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.lz-radio-pill span {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 16px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  background: var(--bg1);
  color: var(--tx-dim);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.lz-radio-pill input:checked + span {
  color: #1a1608;
  background: linear-gradient(160deg, #e2c25c, #b8912c);
  border-color: transparent;
  font-weight: 600;
}
.lz-radio-pill input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* ---------- 铜钱摇卦 ---------- */
.lz-coins {
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 26, 34, 0.6), rgba(16, 18, 24, 0.6));
}
.lz-coin-stage {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  min-height: 84px;
  perspective: 620px;
}
.lz-coin { width: 64px; height: 64px; }
.lz-coin svg { width: 100%; height: 100%; display: block; }
.lz-coin.flipping { animation: lz-coin-flip 0.9s cubic-bezier(0.3, 0.6, 0.4, 1); }

.lz-yao-slots { display: flex; flex-direction: column-reverse; gap: 6px; }
.lz-yao-slot {
  min-height: 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 12px;
  border: 1px dashed rgba(212, 175, 55, 0.18);
  border-radius: 10px;
  color: var(--tx-dim);
  font-size: 12px;
}
.lz-yao-slot.filled { border-style: solid; color: var(--tx); }
.lz-yao-line { display: flex; align-items: center; gap: 6px; }
.lz-yao-bar { height: 5px; width: 34px; border-radius: 3px; background: var(--gold-hi); box-shadow: 0 0 8px rgba(240, 215, 140, 0.35); }
.lz-yao-bar.broken { width: 14px; }
.lz-yao-tag { font-size: 11px; color: var(--tx-dim); }
.lz-yao-tag.move { color: var(--red); }
.lz-coins-actions { display: flex; gap: 12px; }
.lz-btn-shake { flex: 1; }
.lz-btn-shake:disabled { opacity: 1; filter: none; animation: lz-breathe 1.2s ease-in-out infinite; }

/* ---------- 按钮 ---------- */
.lz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid transparent; border-radius: 13px;
  font-size: 16px; font-weight: 600; letter-spacing: 0.14em;
  color: #211a06;
  background: linear-gradient(160deg, #e6c663 0%, #d4af37 45%, #b8912c 100%);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}
.lz-btn:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(212, 175, 55, 0.26); }
.lz-btn:active { transform: scale(0.97); }
.lz-btn:disabled { opacity: 0.45; filter: none; cursor: default; }
.lz-btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--gold);
  box-shadow: none;
}
.lz-btn.ghost:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.06); }

/* ---------- ② 旋转罗盘加载层 ---------- */
.lz-compass-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: rgba(10, 10, 14, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.lz-compass-overlay.on { opacity: 1; }
.lz-compass-overlay[hidden] { display: none; }
.lz-compass { position: relative; width: 260px; height: 260px; animation: lz-spin 16s linear infinite; }
.lz-compass-halo {
  position: absolute; inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 65%);
  animation: lz-breathe 3s ease-in-out infinite;
}
.lz-compass-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.08), 0 0 40px rgba(212, 175, 55, 0.10);
  animation: lz-breathe 3s ease-in-out infinite;
}
.lz-ring { position: absolute; inset: 0; }
.lz-ring span {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px;
}
.lz-ring-outer span { color: var(--tx-dim); }
.lz-ring-inner { animation: lz-rot-rev 11s linear infinite; }
.lz-ring-inner span { color: var(--gold); font-size: 14px; }
.lz-compass-center {
  position: absolute; inset: 0; margin: auto;
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.16), rgba(10, 10, 14, 0.4));
  display: flex; align-items: center; justify-content: center;
  padding: 11px;
}
.lz-compass-center svg { width: 100%; height: 100%; animation: lz-spin 60s linear infinite reverse; }
.lz-needle {
  position: absolute; left: 50%; top: 50%;
  width: 4px; height: 100px; margin: -100px 0 0 -2px;
  transform-origin: 50% 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, rgba(212, 175, 55, 0));
  animation: lz-needle 4s ease-in-out infinite;
}
.lz-compass-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px; letter-spacing: 0.3em;
  color: var(--tx-dim);
  animation: lz-fade 2.4s ease-in-out infinite;
}

/* ---------- 结果页 ---------- */
.lz-result { padding-top: 8px; }
.lz-meta-card {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 16px 14px;
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 26, 34, 0.7), rgba(16, 18, 24, 0.8));
}
.lz-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  background: var(--bg1);
  color: var(--tx-dim);
  font-size: 12.5px;
}
.lz-chip b { color: var(--gold-hi); font-weight: 500; }

.lz-block-title {
  display: flex; align-items: center; gap: 10px;
  margin: 28px 2px 12px;
  font-family: var(--serif);
  font-size: 17px; font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-hi);
}
.lz-block-title::before { content: ""; width: 14px; height: 1px; background: var(--gold); opacity: 0.6; }
.lz-chart-body {
  padding: 16px 12px;
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  background: var(--bg1);
}

/* ---------- 解读卡片 ---------- */
.lz-reading { display: flex; flex-direction: column; gap: 14px; }
.lz-reading-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 26, 34, 0.75), rgba(16, 18, 24, 0.8));
}
.lz-reading-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.lz-reading-title { font-family: var(--serif); font-size: 15.5px; letter-spacing: 0.1em; color: var(--gold-hi); }
.lz-reading-html { font-size: 14.5px; line-height: 1.85; color: var(--tx); }
.lz-reading-html p { margin: 0.45em 0; }
.lz-reading-source { margin-top: 10px; text-align: right; font-family: var(--serif); font-size: 12px; color: var(--tx-dim); }

.lz-badge {
  display: inline-flex; align-items: center;
  min-height: 24px; padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  font-family: var(--sans);
}
.lz-badge.ji { color: #211a06; background: linear-gradient(160deg, #e6c663, #b8912c); }
.lz-badge.xiong { color: #fff; background: linear-gradient(160deg, #c14b3d, #8c2a20); }
.lz-badge.ping { color: var(--gold-hi); border: 1px solid var(--line); }
.lz-badge.tip { color: #211a06; background: linear-gradient(160deg, #e6c663, #b8912c); }
.lz-badge.warn { color: #fff; background: linear-gradient(160deg, #c14b3d, #8c2a20); }

/* lead：大字总断金卡 */
.lz-reading-card.lead {
  padding: 22px 16px;
  border-color: rgba(212, 175, 55, 0.4);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12), rgba(16, 18, 24, 0.85));
}
.lz-reading-card.lead .lz-reading-html {
  font-family: var(--serif);
  font-size: 20px; line-height: 1.8;
  color: var(--gold-hi);
}
.lz-num { font-family: var(--serif); font-weight: 600; color: var(--gold-hi); }

/* classical：古籍感 */
.lz-reading-card.classical { border-left: 2px solid var(--gold); }
.lz-reading-card.classical .lz-reading-html { font-family: var(--serif); font-size: 15px; color: #d9d4c5; }
.lz-reading-card.classical .lz-reading-html::before { content: "「"; color: var(--gold); }
.lz-reading-card.classical .lz-reading-html::after { content: "」"; color: var(--gold); }

/* case：案例卡 */
.lz-reading-card.case { border-style: dashed; border-color: rgba(212, 175, 55, 0.3); }

/* tip / warn：徽标色区分 */
.lz-reading-card.tip { border-left: 2px solid var(--gold); }
.lz-reading-card.warn { border-left: 2px solid var(--red); }
.lz-reading-card.warn .lz-reading-title { color: #e0a89f; }

/* ---------- 出处折叠面板 ---------- */
.lz-sources {
  margin-top: 22px;
  border: 1px solid var(--line-dim);
  border-radius: var(--radius);
  background: var(--bg1);
  overflow: hidden;
}
.lz-sources summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 12px 16px;
  font-size: 14px; letter-spacing: 0.06em;
  color: var(--tx);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.lz-sources summary::-webkit-details-marker { display: none; }
.lz-sources summary::after { content: "▾"; color: var(--gold); transition: transform 0.25s ease; }
.lz-sources[open] summary::after { transform: rotate(180deg); }
.lz-sources-body { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; padding: 4px 14px 16px; }
.lz-source {
  padding: 12px;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.05);
}
.lz-source-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.lz-source-name { font-family: var(--serif); font-size: 13.5px; color: var(--gold-hi); }
.lz-source-chapter { font-size: 12px; color: var(--tx-dim); }
.lz-source-quote {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid rgba(212, 175, 55, 0.35);
  font-family: var(--serif);
  font-size: 13px; line-height: 1.8;
  color: #cfcabd;
}

.lz-disclaimer {
  max-width: 560px; margin: 26px auto 0;
  text-align: center;
  font-size: 11.5px; line-height: 1.8;
  color: #6f7360;
}
.lz-result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.lz-result-actions .lz-btn { flex: 1 1 30%; min-width: 120px; }

/* ---------- 术数结构类（契约约定，术数队只管用） ---------- */
.lz-grid6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lz-grid12 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lz-cell {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 66px; padding: 10px 6px;
  border: 1px solid var(--line-dim);
  border-radius: 12px;
  background: var(--bg1);
  text-align: center;
  overflow: hidden;
}
.lz-cell.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.04));
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}
.lz-cell-head { font-size: 12px; color: var(--tx-dim); letter-spacing: 0.06em; }
.lz-cell-main { font-family: var(--serif); font-size: 20px; color: var(--gold-hi); }
.lz-cell-sub { font-size: 11.5px; color: var(--tx-dim); }
.lz-cell-tag {
  display: inline-block; align-self: center;
  padding: 1px 8px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--gold);
}

.lz-pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lz-pillar {
  padding: 14px 6px 12px;
  border: 1px solid var(--line-dim);
  border-radius: 12px;
  background: var(--bg1);
  text-align: center;
  overflow: hidden;
}
.lz-pillar-head { font-size: 12px; color: var(--tx-dim); margin-bottom: 8px; letter-spacing: 0.08em; }
.lz-gan { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.3; color: var(--gold-hi); }
.lz-zhi { display: block; font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--tx); }
.lz-pillar-sub { display: block; margin-top: 8px; font-size: 10.5px; line-height: 1.6; color: var(--tx-dim); white-space: pre-line; }

.lz-bagua { display: flex; flex-direction: column; align-items: center; padding: 6px 0; }
.lz-gua-name {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 22px; letter-spacing: 0.24em;
  color: var(--gold);
}
.lz-yao {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 30px;
  font-family: var(--serif);
  font-size: 21px; letter-spacing: 0.35em;
  color: var(--gold-hi);
}
.lz-yao.move { color: var(--red); text-shadow: 0 0 10px rgba(176, 58, 46, 0.5); }
.lz-yao .yao-label { font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em; color: var(--tx-dim); }
.lz-yao.move .yao-label { color: var(--red); }

.lz-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lz-table th, .lz-table td { padding: 9px 6px; text-align: center; border: 1px solid var(--line-dim); }
.lz-table th {
  background: rgba(212, 175, 55, 0.08);
  font-family: var(--serif); font-weight: 500; letter-spacing: 0.08em;
  color: var(--gold-hi);
}
.lz-table td { color: var(--tx); }
.lz-table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }

.lz-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  font-size: 11px;
  color: var(--gold);
}

/* 通用兜底：未预见的自由结构 */
.lz-chart-body p, .lz-chart-body div, .lz-reading-html p, .lz-reading-html div { margin: 0.4em 0; }
.lz-chart-body strong, .lz-reading-html strong { color: var(--gold-hi); font-weight: 600; }
.lz-chart-body em, .lz-reading-html em { color: var(--gold); font-style: normal; }
.lz-chart-body ul, .lz-reading-html ul { margin: 0.5em 0; padding-left: 1.4em; }
.lz-chart-body h4, .lz-reading-html h4 { margin: 0.6em 0 0.3em; font-family: var(--serif); color: var(--gold-hi); font-weight: 600; }

/* ---------- 古法风水罗盘页（罗盘模块自带星宿背景，这里只包容器） ---------- */
.lz-fengshui-wrap {
  position: relative;
  margin: 16px -16px 0;
  min-height: 540px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 18px;
  background: #05060a;
  overflow: hidden;
}
.lz-fengshui-mount { position: relative; width: 100%; min-height: 540px; }
.lz-fengshui-note { text-align: center; font-size: 11.5px; color: #6f7360; padding: 14px 16px 0; }

/* ---------- 空态 / 404 ---------- */
.lz-notice {
  margin-top: 44px; padding: 44px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 24, 0.6);
}
.lz-notice-icon { font-size: 40px; color: var(--gold); opacity: 0.8; }
.lz-notice-title { margin: 14px 0 8px; font-family: var(--serif); font-size: 19px; letter-spacing: 0.12em; color: var(--gold-hi); }
.lz-notice-msg { margin: 0 auto 22px; max-width: 380px; font-size: 13px; line-height: 1.8; color: var(--tx-dim); }

/* ---------- ④ 数据脉冲（呼吸）。③⑦ 淡入上浮已按枫哥要求移除：内容直接固定显示 ---------- */
.reveal { opacity: 1; transform: none; }
.pulse { position: relative; display: inline-block; animation: lz-pulse 2.6s ease-in-out infinite; }
.pulse::before {
  content: "";
  position: absolute; inset: -7px -5px;
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.28);
  opacity: 0;
  animation: lz-glow 2.6s ease-in-out infinite;
  pointer-events: none;
}

/* ---------- 轻提示 ---------- */
.lz-toast {
  position: fixed; left: 50%; bottom: 46px;
  z-index: 200;
  max-width: 86vw;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(22, 26, 34, 0.96);
  color: var(--tx);
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.lz-toast.on { opacity: 1; transform: translate(-50%, 0); }
.lz-toast.err { border-color: rgba(176, 58, 46, 0.7); color: #f0b7ae; }

/* 自测页角标（tools/test-visual.html 用） */
.lz-test-banner {
  position: fixed; top: 10px; right: 12px; z-index: 300;
  padding: 4px 12px;
  border: 1px solid var(--line-dim);
  border-radius: 999px;
  background: rgba(16, 18, 24, 0.88);
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--tx-dim);
}

/* ---------- keyframes（只动 transform/opacity） ---------- */
@keyframes lz-spin { to { transform: rotate(360deg); } }
@keyframes lz-rot-rev { to { transform: rotate(-360deg); } }
@keyframes lz-angle { to { --angle: 360deg; } }
@keyframes lz-breathe { 0%, 100% { opacity: 0.5; transform: scale(0.98); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes lz-needle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes lz-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes lz-coin-flip { 0% { transform: rotateX(0deg); } 100% { transform: rotateX(720deg); } }
@keyframes lz-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lz-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes lz-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* ---------- 断点 ---------- */
@media (min-width: 640px) {
  .lz-schools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .lz-hero { padding: 36px 8px 20px; }
  .lz-fengshui-wrap { margin: 20px 0 0; }
  .lz-reading-card { padding: 20px; }
}
@media (min-width: 960px) {
  .lz-schools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lz-card { min-height: 130px; }
}

/* ---------- 动效降级：prefers-reduced-motion 全部静态 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .pulse::before { display: none; }
}

/* ---- AI 深度解读卡片 ---- */
.lz-ai-card {
  margin: 18px 0;
  padding: 16px 14px 14px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(30, 34, 46, 0.92), rgba(16, 19, 26, 0.96));
  box-shadow: inset 0 1px 0 rgba(240, 215, 140, 0.08), 0 10px 30px rgba(0, 0, 0, 0.35);
  scroll-margin-top: 16px; /* 浮动按钮平滑滚动定位 */
}
.lz-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lz-ai-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.9);
  animation: lz-ai-pulse 2.4s ease-in-out infinite;
}
.lz-ai-title { font-size: 14px; letter-spacing: 0.1em; color: #f0d78c; }
.lz-ai-note { margin-left: auto; font-size: 11px; color: var(--tx-dim); letter-spacing: 0.04em; }
.lz-ai-body { font-size: 14.5px; line-height: 1.9; color: var(--tx); }
.lz-ai-body p { margin: 0 0 10px; }
.lz-ai-loading { color: var(--tx-dim); font-size: 13px; }
.lz-ai-btn { width: 100%; margin-top: 4px; }
.lz-ai-card.done .lz-ai-btn { width: auto; }
@keyframes lz-ai-pulse { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }

/* AI 结构化输出：结论大字 + 数据小卡 + 分段 + 清单 */
.lz-ai-headline {
  font-size: 16px; line-height: 1.65; color: #f0d78c; font-weight: 600;
  margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  overflow-wrap: anywhere;
}
.lz-ai-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.lz-ai-fact {
  padding: 7px 8px; border-radius: 10px;
  background: rgba(10, 12, 18, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.16);
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.lz-ai-fact-k { font-size: 10.5px; color: var(--tx-dim); letter-spacing: 0.06em; }
.lz-ai-fact-v { font-size: 13.5px; color: #f0d78c; line-height: 1.4; overflow-wrap: anywhere; }
.lz-ai-sec { margin: 0 0 14px; min-width: 0; }
.lz-ai-sec-title {
  font-size: 13px; color: #f0d78c; letter-spacing: 0.08em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.lz-ai-sec-title::before {
  content: ""; width: 12px; height: 1px; background: rgba(212, 175, 55, 0.8);
}
.lz-ai-sec-text { margin: 0; font-size: 14px; line-height: 1.95; color: var(--tx); overflow-wrap: anywhere; }
.lz-ai-do {
  margin: 4px 0 10px; padding: 12px; border-radius: 12px;
  background: rgba(10, 12, 18, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.14);
  min-width: 0;
}
.lz-ai-do .lz-ai-sec-title { margin-bottom: 8px; }
.lz-ai-do-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 13.5px; line-height: 1.6; min-width: 0; }
.lz-ai-do-icon { font-size: 14px; flex: 0 0 auto; }
.lz-ai-do-k { flex: 0 0 auto; color: #d4af37; font-size: 12px; letter-spacing: 0.04em; min-width: 44px; }
.lz-ai-do-v { flex: 1 1 auto; min-width: 0; color: var(--tx); overflow-wrap: anywhere; }
.lz-ai-caveat { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--tx-dim); overflow-wrap: anywhere; }

/* 进阶查阅：古文原文 / 案例 / 详表折叠
   展开/收起高度过渡：details 转 grid，内容行 0fr → 1fr（grid-template-rows 可插值动画） */
.lz-adv {
  margin: 18px 0;
  border: 1px dashed rgba(212, 175, 55, 0.28);
  border-radius: 14px;
  background: rgba(14, 16, 22, 0.5);
  padding: 0 14px;
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 0.35s ease;
}
.lz-adv[open] { grid-template-rows: auto 1fr; }
/* Chromium 131+ 把非 summary 子元素包进 ::details-content 槽：槽才是 0fr 网格项，需在此裁剪 */
.lz-adv::details-content {
  overflow: hidden;
  min-height: 0;
}
.lz-adv summary {
  cursor: pointer; list-style: none;
  padding: 13px 0; font-size: 12.5px; color: rgba(212, 175, 55, 0.9);
  letter-spacing: 0.06em; display: flex; justify-content: space-between; align-items: center;
  min-height: 44px;
}
.lz-adv summary::-webkit-details-marker { display: none; }
.lz-adv summary::after { content: "▾"; color: var(--gold); transition: transform 0.25s ease; }
.lz-adv[open] summary::after { transform: rotate(180deg); }
.lz-adv-body {
  overflow: hidden; min-height: 0;
  padding-bottom: 14px; box-sizing: border-box;
}
.lz-adv-body .lz-reading-card { margin: 10px 0; }
.lz-adv-body .lz-reading-card:last-child { margin-bottom: 0; }

/* 结果页「一键跳到 AI 解读」浮动按钮：滚动超 400px 淡入，点击平滑滚动到 .lz-ai-card */
.lz-jump-ai {
  position: fixed; right: 14px; bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 140;
  display: flex; align-items: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: 999px;
  background: rgba(16, 18, 24, 0.92);
  color: #f0d78c; font-size: 12.5px; letter-spacing: 0.05em;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.16);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.lz-jump-ai::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.9);
}
.lz-jump-ai.on { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lz-jump-ai:active { transform: scale(0.95); }
@media (min-width: 640px) {
  .lz-jump-ai { right: max(16px, calc(50vw - 480px + 16px)); }
}

/* ---------- 人生阶段时间轴（八字） ---------- */
.lz-stages { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 2px; }
.lz-stage {
  position: relative;
  padding: 10px 12px 11px 18px;
  border-left: 2px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.015) 62%, transparent);
  border-radius: 0 10px 10px 0;
}
.lz-stage::before {
  content: ""; position: absolute; left: -5px; top: 13px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 9px rgba(240, 215, 140, 0.65);
}
.lz-stage-head {
  font-size: 13px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--gold-hi);
}
.lz-stage-body p {
  margin: 6px 0 0; font-size: 12.5px; line-height: 1.72;
  color: var(--tx-dim);
}
.lz-stage-body b { color: var(--tx); font-weight: 600; }
@media (max-width: 380px) {
  .lz-stage { padding: 9px 10px 10px 15px; }
  .lz-stage-head { font-size: 12.5px; }
  .lz-stage-body p { font-size: 12px; }
}

