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

/* ============ 页头（土褐主调） ============ */
.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-scene { margin-bottom: 36px; }
.scene-figure {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.scene-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s;
}
.scene-img:hover { transform: scale(1.02); }
.scene-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.scene-stamp {
  display: inline-block;
  padding: 3px 12px;
  background: #5c4530;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4px;
  border-radius: 3px;
}
.scene-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.6;
}

/* 权限锁定状态 */
.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-secret {
  margin-top: 4px;
  padding: 12px 16px 14px;
  background: linear-gradient(135deg, var(--accent-bg) 0%, #fffaeb 100%);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  position: relative;
  box-shadow: var(--shadow-sm);
}
.fly-secret-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.fly-secret-body {
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-main);
}
.fly-keyword {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(184, 132, 46, 0.14);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px dashed var(--accent);
  white-space: nowrap;
}
.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; }

/* ============ 镇山石铭文拓片 ============ */
.rubbing-card {
  margin: 20px auto 10px;
  padding: 22px;
  max-width: 440px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rubbing-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-strong);
  flex-wrap: wrap;
}

.rubbing-stamp {
  display: inline-block;
  padding: 3px 12px;
  background: #5c4530;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4px;
  border-radius: 3px;
}

.rubbing-label-text {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.rubbing-frame {
  background: #0a0807;
  padding: 24px;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-sm);
  position: relative;
}

.rubbing-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  border-radius: 2px;
  cursor: zoom-in;
}

/* 四角刻痕字母彩蛋（呼应档案#07 隐藏线索 S T O N E） */
.rubbing-mark {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #8a7656;
  opacity: 0.5;
  pointer-events: none;
  letter-spacing: 1px;
}
.rubbing-mark.m-tl { top: 28px; left: 32px; }
.rubbing-mark.m-tr { top: 28px; right: 32px; }
.rubbing-mark.m-br { bottom: 28px; right: 32px; }
.rubbing-mark.m-bl { bottom: 28px; left: 32px; }
.rubbing-mark.m-c  { bottom: 28px; left: 50%; transform: translateX(-50%); }

.rubbing-caption {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-light);
  font-family: var(--font-mono);
  text-align: center;
  line-height: 1.7;
}

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

/* ============ 移动端优化 ============ */
@media (max-width: 768px) {
  .kanyu-main { padding: 24px 0 40px; }
  .kanyu-header { padding-bottom: 24px; }
  .kanyu-header h1 { font-size: 24px; }
  .kanyu-header p { font-size: 13px; }

  .block { margin-bottom: 32px; }
  .block-title { font-size: 16px; }
  .block-title .num { width: 24px; height: 24px; font-size: 13px; }
  .block-desc { font-size: 12.5px; }

  .chart-head { padding: 14px 16px; }
  .chart-title { font-size: 14px; }
  .chart-box { padding: 14px 16px; }
  .chart-note { padding: 8px 16px 12px; font-size: 12.5px; }

  .conclusion {
    padding: 20px 18px;
    margin-top: 16px;
  }
  .conclusion h3 { font-size: 16px; }
  .conclusion p { font-size: 13.5px; line-height: 1.75; }
  .alert-line { font-size: 12.5px; padding: 8px 12px; }

  .chronicle { padding: 20px 16px; }
  .chro-detail { padding: 14px 16px; font-size: 13px; }

  .fly-panel { padding: 16px; gap: 20px; }
  .fly-grid { max-width: 100%; }
  .fly-cell .fly-num { font-size: 24px; }
  .fly-hint { font-size: 12.5px; padding: 10px 12px; }

  .rubbing-card { padding: 14px; }
  .rubbing-frame { padding: 14px; }
  .rubbing-label-text { font-size: 13px; }
  .rubbing-caption { font-size: 11px; }
  .rubbing-img { max-width: 280px; }
  .rubbing-mark { font-size: 11px; }
  .rubbing-mark.m-tl, .rubbing-mark.m-tr { top: 18px; }
  .rubbing-mark.m-br, .rubbing-mark.m-bl { bottom: 18px; }
  .rubbing-mark.m-tl, .rubbing-mark.m-bl { left: 20px; }
  .rubbing-mark.m-tr, .rubbing-mark.m-br { right: 20px; }
}
