/* 首次使用引导气泡（Guide Tour）。
 * 仅在 Electron 客户端、桌面视口、未完成引导时由 guide-tour.js 挂载。
 * 蒙层用 4 块矩形拼出"空洞"而不是整层遮罩：被高亮的导航项必须保持真实可点，
 * 用户点它跳页后 tour 在新页面续播下一步（状态存 localStorage）。
 *
 * 特异性战争的既定解法：所有规则挂在 #bozhiGuideTour（1-0-0 起）下，天然压过一切
 * 类级全局规则——ops-classic.css 的按钮归一化（0-20-1 全 !important）、app-modern.css
 * 和 dashboard.css 的裸 .btn 规则都赢不了 ID 选择器。按钮因此不需要借 btn 类逃逸；
 * 按钮装饰属性仍带 !important，因为归一化规则带 !important，同级比较才轮得到特异性。 */
#bozhiGuideTour .bozhi-guide-mask {
  position: fixed;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2500; /* 层级契约：须高于 select-menu(2400)，低于 toast(2000) 之上的系统弹层不压 */
  animation: bozhi-guide-fade-in 0.25s ease-out;
}

/* 空洞处的高亮描边，pointer-events 关闭让点击穿透到导航项；呼吸光圈提示可点。 */
#bozhiGuideTour .bozhi-guide-highlight {
  position: fixed;
  border: 2px solid #fff;
  border-radius: 10px;
  z-index: 2501;
  pointer-events: none;
  animation: bozhi-guide-pulse 1.8s ease-in-out infinite;
}

#bozhiGuideTour .bozhi-guide-popover {
  position: fixed;
  width: 320px;
  background: #fff;
  border: 1px solid rgba(231, 234, 241, 0.9);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 18px 18px 16px;
  z-index: 2510;
  animation: bozhi-guide-pop-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

/* 指向高亮目标的箭头：popover 固定在目标右侧且垂直居中，箭头钉在左边缘中点。 */
#bozhiGuideTour .bozhi-guide-popover::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  margin-top: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid rgba(231, 234, 241, 0.9);
  border-bottom: 1px solid rgba(231, 234, 241, 0.9);
  transform: rotate(45deg);
}

#bozhiGuideTour .bozhi-guide-popover-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  padding-right: 24px; /* 给右上角 X 留位 */
}

#bozhiGuideTour .bozhi-guide-popover-desc {
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
  margin-bottom: 16px;
}

#bozhiGuideTour .bozhi-guide-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 步骤圆点：当前步拉长成胶囊，比纯文字 "1/3" 更直观。 */
#bozhiGuideTour .bozhi-guide-step-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

#bozhiGuideTour .bozhi-guide-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #d9dee8;
  transition: all 0.2s ease;
}

#bozhiGuideTour .bozhi-guide-step-dot.active {
  width: 16px;
  background: #7f56d9;
}

#bozhiGuideTour .bozhi-guide-popover-actions {
  display: flex;
  gap: 8px;
}

/* 以下按钮规则全部带 !important：对抗按钮归一化的 !important 属性（见文件头注释）。 */
#bozhiGuideTour .bozhi-guide-btn {
  min-height: 32px;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1px solid #d0d5dd !important;
  background: #fff !important;
  color: #344054 !important;
  box-shadow: none !important;
  font-size: 13px;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#bozhiGuideTour .bozhi-guide-btn:hover {
  background: #f9fafb !important;
  border-color: #98a2b3 !important;
  color: #101828 !important;
}

#bozhiGuideTour .bozhi-guide-btn.primary {
  background: #7f56d9 !important;
  border-color: #7f56d9 !important;
  color: #fff !important;
}

#bozhiGuideTour .bozhi-guide-btn.primary:hover {
  background: #53389e !important;
  border-color: #53389e !important;
  color: #fff !important;
}

/* 关闭按钮做成轻量幽灵样式：小尺寸、无边框无底色的 ×。 */
#bozhiGuideTour .bozhi-guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0 !important;
  border: none !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #98a2b3 !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 400 !important;
  line-height: 1;
  cursor: pointer;
}

#bozhiGuideTour .bozhi-guide-close:hover {
  background: #f2f4f7 !important;
  color: #475467 !important;
}

@keyframes bozhi-guide-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bozhi-guide-pop-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bozhi-guide-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(127, 86, 217, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(127, 86, 217, 0.15); }
}
