/* 定位学习网 · 战略定位诊断浮层
 * 类名统一 dwz- 前缀，避免与站点 Tailwind 样式冲突
 */

/* ---------- 气泡 ---------- */
.dwz-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(145deg, #c62828, #9c1414);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(183, 28, 28, .38), 0 2px 6px rgba(0, 0, 0, .14);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.dwz-bubble:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 26px rgba(183, 28, 28, .46), 0 3px 8px rgba(0, 0, 0, .16);
}
.dwz-bubble:active { transform: scale(.96); }
.dwz-bubble svg { width: 27px; height: 27px; display: block; }

/* 呼吸光圈：只做一次淡出，不长期闪烁打扰阅读 */
.dwz-bubble::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(183, 28, 28, .55);
  animation: dwz-ring 1.9s ease-out 3;
  pointer-events: none;
}
@keyframes dwz-ring {
  0%   { transform: scale(1);   opacity: .75; }
  100% { transform: scale(1.55); opacity: 0; }
}
.dwz-bubble.dwz-on::after { animation: none; }

/* 飘标数字徽记（首次访问提示） */
.dwz-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #f0b429;
  color: #4a3400;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

/* ---------- 飘标 ---------- */
.dwz-tag {
  position: fixed;
  right: 88px;
  bottom: 30px;
  z-index: 9989;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 9px 12px 9px 13px;
  background: #fff;
  border: 1px solid #ece5da;
  border-radius: 11px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .11);
  cursor: pointer;
  opacity: 0;
  transform: translateX(10px) scale(.96);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.dwz-tag.dwz-show {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
/* 指向气泡的小三角 */
.dwz-tag::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  margin-top: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid #ece5da;
  border-top: 1px solid #ece5da;
  transform: rotate(45deg);
}
.dwz-tag__txt {
  font-size: 13px;
  line-height: 1.45;
  color: #2b2b2b;
  font-family: inherit;
}
.dwz-tag__txt b {
  display: block;
  font-size: 13px;
  color: #b71c1c;
  font-weight: 700;
  margin-bottom: 1px;
}
.dwz-tag__txt span {
  font-size: 11.5px;
  color: #8a8478;
  display: block;
}
.dwz-tag__x {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  background: #f2eee7;
  color: #9a9287;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.dwz-tag__x:hover { background: #e6e0d5; color: #6b6459; }

/* ---------- 面板 ---------- */
.dwz-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 9991;
  width: 392px;
  height: 620px;
  max-height: calc(100vh - 110px);
  background: #faf8f5;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22), 0 3px 10px rgba(0, 0, 0, .1);
  overflow: hidden;
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transition: opacity .24s ease, transform .24s cubic-bezier(.34, 1.4, .64, 1);
}
.dwz-panel.dwz-open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.dwz-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #faf8f5;
}

/* 遮罩（仅移动端） */
.dwz-mask {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, .42);
  display: none;
  opacity: 0;
  transition: opacity .24s ease;
}
.dwz-mask.dwz-open { display: block; opacity: 1; }

/* ---------- 让位：原返回顶部按钮上移，避免与气泡重叠 ---------- */
.to-top { bottom: 88px !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 767px) {
  .dwz-bubble {
    width: 52px;
    height: 52px;
    right: 15px;
    bottom: 16px;
  }
  .dwz-bubble svg { width: 24px; height: 24px; }

  .dwz-tag {
    right: 78px;
    bottom: 22px;
    max-width: 190px;
    padding: 8px 10px;
  }
  .dwz-tag__txt b { font-size: 12.5px; }
  .dwz-tag__txt span { font-size: 11px; }

  /* 移动端面板全屏 */
  .dwz-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(100%);
  }
  .dwz-panel.dwz-open { transform: translateY(0); }

  .to-top { bottom: 80px !important; }
}

/* 尊重「减少动效」偏好 */
@media (prefers-reduced-motion: reduce) {
  .dwz-bubble, .dwz-tag, .dwz-panel, .dwz-mask { transition: none !important; }
  .dwz-bubble::after { animation: none !important; }
}
