.ai-generate-input-area {
    position: relative;
}

.ai-generate-ref-mention__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 120px;
    padding: 14px 16px;
    border-radius: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 2;
    scrollbar-color: #555555 #2d2d2d;
    scrollbar-width: thin;
}

/* 视频创意描述 textarea 与图生图字号/内边距不一致，叠加层需对齐，否则高亮文字与光标错位、看起来像「字不见了」 */
.ai-generate-video__prompt-input-area > .ai-generate-ref-mention__overlay {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.45;
}

.ai-generate-ref-mention__overlay[hidden] {
    display: none !important;
}

.ai-generate-textarea--mention-highlight {
    position: relative;
    z-index: 3;
    background: transparent !important;
    color: transparent !important;
    caret-color: #f5f7ff;
}

.ai-generate-textarea--mention-highlight::placeholder {
    color: transparent !important;
}

.ai-generate-ref-mention__placeholder {
    color: rgba(170, 178, 198, 0.72);
}

.ai-generate-ref-mention__token {
    color: #41d77f;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(65, 215, 127, 0.15);
}

/* 图生图 @ 引用（独立命名空间 ai-generate-ref-mention-*） */
.ai-generate-ref-mention {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* 视频创意描述：与 textarea 同宽一列，避免绝对定位下拉参照到更外层导致铺满屏宽 */
.ai-generate-ref-mention--video {
    margin-top: 0;
}

.ai-generate-ref-mention[hidden] {
    display: none !important;
}

.ai-generate-ref-mention__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-generate-ref-mention__chip {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
}

.ai-generate-ref-mention__chip:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

.ai-generate-ref-mention__chip-remove {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    padding: 0;
}

.ai-generate-ref-mention__chip-remove:hover {
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.ai-generate-ref-mention__dropdown {
    position: absolute;
    left: 0;
    right: 0;
    /* 放在 textarea 下方：textarea 最小高度 120px，候选下拉靠近输入框底部更易找 */
    top: calc(120px + 10px);
    margin: 0;
    padding: 6px 0;
    list-style: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.98);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    max-height: 220px;
    overflow: auto;
    z-index: 12;
    box-sizing: border-box;
    scrollbar-color: #555555 #2d2d2d;
    scrollbar-width: thin;
}

.ai-generate-ref-mention__dropdown[hidden] {
    display: none !important;
}

.ai-generate-ref-mention__option {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
}

.ai-generate-ref-mention__option:hover,
.ai-generate-ref-mention__option--active {
    background: rgba(255, 255, 255, 0.08);
}

.ai-generate-ref-mention__thumb {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ai-generate-ref-mention__label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.ai-generate-ref-image-slot--image.ai-generate-ref-image-slot--mention-highlight {
    outline: 2px solid rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
    border-radius: 10px;
}

.ai-generate-video-ref-media__slot--item.ai-generate-video-ref-media__slot--mention-highlight {
    outline: 2px solid rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
    border-radius: 10px;
}

