.wrapper {
  flex: 1;
  padding: 4px 0;
  position: relative;
}

.editor {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  min-height: 24px;
  max-height: 202px;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder {
  position: absolute;
  top: 4px;
  left: 0;
  color: var(--color-border-modal-hover);
  font-size: 14px;
  line-height: 1.6;
  pointer-events: none;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
}

/* @ mention tag (inserted as contentEditable=false span) */
.mention {
  display: inline-block;
  white-space: nowrap;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 4px;
  background: var(--color-mention-bg);
  color: var(--color-mention-text);
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s, opacity 0.15s;
}

.mentionAudioIcon {
  display: inline-block;
  margin-right: 3px;
  font-size: 13px;
  vertical-align: middle;
  pointer-events: none;
}

.mentionAudioIcon::before {
  content: '\266B'; /* ♫ rendered via CSS, not textContent — avoids polluting prompt text */
}

.mentionImg {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 3px;
  display: inline-block;
  pointer-events: none;
}

.dragging {
  opacity: 0.4;
}

.mention:hover {
  background: var(--color-mention-bg-hover);
  color: var(--color-mention-text-hover);
}

/* Mention popup — appears above cursor (V2 玻璃面) */
.mentionPopup {
  position: absolute;
  z-index: 100;
  background: var(--color-bg-glass-strong);
  border: 1px solid var(--color-border-card);
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
  max-width: 280px;
  /* 阴影 + 玻璃顶边白高光 */
  box-shadow:
    0 8px 24px var(--color-shadow-dropdown),
    inset 0 1px 0 var(--color-inset-highlight-strong);
  backdrop-filter: var(--bf-glass-md);
  -webkit-backdrop-filter: var(--bf-glass-md);
  transform: translateY(-100%);
  animation: fadeInUp 0.12s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(-100%) translateY(4px); }
  to { opacity: 1; transform: translateY(-100%); }
}

.mentionHeader {
  padding: 4px 8px 6px;
  font-size: 11px;
  color: var(--color-border-modal-hover);
  border-bottom: 1px solid var(--color-border-modal);
  margin-bottom: 4px;
}

.mentionItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}

.mentionItem:hover {
  background: var(--color-bg-card);
}

.mentionItemActive {
  background: var(--color-mention-bg-active);
  color: var(--color-text-primary);
}

.mentionThumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbMedia {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mentionLabel {
  flex: 1;
  color: var(--color-text-primary);
  font-size: 13px;
}

.mentionType {
  color: var(--color-border-modal-hover);
  font-size: 11px;
}

/* Hover preview tooltip */
.previewTooltip {
  position: absolute;
  z-index: 200;
  transform: translate(-50%, -100%);
  background: var(--color-bg-modal-hover);
  border: 1px solid var(--color-border-modal);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px var(--color-overlay-soft);
  pointer-events: none;
  animation: fadeIn 0.1s ease;
}

.previewMedia {
  display: block;
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.previewLabel {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 11px;
  margin-top: 4px;
}
