/* ============================================================
   堪舆系统 · 样式
   土褐页头 + 浅色主体，与气象/终端系统同调
   ============================================================ */

/* ============ 页头（土褐主调） ============ */
.kanyu-header {
  background: linear-gradient(135deg, #5c4530 0%, #3d2e1f 100%);
  padding-bottom: 36px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.kanyu-header .container { position: relative; z-index: 1; }
.kanyu-header::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 420px; height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(184, 132, 46, 0.2) 0%, transparent 60%);
  pointer-events: none;
}
.kanyu-header .breadcrumb a { color: rgba(255, 255, 255, 0.75); }
.kanyu-header h1 {
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  margin: 8px 0 6px;
}
.kanyu-header p { color: rgba(255, 255, 255, 0.85); }
.kanyu-sub {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; color: #fff;
}
.kanyu-sub .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: kanyu-blink 1.5s infinite;
}
@keyframes kanyu-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============ 主体 ============ */
.kanyu-main { padding: 40px 0 64px; flex: 1; }

/* 权限锁定状态 */
.kanyu-locked {
  text-align: center; padding: 80px 24px;
}
.kanyu-locked .locked-icon {
  font-size: 64px; margin-bottom: 20px; opacity: 0.5;
}
.kanyu-locked h2 {
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
  color: var(--text-main); margin-bottom: 12px;
}
.kanyu-locked p {
  font-size: 14px; color: var(--text-light); line-height: 1.8; margin-bottom: 8px;
}
.kanyu-locked .locked-hint {
  color: var(--text-muted); font-size: 13px; margin-bottom: 24px;
}
.kanyu-locked .btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; text-decoration: none;
  display: inline-block; transition: background 0.2s;
}
.kanyu-locked .btn-primary:hover { background: #9a6f24; }

/* ============ 区块 ============ */
.block { margin-bottom: 44px; }
.block-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.block-title {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: var(--text-main); display: flex; align-items: center; gap: 10px;
}
.block-title .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--accent); color: #fff;
  border-radius: 50%; font-size: 14px; font-weight: 700;
}
.block-desc { font-size: 13px; color: var(--text-light); }

/* ============ 卡片 ============ */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap; gap: 10px;
}
.chart-title {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--text-main);
}
.chart-box { padding: 20px 24px; }
.chart-note {
  padding: 10px 24px 16px;
  font-size: 13px; color: var(--text-light); line-height: 1.7;
}
.chart-note.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-top: 1px solid var(--border-light);
}
#magLegend { display: flex; gap: 14px; flex-wrap: wrap; }
.lg-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-body);
}
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ============ 地质剖面 ============ */
.probe-readout {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); font-weight: 700;
  padding: 4px 12px; background: var(--accent-bg);
  border-radius: var(--radius-sm);
}
.geo-svg { display: block; width: 100%; height: auto; }
.geo-layer { cursor: pointer; transition: opacity 0.2s; }
.geo-layer:hover { opacity: 0.85; }
.geo-layer-highlight {
  animation: geo-pulse 1.5s ease-in-out infinite;
}
@keyframes geo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.geo-probe {
  cursor: ns-resize;
  transition: transform 0.1s;
}
.geo-tooltip {
  font-family: var(--font-mono); font-size: 11px;
  fill: var(--text-main);
}

/* ============ 九宫飞星盘 ============ */
.fly-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  padding: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .fly-panel { grid-template-columns: 1fr; }
}
.fly-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  aspect-ratio: 1;
  max-width: 300px;
}
.fly-cell {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  aspect-ratio: 1;
}
.fly-cell:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.fly-cell .fly-num {
  font-family: var(--font-serif); font-size: 28px; font-weight: 700;
  color: var(--text-main); line-height: 1;
}
.fly-cell .fly-palace {
  font-size: 10.5px; color: var(--text-muted);
  margin-top: 4px;
}
.fly-cell .fly-star {
  font-size: 9.5px; color: var(--text-light);
  margin-top: 1px;
}
.fly-cell.fly-active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(184, 132, 46, 0.35);
}
.fly-cell.fly-active .fly-num,
.fly-cell.fly-active .fly-palace,
.fly-cell.fly-active .fly-star { color: #fff; }
.fly-cell.fly-done {
  background: var(--accent-bg);
  border-color: var(--accent-light);
}
.fly-cell.fly-target {
  border-color: var(--danger);
  border-width: 2px;
}
.fly-cell.fly-target .fly-palace { color: var(--danger); }

.fly-result {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); font-weight: 600;
}
.fly-info {
  display: flex; flex-direction: column; gap: 14px;
}
.fly-step {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--text-main); font-weight: 600;
}
.fly-hint {
  font-size: 13px; color: var(--text-light); line-height: 1.7;
  padding: 12px 14px; background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.fly-directions {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.fly-directions .dir {
  font-size: 11px; padding: 3px 8px;
  background: var(--bg-page); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-light);
}
.fly-directions .dir.dir-c { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-light); }

/* ============ 百年编年史 ============ */
.chronicle { padding: 28px 24px; }
.chro-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .chro-line { grid-template-columns: repeat(3, 1fr); gap: 16px 0; }
}
.chro-node {
  position: relative;
  text-align: center;
  cursor: pointer;
  padding-top: 28px;
}
.chro-node::before {
  content: '';
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  transition: all 0.2s;
}
.chro-node:hover::before { border-color: var(--accent); }
.chro-node.chro-cycle::before { border-color: var(--danger); background: var(--danger); }
.chro-node.chro-cycle:hover::before { transform: translateX(-50%) scale(1.2); }
.chro-node.chro-decoy::before { border-color: var(--text-muted); }
.chro-year {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--text-main);
}
.chro-node.chro-cycle .chro-year { color: var(--danger); }
.chro-node.chro-decoy .chro-year { color: var(--text-muted); }
.chro-ganzhi {
  font-size: 10.5px; color: var(--text-muted); margin-top: 2px;
}
.chro-node.chro-cycle .chro-ganzhi { color: var(--accent); font-weight: 600; }

.chro-line::before {
  content: '';
  position: absolute; top: 14px; left: 8%; right: 8%;
  height: 2px; background: var(--border);
}
.chro-detail {
  display: none;
  padding: 16px 20px; margin-top: 12px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.8; color: var(--text-body);
}
.chro-detail.open { display: block; animation: fade-in 0.3s; }
.chro-detail .chro-detail-title {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--text-main); margin-bottom: 8px;
}
.chro-detail.chro-cycle-detail { border-left-color: var(--danger); }
.chro-detail.chro-cycle-detail .chro-detail-title { color: var(--danger); }

/* ============ 结论 ============ */
.conclusion {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.conclusion h3 {
  color: var(--danger); font-family: var(--font-serif);
  font-size: 18px; margin-bottom: 12px;
}
.conclusion p {
  color: var(--text-body); font-size: 14px; line-height: 1.8;
  margin-bottom: 14px;
}
.alert-line {
  padding: 10px 14px; background: var(--danger-bg);
  border-radius: var(--radius-sm); color: var(--danger);
  font-family: var(--font-mono); font-size: 13px;
  margin-bottom: 18px;
}
.conclusion .clue,
.alert-line .clue {
  color: var(--accent);
  font-weight: 700;
}
.conclusion .btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 10px 22px; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  text-decoration: none; display: inline-block;
  transition: background 0.2s;
}
.conclusion .btn-primary:hover { background: #9a6f24; }

/* ============ SVG 图表通用 ============ */
.chart-svg { width: 100%; height: auto; }
.chart-svg text { font-family: var(--font-mono); }
