/* ============================================================
   Mindframe 全站漫游引导 · 样式
   2026-11-02
   ------------------------------------------------------------
   结构：.mft-root > .mft-spot（高亮挖孔 + 暗背景）+ .mft-tip（气泡）
   要点：
     ① 暗背景用 spot 的 box-shadow 100vmax 实现，被高亮元素本身不被盖住
     ② 全部元素 pointer-events:none，只有气泡按钮可点 → 不阻断页面操作
     ③ 气泡用 transform 定位，滚动时逐帧跟随，不拖影
   ============================================================ */

.mft-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;

  --mft-accent: #2d46c7;
  --mft-accent-2: #3f5ae0;
  --mft-accent-ink: #ffffff;
  --mft-veil: rgba(9, 13, 24, 0.74);
  --mft-card: rgba(255, 255, 255, 0.985);
  --mft-card-border: rgba(23, 35, 66, 0.1);
  --mft-txt: #111827;
  --mft-sub: #4b5563;
  --mft-dim: #8b95a7;
  --mft-chip: rgba(23, 35, 66, 0.06);
  --mft-shadow: 0 26px 64px -20px rgba(10, 16, 36, 0.5),
    0 2px 10px rgba(10, 16, 36, 0.12);
}

.mft-root.mft-dark {
  --mft-veil: rgba(3, 5, 12, 0.8);
  --mft-card: rgba(20, 23, 34, 0.965);
  --mft-card-border: rgba(255, 255, 255, 0.12);
  --mft-txt: #f4f6fb;
  --mft-sub: #b9c1d2;
  --mft-dim: #7c8598;
  --mft-chip: rgba(255, 255, 255, 0.08);
  --mft-shadow: 0 26px 64px -18px rgba(0, 0, 0, 0.85),
    0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* ---------------- 高亮挖孔 + 暗背景 ---------------- */
.mft-spot {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax var(--mft-veil),
    0 0 0 2px var(--mft-accent) inset;
  transition: border-radius 0.3s ease, opacity 0.24s ease;
  opacity: 0;
  will-change: transform, width, height;
}

.mft-spot.is-on {
  opacity: 1;
}

/* 步骤切换 / 滚动跟随时平滑滑动，而不是硬跳。
   首次出现前不加 .mft-ready，避免从左上角 (0,0) 飞进来。 */
.mft-root.mft-ready .mft-spot {
  transition: transform 0.42s cubic-bezier(0.22, 0.7, 0.3, 1),
    width 0.42s cubic-bezier(0.22, 0.7, 0.3, 1),
    height 0.42s cubic-bezier(0.22, 0.7, 0.3, 1), border-radius 0.3s ease,
    opacity 0.24s ease;
}

/* 高亮框外的一圈柔光，让目标更"跳"出来 */
.mft-spot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* ---------------- 气泡 ---------------- */
.mft-tip {
  position: absolute;
  top: 0;
  left: 0;
  width: 372px;
  max-width: calc(100vw - 28px);
  box-sizing: border-box;
  padding: 18px 20px 16px;
  border-radius: 18px;
  background: var(--mft-card);
  border: 1px solid var(--mft-card-border);
  box-shadow: var(--mft-shadow);
  color: var(--mft-txt);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.24s ease;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  will-change: transform;
}

.mft-tip.is-on {
  opacity: 1;
}

.mft-root.mft-ready .mft-tip {
  transition: transform 0.42s cubic-bezier(0.22, 0.7, 0.3, 1),
    width 0.32s ease, opacity 0.24s ease;
}

.mft-tip.is-center {
  width: 420px;
}

/* 顶部：序号 + 跳过 */
.mft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mft-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mft-accent);
}

.mft-root.mft-dark .mft-eyebrow {
  color: #9fb4ff;
}

.mft-eyebrow i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(45, 70, 199, 0.16);
}

.mft-root.mft-dark .mft-eyebrow i {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.mft-skip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mft-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  margin: -4px -6px -4px 0;
  border-radius: 8px;
  transition: color 0.16s, background 0.16s;
}

.mft-skip:hover {
  color: var(--mft-txt);
  background: var(--mft-chip);
}

.mft-title {
  margin: 0 0 7px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--mft-txt);
}

.mft-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--mft-sub);
}

.mft-desc b,
.mft-desc strong {
  color: var(--mft-txt);
  font-weight: 650;
}

.mft-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.2px;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--mft-chip);
  color: var(--mft-txt);
}

.mft-desc kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--mft-card-border);
  background: var(--mft-chip);
}

/* 底部：进度点 + 动作 */
.mft-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.mft-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.mft-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--mft-dim);
  opacity: 0.4;
  transition: width 0.28s cubic-bezier(0.22, 0.7, 0.3, 1), opacity 0.2s;
  flex: none;
}

.mft-dot.is-on {
  width: 18px;
  opacity: 1;
  background: var(--mft-accent);
}

.mft-root.mft-dark .mft-dot.is-on {
  background: #9fb4ff;
}

.mft-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.mft-btn {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--mft-card-border);
  background: transparent;
  color: var(--mft-sub);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
  white-space: nowrap;
}

.mft-btn:hover {
  background: var(--mft-chip);
  color: var(--mft-txt);
}

.mft-btn:active {
  transform: scale(0.975);
}

.mft-btn[disabled] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.mft-btn-primary {
  background: linear-gradient(135deg, var(--mft-accent), var(--mft-accent-2));
  border-color: transparent;
  color: var(--mft-accent-ink);
  box-shadow: 0 8px 20px -8px rgba(12, 18, 40, 0.6);
}

.mft-btn-primary:hover {
  background: linear-gradient(135deg, var(--mft-accent-2), var(--mft-accent));
  color: var(--mft-accent-ink);
  box-shadow: 0 10px 24px -8px rgba(12, 18, 40, 0.7);
}

/* 箭头 */
.mft-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--mft-card);
  border-left: 1px solid var(--mft-card-border);
  border-top: 1px solid var(--mft-card-border);
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
  pointer-events: none;
  display: none;
}

.mft-arrow.is-on {
  display: block;
}

/* 缩小屏：气泡钉在底部 */
@media (max-width: 560px) {
  .mft-tip,
  .mft-tip.is-center {
    width: auto;
    left: 12px !important;
    right: 12px;
    max-width: none;
    top: auto !important;
    bottom: 12px;
  }

  .mft-tip {
    padding: 16px 17px 14px;
    border-radius: 16px;
  }

  .mft-title {
    font-size: 15.5px;
  }

  .mft-desc {
    font-size: 13px;
    line-height: 1.65;
  }

  .mft-arrow {
    display: none !important;
  }

  .mft-dots {
    display: none;
  }

  .mft-foot {
    margin-top: 14px;
  }

  .mft-btn {
    padding: 11px 15px;
    font-size: 13px;
  }
}

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .mft-spot,
  .mft-tip,
  .mft-dot {
    transition: none !important;
  }
}
