/* BODHI Dashboard · css/ref-mention.css · @图片N·@音频N 悬浮预览 + @ 自动补全菜单
   ⚠ 层叠顺序 = index.html 里 <link> 的先后，别随手调换。*/

/* @图片N prompt mention + 悬浮 ref 预览 tip */
.ref-mention {
  color: rgb(138 103 48);
  border-bottom: 1px dashed rgb(201 163 107);
  cursor: zoom-in;
  font-weight: 600;
  padding: 0 1px;
}
.dark .ref-mention { color: rgb(201 163 107); border-bottom-color: rgb(138 103 48); }
.ref-mention:hover { background: rgba(201,163,107,0.18); border-radius: 3px; }
.ref-mention-audio {
  color: rgb(109 40 217);
  border-bottom-color: rgb(167 139 250);
  cursor: default;
}
.dark .ref-mention-audio { color: rgb(196 181 253); border-bottom-color: rgb(124 58 237); }
.ref-mention-audio:hover { background: rgba(139,92,246,0.18); border-radius: 3px; }
.ref-mention-broken {
  color: rgb(220 60 60);
  border-bottom-style: dotted;
  border-bottom-color: rgb(220 60 60);
  cursor: help;
}
.ref-tip {
  position: fixed;
  z-index: 200;
  /* 宽一些：16:9 故事板/横图要看全，不再方框裁切 */
  width: min(420px, calc(100vw - 16px));
  max-height: min(70vh, 560px);
  background: white;
  border: 1px solid rgb(214 211 209);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  padding: 6px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.dark .ref-tip { background: rgb(28 25 23); border-color: rgb(68 64 60); }
.ref-tip-img {
  width: 100%;
  max-height: min(60vh, 480px);
  display: block;
  border-radius: 5px;
  /* 看全图：不强制方框、不 cover 裁切 */
  object-fit: contain;
  object-position: center;
  background: #111;
  flex: 0 1 auto;
}
.ref-tip-cap {
  font-size: 11px;
  line-height: 1.35;
  margin-top: 5px;
  color: rgb(87 83 78);
  max-height: 3.4em;
  overflow: hidden;
}
.dark .ref-tip-cap { color: rgb(168 162 158); }

/* @音频N / @audioN 悬浮预览：需要交互（点播放键），覆盖 .ref-tip 的 pointer-events:none */
.ref-tip-audio {
  pointer-events: auto;
  width: 220px;
}
.ref-tip-cap-audio {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 600;
  color: rgb(109 40 217);
}
.dark .ref-tip-cap-audio { color: rgb(196 181 253); }
.ref-tip-audio-el {
  width: 100%;
  height: 32px;
  display: block;
}

/* 视频附件悬浮 tip：小播放器，可移入 tip 点播 */
.ref-tip-video {
  pointer-events: auto;
  width: min(320px, calc(100vw - 16px));
}
.ref-tip-cap-video {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 600;
  color: rgb(14 116 144);
}
.dark .ref-tip-cap-video { color: rgb(103 232 249); }
.ref-tip-video-el {
  width: 100%;
  max-height: 180px;
  display: block;
  border-radius: 5px;
  background: #111;
}

/* @ 自动补全：编辑 prompt 时打 @ 弹出的参考图候选列表（z 高于 ref-tip，避免被悬浮预览挡住）*/
.ref-mention-menu {
  position: fixed;
  z-index: 210;
  width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background: white;
  border: 1px solid rgb(214 211 209);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  padding: 4px;
}
.dark .ref-mention-menu { background: rgb(28 25 23); border-color: rgb(68 64 60); }
.ref-mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.ref-mention-item.active,
.ref-mention-item:hover { background: rgba(201,163,107,0.18); }
.ref-mention-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}
.ref-mention-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(220 60 60);
  font-size: 12px;
  background: rgb(245 245 244);
}
.dark .ref-mention-thumb-empty { background: rgb(41 37 36); }
.ref-mention-thumb-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: rgba(139,92,246,0.15);
}
.dark .ref-mention-thumb-audio { background: rgba(139,92,246,0.22); }
.ref-mention-txt { min-width: 0; flex: 1; }
.ref-mention-slot { font-size: 11px; font-weight: 600; color: rgb(87 83 78); }
.dark .ref-mention-slot { color: rgb(214 211 209); }
.ref-mention-label {
  font-size: 10px;
  color: rgb(120 113 108);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-mention-empty { padding: 8px; font-size: 11px; color: rgb(168 162 158); text-align: center; }
