/* ===== 命理玄机 — 左右分栏布局 ===== */

.bazi-layout {
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 200px);
}

/* 左侧面板 */
.bazi-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 80px;
}

.bazi-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.bazi-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(108, 92, 231, 0.2);
  background: rgba(108, 92, 231, 0.06);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.bazi-add-btn:hover {
  background: rgba(108, 92, 231, 0.15);
  border-color: var(--accent);
  transform: scale(1.05);
}

.bazi-person-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 人员卡片 */
.bazi-person-card {
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  margin-bottom: 4px;
  position: relative;
}
.bazi-person-card:hover {
  background: rgba(108, 92, 231, 0.04);
  border-color: rgba(108, 92, 231, 0.08);
}
.bazi-person-card.active {
  background: rgba(108, 92, 231, 0.08);
  border-color: rgba(108, 92, 231, 0.18);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.06);
}

.bazi-person-card-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* 卡片拖拽光标 */
.bazi-person-card[draggable="true"] {
  cursor: grab;
}
.bazi-person-card[draggable="true"]:active {
  cursor: grabbing;
}

/* 拖拽中状态 */
.bazi-person-card.bazi-dragging {
  opacity: 0.4;
  transform: scale(0.98);
}
.bazi-person-card.bazi-drag-ghost {
  opacity: 0.4;
}

/* 拖放位置指示线 */
.bazi-person-card.bazi-drag-over-top {
  position: relative;
}
.bazi-person-card.bazi-drag-over-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(108, 92, 231, 0.3);
  z-index: 10;
}
.bazi-person-card.bazi-drag-over-bottom {
  position: relative;
}
.bazi-person-card.bazi-drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(108, 92, 231, 0.3);
  z-index: 10;
}

.bazi-person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #9CA3AF, #6B7280);
}
.bazi-person-avatar.is-self {
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
}

.bazi-person-info {
  flex: 1;
  min-width: 0;
}

.bazi-person-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.bazi-person-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazi-person-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1.5;
}

.bazi-person-detail,
.bazi-person-lunar,
.bazi-person-place {
  font-size: 11px;
  color: #9CA3AF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 3px;
}
.bazi-person-detail i,
.bazi-person-lunar i,
.bazi-person-place i {
  font-size: 11px;
  flex-shrink: 0;
}
.bazi-person-lunar {
  color: #a78bfa;
}

/* 操作按钮 */
.bazi-person-actions {
  display: flex;
  gap: 2px;
  margin-top: 8px;
  padding-left: 66px;
  opacity: 0;
  transition: opacity 0.2s;
}
.bazi-person-card:hover .bazi-person-actions,
.bazi-person-card.active .bazi-person-actions {
  opacity: 1;
}

.bazi-edit-btn,
.bazi-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #9CA3AF;
  font-size: 14px;
}
.bazi-edit-btn:hover {
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent);
}
.bazi-delete-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* 右侧主内容 */
.bazi-main {
  flex: 1;
  min-width: 0;
}

/* 右侧内容容器 — 支持 Tab 固定 + 内容滚动 */
.bazi-content-wrapper {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 80px;
}

/* Tab 导航固定区域 */
.bazi-tabs-sticky {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  z-index: 10;
  margin-bottom: 12px;
}

/* Tab 内容滚动区域 */
.bazi-tab-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* 滚动区域内最后一个子元素去掉底部间距 */
.bazi-tab-scroll > :last-child {
  margin-bottom: 0 !important;
}

/* 移动端顶部栏 */
.bazi-mobile-topbar {
  margin-bottom: 12px;
}

.bazi-drawer-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.bazi-drawer-toggle:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(108, 92, 231, 0.2);
}

/* 移动端抽屉遮罩 */
.bazi-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  transition: opacity 0.3s;
}
.bazi-drawer-overlay.hidden {
  display: none;
}

/* ===== 响应式：移动端 ===== */
@media (max-width: 767px) {
  .bazi-layout {
    flex-direction: column;
  }

  .bazi-sidebar {
    position: fixed;
    top: 0;
    left: -230px;
    width: 210px;
    height: 100vh;
    max-height: 100vh;
    z-index: 210;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }
  .bazi-sidebar.open {
    left: 0;
  }
}

/* 桌面端隐藏移动端组件 */
@media (min-width: 768px) {
  .bazi-drawer-overlay {
    display: none !important;
  }
  .bazi-mobile-topbar {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════
   八字排盘专用样式
   ═══════════════════════════════════════════════════════ */

/* ===== 排盘主布局 ===== */
.paipan-layout {
  display: block;
}
@media (max-width: 1100px) {
  .paipan-layout {
    display: block;
  }
}

/* ===== 七柱排盘表格 ===== */
.paipan-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}
.paipan-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 700px;
}
.paipan-table th,
.paipan-table td {
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}
.paipan-table thead th {
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.04);
  position: sticky;
  top: 0;
  z-index: 2;
}
.paipan-table .row-label {
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-right: 10px;
  font-weight: 500;
  white-space: nowrap;
  width: 60px;
  min-width: 60px;
}
.paipan-table .col-day {
  background: rgba(108, 92, 231, 0.03);
}
.paipan-table .tg-cell {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 6px;
  line-height: 1.2;
}
.paipan-table .dz-cell {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 6px;
  line-height: 1.2;
}
.paipan-table .shishen-cell {
  font-size: 12px;
  color: var(--rose);
  font-weight: 500;
}
.paipan-table .canggan-cell {
  font-size: 11px;
  color: var(--text-secondary);
}
.paipan-table .canggan-cell .cg-item {
  display: inline-block;
  margin: 0 1px;
}
.paipan-table .canggan-cell .cg-shishen {
  font-size: 9px;
  color: var(--text-tertiary);
  display: block;
  line-height: 1.2;
}
.paipan-table .nayin-cell {
  font-size: 11px;
  color: var(--accent);
  opacity: 0.7;
}
.paipan-table .changsheng-cell {
  font-size: 11px;
  color: var(--teal);
  font-weight: 500;
}
.paipan-table .kongwang-cell {
  font-size: 11px;
}
.paipan-table .kongwang-text {
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-serif);
}
.paipan-table .kongwang-yes {
  color: #E74C3C;
  font-weight: 600;
}
.paipan-table .kongwang-no {
  color: var(--text-tertiary);
}
.paipan-table .shensha-cell {
  font-size: 10px;
  line-height: 1.4;
  vertical-align: top;
}
.paipan-table .shensha-tag {
  display: block;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(108, 92, 231, 0.06);
  color: var(--accent);
  font-size: 10px;
  margin: 1px 0;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
}
.paipan-table .shensha-tag.bad {
  background: rgba(231, 76, 60, 0.06);
  color: #E74C3C;
}
/* 神煞 hover 指针（tooltip由JS管理） */
.paipan-table .shensha-tag[data-shensha] {
  cursor: help;
}
.paipan-table .shensha-tag.tooltip-pinned {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ===== 全局 Tooltip 系统 ===== */
.global-tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(30, 30, 40, 0.96);
  color: #f0f0f0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  width: max-content;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.global-tooltip.visible {
  opacity: 1;
}
.global-tooltip.pinned {
  pointer-events: auto;
  border: 1px solid rgba(108,92,231,0.4);
}
.global-tooltip .pinned-close {
  position: absolute;
  top: 4px;
  right: 8px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.global-tooltip .pinned-close:hover {
  color: #fff;
}
/* tooltip 三角箭头 */
.global-tooltip.visible::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30, 30, 40, 0.96);
}
.global-tooltip.below::before {
  bottom: auto;
  top: -5px;
  border-top-color: transparent;
  border-bottom-color: rgba(30, 30, 40, 0.96);
}
/* 神煞 tooltip 内部结构 */
.global-tooltip .ss-tip-type { color: var(--accent-light); font-weight: 600; margin-bottom: 4px; }
.global-tooltip .ss-tip-meaning { margin-bottom: 6px; }
.global-tooltip .ss-tip-item { color: rgba(255,255,255,0.8); }
.global-tooltip .ss-tip-item strong { color: var(--accent-light); }
/* 关系 tooltip 内部结构 */
.global-tooltip .rel-tip-title { color: var(--accent-light); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.global-tooltip .rel-tip-desc { color: #ffd700; font-weight: 500; margin-bottom: 6px; }
.global-tooltip .rel-tip-pos { color: rgba(255,255,255,0.85); margin-bottom: 4px; font-size: 11px; }
.global-tooltip .rel-tip-theory { color: rgba(255,255,255,0.7); margin-bottom: 6px; font-size: 11px; border-left: 2px solid var(--accent); padding-left: 8px; }
.global-tooltip .rel-tip-impact { color: #90EE90; margin-bottom: 3px; }
.global-tooltip .rel-tip-dm { color: #87CEEB; }
.paipan-table .zizuo-cell {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}
.paipan-table .zizuo-cell .zizuo-shishen {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* 流月/流年/大运/流日列高亮 */
.paipan-table .col-liuri { background: rgba(52, 152, 219, 0.03); }
.paipan-table .col-liuyue { background: rgba(0, 184, 148, 0.03); }
.paipan-table .col-liunian { background: rgba(243, 156, 18, 0.03); }
.paipan-table .col-dayun { background: rgba(253, 121, 168, 0.03); }

/* ===== VIP表格列遮盖 — 样式已迁移至 vip-gate.css 统一管理 ===== */

/* ===== 紧凑卡片布局（命理档案） ===== */
.bazi-person-card-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bazi-detail-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #6B7280;
  margin: 1px 0;
  line-height: 1.4;
}
.bazi-person-card.active .bazi-detail-row {
  color: #4B5563;
}
.bazi-row-name {
  gap: 5px;
  margin-bottom: 2px;
}
.bazi-row-icon {
  font-size: 12px;
  color: #9CA3AF;
  flex-shrink: 0;
}
.bazi-person-card.active .bazi-row-icon {
  color: var(--accent);
}
.bazi-person-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}
/* 性别标签 */
.bazi-gender-tag {
  font-size: 10px;
  padding: 0 5px;
  border-radius: 99px;
  line-height: 1.6;
  font-weight: 500;
}
.bazi-gender-tag.male {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}
.bazi-gender-tag.female {
  background: rgba(236, 72, 153, 0.1);
  color: #EC4899;
}
.bazi-person-actions-compact {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.bazi-person-card:hover .bazi-person-actions-compact,
.bazi-person-card.active .bazi-person-actions-compact {
  opacity: 1;
}

/* ===== 横向滚动面板（大运/流年/流月/流日） ===== */
.dayun-horizontal-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hz-section {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.hz-section h4 {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hz-section h4 i {
  font-size: 14px;
  color: var(--accent);
}
.hz-section-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 6px;
}
.hz-scroll-wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.hz-scroll-wrap::-webkit-scrollbar {
  height: 4px;
}
.hz-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(108, 92, 231, 0.12);
  border-radius: 2px;
}
.hz-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  min-width: 56px;
  text-align: center;
}
.hz-item:hover {
  background: rgba(108, 92, 231, 0.04);
  border-color: rgba(108, 92, 231, 0.08);
}
.hz-item.selected {
  background: rgba(108, 92, 231, 0.10);
  border-color: rgba(108, 92, 231, 0.25);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.08);
}
.hz-item.is-current {
  position: relative;
}
.hz-item.is-current::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}
.hz-item .hz-year {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.hz-item .hz-age {
  font-size: 9px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.hz-item .hz-gz {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.hz-item .hz-sub {
  font-size: 9px;
  color: var(--rose);
  white-space: nowrap;
}
.hz-item.is-xiaoyun {
  border-color: transparent;
  background: transparent;
  cursor: default;
  pointer-events: none;
  opacity: 0.7;
}
.hz-item.is-xiaoyun:hover {
  background: transparent;
  border-color: transparent;
}
.hz-item.is-xiaoyun.selected {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.hz-item.is-xiaoyun .hz-age {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

/* ===== 五行详情区域（八字五行Tab） ===== */
.wuxing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
  align-items: start;
  min-height: auto;
}
@media (max-width: 640px) {
  .wuxing-detail-grid {
    grid-template-columns: 1fr;
  }
}
.wuxing-bars-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wuxing-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wuxing-bar-label {
  width: 28px;
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
}
.wuxing-bar-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}
.wuxing-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  overflow: hidden;
}
.wuxing-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.wuxing-bar-fill.wx-dot-jin { background: #F39C12; }
.wuxing-bar-fill.wx-dot-mu { background: #27AE60; }
.wuxing-bar-fill.wx-dot-shui { background: #2980B9; }
.wuxing-bar-fill.wx-dot-huo { background: #E74C3C; }
.wuxing-bar-fill.wx-dot-tu { background: #8E6B3E; }
.wuxing-bar-value {
  width: 32px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

/* 五行旺衰详细表 */
.wuxing-strength-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.wuxing-strength-table th,
.wuxing-strength-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.wuxing-strength-table thead th {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  background: rgba(108, 92, 231, 0.03);
}
.wuxing-strength-table td:last-child {
  text-align: left;
}

/* ===== 大运面板 ===== */
.dayun-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dayun-panel-section {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.dayun-panel-section h4 {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dayun-panel-section h4 i {
  font-size: 14px;
  color: var(--accent);
}

/* 起运信息 */
.qiyun-info {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: rgba(108, 92, 231, 0.04);
  border-radius: 8px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.qiyun-info strong {
  color: var(--accent);
  font-weight: 600;
}

/* 大运/流年/流月条目 */
.dayun-item {
  display: grid;
  grid-template-columns: 50px 28px 1fr 40px;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 12px;
  transition: background 0.2s;
  cursor: default;
}
.dayun-item:hover {
  background: rgba(108, 92, 231, 0.04);
}
.dayun-item.is-current {
  background: rgba(108, 92, 231, 0.08);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}
.dayun-item .dy-year {
  color: var(--text-tertiary);
  font-size: 11px;
}
.dayun-item .dy-age {
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}
.dayun-item .dy-gz {
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  font-size: 13px;
}
.dayun-item .dy-shishen {
  font-size: 10px;
  color: var(--rose);
  text-align: right;
}

/* 流月条目 */
.liuyue-item {
  display: grid;
  grid-template-columns: 40px 38px 1fr 40px;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  transition: background 0.2s;
}
.liuyue-item:hover {
  background: rgba(0, 184, 148, 0.04);
}
.liuyue-item.is-current {
  background: rgba(0, 184, 148, 0.08);
  border-left: 3px solid var(--teal);
  font-weight: 600;
}
.liuyue-item .ly-jieqi {
  color: var(--teal);
  font-size: 11px;
  font-weight: 500;
}
.liuyue-item .ly-date {
  color: var(--text-tertiary);
  font-size: 10px;
}
.liuyue-item .ly-gz {
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  font-size: 12px;
}
.liuyue-item .ly-shishen {
  font-size: 10px;
  color: var(--rose);
  text-align: right;
}

/* ===== 大运进度条 ===== */
.dayun-progress-wrap {
  margin-top: 8px;
}
.dayun-progress {
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.dayun-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  transition: width 0.6s ease;
}
.dayun-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ===== 天干地支留意区域 ===== */
.relation-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .relation-section {
    grid-template-columns: 1fr;
  }
}
.relation-box {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.relation-box h4 {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.relation-box h4 i {
  font-size: 14px;
}
.relation-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  margin: 2px 3px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.relation-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.relation-tag.tooltip-pinned {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(108,92,231,0.2);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.relation-tag.he {
  background: rgba(0, 184, 148, 0.08);
  color: #00B894;
  border: 1px solid rgba(0, 184, 148, 0.15);
}
.relation-tag.chong {
  background: rgba(231, 76, 60, 0.06);
  color: #E74C3C;
  border: 1px solid rgba(231, 76, 60, 0.12);
}
.relation-tag.xing {
  background: rgba(243, 156, 18, 0.06);
  color: #F39C12;
  border: 1px solid rgba(243, 156, 18, 0.12);
}
.relation-tag.hai {
  background: rgba(142, 68, 173, 0.06);
  color: #8E44AD;
  border: 1px solid rgba(142, 68, 173, 0.12);
}
.relation-tag.ke {
  background: rgba(231, 76, 60, 0.04);
  color: #C0392B;
  border: 1px solid rgba(231, 76, 60, 0.08);
}
.relation-tag.po {
  background: rgba(149, 165, 166, 0.08);
  color: #7F8C8D;
  border: 1px solid rgba(149, 165, 166, 0.15);
}
.relation-tag.anhe {
  background: rgba(52, 152, 219, 0.06);
  color: #2980B9;
  border: 1px solid rgba(52, 152, 219, 0.12);
}
.relation-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 8px 0;
}

/* ===== 命盘全局图（相邻标注版） ===== */
.smart-diagram {
  position: relative;
  overflow-x: auto;
  min-width: 0;
}

/* 干支行 */
.sd-gz-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  min-width: 560px;
}
.sd-gz-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 2px;
}
.sd-gz-char {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

/* 相邻关系标签行 */
.sd-rel-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  min-width: 560px;
  /* 列间隙与8列grid对齐：每个gap位于第N列和第N+1列中间 */
  padding: 0 calc(100% / 16);
  min-height: 22px;
}
.sd-rel-gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 20px;
}
.sd-rel-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--rel-color, #999);
  background: color-mix(in srgb, var(--rel-color, #999) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--rel-color, #999) 25%, transparent);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.sd-rel-tag:hover {
  transform: scale(1.08);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--rel-color, #999) 30%, transparent);
  background: color-mix(in srgb, var(--rel-color, #999) 18%, transparent);
}
.sd-rel-tag.tooltip-pinned {
  background: color-mix(in srgb, var(--rel-color, #999) 22%, transparent);
  box-shadow: 0 0 0 1.5px var(--rel-color, #999), 0 1px 4px color-mix(in srgb, var(--rel-color, #999) 30%, transparent);
}

/* 非相邻（远隔）关系列表 */
.sd-distant-list {
  padding: 6px 8px;
  margin-top: 6px;
  background: rgba(0,0,0,0.015);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 11px;
}
.sd-distant-title {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 10px;
  white-space: nowrap;
}
.sd-distant-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border-bottom: 1px dashed currentColor;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
}
.sd-distant-item:hover {
  background: rgba(0,0,0,0.04);
  transform: translateY(-1px);
  opacity: 0.9;
}
.sd-distant-item.tooltip-pinned {
  background: rgba(0,0,0,0.06);
  border-bottom-style: solid;
}
.sd-distant-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 列标签行 */
.sd-label-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  min-width: 560px;
  background: rgba(108, 92, 231, 0.03);
  border-top: 1px solid rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.sd-label-cell {
  text-align: center;
  padding: 4px 2px;
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 辅助信息区 */
.sd-info-section {
  margin-top: 8px;
  min-width: 560px;
}
.sd-info-row {
  display: grid;
  grid-template-columns: 40px repeat(8, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.sd-info-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
}
.sd-info-cell {
  text-align: center;
  padding: 4px 2px;
  font-size: 11px;
}

/* ===== 五行旺衰标签条 ===== */
.wx-strength-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.wx-strength-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
  border: 1px solid transparent;
  transition: transform 0.2s;
}
.wx-strength-tag:hover {
  transform: scale(1.05);
}
.wx-strength-tag .wx-tag-icon {
  font-size: 13px;
  flex-shrink: 0;
}
.wx-strength-tag.s-wang {
  background: rgba(231, 76, 60, 0.08);
  color: #E74C3C;
  border-color: rgba(231, 76, 60, 0.15);
}
.wx-strength-tag.s-xiang {
  background: rgba(243, 156, 18, 0.08);
  color: #F39C12;
  border-color: rgba(243, 156, 18, 0.15);
}
.wx-strength-tag.s-xiu {
  background: rgba(0, 184, 148, 0.08);
  color: #00B894;
  border-color: rgba(0, 184, 148, 0.15);
}
.wx-strength-tag.s-qiu {
  background: rgba(52, 152, 219, 0.06);
  color: #2980B9;
  border-color: rgba(52, 152, 219, 0.12);
}
.wx-strength-tag.s-si {
  background: rgba(149, 165, 166, 0.06);
  color: #7F8C8D;
  border-color: rgba(149, 165, 166, 0.12);
}
.wx-dot-jin { background: #F39C12; }
.wx-dot-mu { background: #27AE60; }
.wx-dot-shui { background: #2980B9; }
.wx-dot-huo { background: #E74C3C; }
.wx-dot-tu { background: #8E6B3E; }

/* ===== 排盘顶部进度条 ===== */
.paipan-top-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12px;
}
.paipan-top-progress .ptp-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.paipan-top-progress .ptp-bar {
  flex: 1;
  height: 16px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  overflow: visible;
  position: relative;
}
.paipan-top-progress .ptp-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  transition: width 0.6s ease;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.paipan-top-progress .ptp-percent {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding-right: 6px;
  line-height: 16px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.paipan-top-progress .ptp-percent.outside {
  position: absolute;
  left: 100%;
  top: 0;
  padding-left: 6px;
  padding-right: 0;
  color: var(--accent);
  text-shadow: none;
}
.paipan-top-progress .ptp-text {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 命盘全局图 — 列点击交互 ===== */
.sd-clickable {
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border-radius: 4px;
}
.sd-clickable:hover {
  background: rgba(108, 92, 231, 0.06);
}
.sd-clickable:active {
  transform: scale(0.96);
}

/* 列详析 tooltip 内部样式 */
.sd-detail-header {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(108, 92, 231, 0.12);
}
.sd-detail-section {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(0,0,0,0.04);
}
.sd-detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sd-detail-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.sd-detail-basic {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sd-detail-gz {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
}
.sd-detail-meta {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
  padding: 1px 6px;
  border-radius: 3px;
}
.sd-detail-nayin {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}
.sd-detail-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sd-detail-kv {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}
.sd-detail-kv strong {
  color: var(--text-primary);
  font-weight: 600;
}
.sd-detail-pos {
  color: #00B894;
}
.sd-detail-neg {
  color: #E67E22;
}
.sd-detail-cg-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sd-detail-cg-item {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sd-detail-cg-role {
  font-size: 9px;
  color: var(--text-tertiary);
  background: rgba(0,0,0,0.04);
  padding: 0 4px;
  border-radius: 2px;
  margin-left: 2px;
}

/* ===== 宫位总论卡片 ===== */
.gw-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .gw-summary-grid {
    grid-template-columns: 1fr;
  }
}
.gw-summary-item {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: box-shadow 0.2s;
}
.gw-summary-item:hover {
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.08);
}
.gw-summary-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.gw-summary-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.gw-summary-pillar {
  font-size: 10px;
  color: var(--text-tertiary);
  background: rgba(108, 92, 231, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}
.gw-summary-age {
  font-size: 10px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
  padding: 1px 5px;
  border-radius: 3px;
}
.gw-summary-governs {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}
.gw-summary-people {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.gw-summary-people strong {
  color: var(--text-primary);
  font-weight: 600;
}
.gw-summary-meaning {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ===== 六亲总论卡片 ===== */
.lq-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .lq-summary-grid {
    grid-template-columns: 1fr;
  }
}
.lq-summary-item {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: box-shadow 0.2s;
}
.lq-summary-item:hover {
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.08);
}
.lq-summary-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.lq-summary-ss {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--rose);
}
.lq-summary-relation {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  background: rgba(108, 92, 231, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
}
.lq-summary-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.lq-summary-influence,
.lq-summary-marriage,
.lq-summary-character {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 2px;
}
.lq-summary-influence strong,
.lq-summary-marriage strong,
.lq-summary-character strong {
  color: var(--text-primary);
  font-weight: 600;
}
