/* ========== Go2 反馈按钮(左下角悬浮) ========== */

.feedback-widget {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 9999;
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  user-select: none;
}

.feedback-widget--hidden {
  display: none;
}

/* ---------- 主按钮 ---------- */
.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(102, 126, 234, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.feedback-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 8px 20px rgba(102, 126, 234, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.12);
}

.feedback-btn:active {
  transform: translateY(0) scale(0.98);
}

/* 小狗 emoji + 轻微摇晃动画 */
.feedback-btn__icon {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  transform-origin: 50% 80%;
  animation: feedback-wag 2.4s ease-in-out infinite;
}

.feedback-btn:hover .feedback-btn__icon {
  animation: feedback-wag-fast 0.5s ease-in-out infinite;
}

@keyframes feedback-wag {
  0%, 90%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-8deg); }
  94% { transform: rotate(8deg); }
  96% { transform: rotate(-5deg); }
  98% { transform: rotate(5deg); }
}

@keyframes feedback-wag-fast {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* ---------- 关闭按钮 ---------- */
.feedback-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #5a5a5a;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: bold;
  transition: background 0.15s ease, color 0.15s ease;
}

.feedback-widget:hover .feedback-close {
  display: inline-flex;
}

.feedback-close:hover {
  background: #ff5c5c;
  color: #fff;
}

/* ---------- 菜单气泡 ---------- */
.feedback-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.08);
  display: none;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.feedback-menu--open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* 小三角指向按钮 */
.feedback-menu::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.05);
}

.feedback-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #333;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.feedback-menu__item:hover {
  background: #f0f2f8;
}

.feedback-menu__item-icon {
  font-size: 16px;
  line-height: 1;
}

/* ---------- 深色模式 ---------- */
[data-md-color-scheme="slate"] .feedback-menu {
  background: #2d3142;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-md-color-scheme="slate"] .feedback-menu::after {
  background: #2d3142;
}

[data-md-color-scheme="slate"] .feedback-menu__item {
  color: #e6e6e6;
}

[data-md-color-scheme="slate"] .feedback-menu__item:hover {
  background: #3a3f55;
}

[data-md-color-scheme="slate"] .feedback-close {
  background: #3a3f55;
  color: #ddd;
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 600px) {
  .feedback-widget {
    left: 12px;
    bottom: 16px;
  }
  .feedback-btn {
    padding: 8px 14px 8px 12px;
    font-size: 13px;
  }
  .feedback-menu {
    min-width: 200px;
  }
}
