/* 智能体输入区与扩展编辑器共享的紧凑编号素材条。 */
.agent-draft-attachments {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 1px 5px;
  box-sizing: border-box;
  scrollbar-width: thin;
}
.agent-draft-attachments:empty { display: none; }
.agent-draft-attachments .agent-draft-media {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 104px;
  height: 34px;
  box-sizing: border-box;
  gap: 5px;
  padding: 2px 3px;
  border: 1px solid #808d55;
  border-radius: 7px;
  background: #242424;
  color: #f4fae1;
}
.agent-draft-attachments .agent-draft-media > .agent-draft-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 28px;
  min-width: 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #121015;
  color: #e7f2c1;
  cursor: zoom-in;
}
.agent-draft-attachments .agent-draft-thumb > img,
.agent-draft-attachments .agent-draft-thumb > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.agent-draft-attachments .agent-draft-label {
  flex: 0 0 auto;
  min-width: 26px;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.agent-draft-attachments .agent-draft-media > .agent-draft-remove,
.agent-draft-attachments .agent-draft-file > .agent-draft-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.agent-draft-attachments .agent-draft-remove:hover:not(:disabled) { background: #ffffff24; }
.agent-draft-attachments .agent-draft-thumb:focus-visible,
.agent-draft-attachments .agent-draft-remove:focus-visible { outline: 2px solid #e8ff99; outline-offset: 1px; }
.agent-draft-attachments .agent-draft-remove:disabled { opacity: .45; cursor: not-allowed; }
.agent-draft-attachments .agent-draft-file {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: min(240px, 70vw);
  min-width: 0;
  height: 34px;
  box-sizing: border-box;
  gap: 5px;
  padding: 2px 5px 2px 8px;
  border: 1px solid #808d55;
  border-radius: 7px;
  background: #242424;
  color: #f4fae1;
}
.agent-draft-attachments .agent-draft-file > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
html[data-theme=light] .agent-draft-attachments :is(.agent-draft-media,.agent-draft-file) {
  background: #fbffed;
  border-color: #cbd99c;
  color: #5b682d;
}
html[data-theme=light] .agent-draft-attachments .agent-draft-thumb { background: #f1f6de; color: #68753b; }
html[data-theme=light] .agent-draft-attachments .agent-draft-remove:hover:not(:disabled) { background: #5a69261c; }

/* 素材条占独立一行，编辑内容填满余下空间，引用菜单锚定在编辑区内。 */
.agent-floating-editor .agent-editor-composer {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.agent-floating-editor .agent-editor-composer > .agent-draft-attachments {
  flex: 0 0 auto;
  padding: 8px 14px 4px;
}
.agent-floating-editor .agent-editor-mention-anchor {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.agent-floating-editor .agent-editor-mention-anchor > .prompt-inline-input {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: auto;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.65;
}
.agent-floating-editor .agent-editor-mention-anchor > .agent-picker {
  position: absolute;
  bottom: 8px;
  left: 14px;
  z-index: 8;
  max-height: min(310px, 65%);
}

/* 素材点击预览：限制尺寸、保留完整画面和视频控制条。 */
.agent-draft-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: #000c;
}
.agent-draft-preview {
  display: flex;
  flex-direction: column;
  width: min(1000px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 40px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #5c5f51;
  border-radius: 12px;
  background: #141317;
  color: #f8faf3;
  box-shadow: 0 20px 60px #0009;
}
.agent-draft-preview .agent-draft-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  box-sizing: border-box;
  border-bottom: 1px solid #45483a;
}
.agent-draft-preview .agent-draft-preview-head > :first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-draft-preview .agent-draft-preview-head > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #5c5f51;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.agent-draft-preview > img,
.agent-draft-preview > video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 112px);
  min-height: 0;
  margin: auto;
  object-fit: contain;
}
html[data-theme=light] .agent-draft-preview { background: #fff; color: #262626; border-color: #cdd1c1; }
html[data-theme=light] .agent-draft-preview .agent-draft-preview-head { border-color: #e3e5db; }
html[data-theme=light] .agent-draft-preview .agent-draft-preview-head > button { border-color: #cdd1c1; }
.agent-draft-attachments .agent-draft-thumb { position: relative; }
.agent-draft-attachments .agent-draft-thumb > :is(img,video) { position: absolute; inset: 0; }
.agent-draft-attachments .agent-draft-thumb > [hidden] { display: none; }
.agent-floating-editor .agent-editor-mention-anchor > .prompt-inline-input { padding-bottom: 50px; }
.agent-floating-editor .agent-editor-mention-anchor > .agent-picker { bottom: 44px; }
.agent-message .agent-message-error { margin: 8px 0 10px; }
