/*!
 * yuexinmiao-widget v1.0.0 — 月薪喵 网页看板娘挂件样式
 * 配合 yuexinmiao-widget.js 使用。所有样式均带 .yuexinmiao-widget 前缀，避免污染宿主页面。
 */

/* ---- 挂件根容器：固定在右下角 ---- */
.yuexinmiao-widget {
  position: fixed;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;          /* 容器本身不挡事件 */
  transition: opacity .25s ease;
}
.yuexinmiao-widget > * { pointer-events: auto; } /* 子元素恢复事件 */
.yuexinmiao-widget.ym-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- 精灵舞台 ---- */
.ym-stage {
  position: relative;
  cursor: grab;
  touch-action: none;            /* 拖拽时不触发滚动 */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .28));
}
.ym-stage:active { cursor: grabbing; }
.ym-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ---- 对话气泡 ---- */
.ym-bubble {
  position: relative;
  max-width: 220px;
  margin: 0 8px 8px 0;
  padding: 8px 26px 8px 12px;
  background: #fff;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
  border: 1px solid #ffe7a3;
  opacity: 0;
  transform: translateY(8px) scale(.92);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}
.ym-bubble.ym-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
/* 气泡小尾巴 */
.ym-bubble::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #ffe7a3;
  border-bottom: 1px solid #ffe7a3;
  transform: rotate(45deg);
}
.ym-bubble-text { display: inline; }
.ym-bubble-close {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
}
.ym-bubble-close:hover { color: #333; background: #f5f5f5; }

/* ---- 工具栏（默认隐藏，悬停挂件时浮现） ---- */
.ym-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  margin-right: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}
.yuexinmiao-widget:hover .ym-toolbar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ym-select {
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  color: #555;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}
.ym-select:hover { border-color: #ffb74d; }
.ym-btn {
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  font-size: 13px;
  line-height: 1;
  color: #555;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: background .15s ease, color .15s ease;
}
.ym-btn:hover { background: #fff3e0; color: #e65100; border-color: #ffb74d; }
.ym-btn-hide { font-size: 16px; line-height: 24px; }

/* ---- 唤回按钮（隐藏后显示） ---- */
.ym-show-btn {
  position: fixed;
  z-index: 99997;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #ff9800;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid #ffe0b2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}
.ym-show-btn.ym-show-on {
  display: flex;
  opacity: 1;
}
.ym-show-btn:hover { transform: scale(1.08); background: #fff3e0; }

/* ---- 小屏适配：避免遮挡内容 ---- */
@media (max-width: 480px) {
  .ym-bubble { max-width: 60vw; font-size: 12px; }
}
