/* AI Image 结果展示样式 */
#ai-image .chat-message.assistant .chat-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#ai-image .ai-image-result-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

#ai-image .ai-image-result-media {
    flex: 0 0 auto;
}

#ai-image .ai-image-result-text {
    min-height: 32px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

#ai-image .chat-image {
    display: block;
    width: min(100%, 320px);
    max-width: 320px;
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
}

#ai-image .ai-image-item-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

#ai-image .ai-image-download-btn {
    position: static;
    background: rgba(255, 255, 255, 0.08);
    color: #9ea9bf;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    opacity: 1;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

#ai-image .ai-image-download-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

#ai-image .ai-image-action-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

#ai-image .ai-image-audit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

#ai-image .ai-image-audit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#ai-image .ai-image-audit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.ai-image-preview-overlay .ai-image-preview-full {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#ai-image .chat-media-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: min(100%, 680px);
}

/* AI Image 主要布局样式 */
#ai-image .video-v2-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px clamp(16px, 3vw, 32px) 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
    min-width: 0;
    scroll-behavior: smooth;
    background: #0b0d13 !important;
}

#ai-image .video-v2-log-card {
    background: #0b0d13 !important;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0 auto;
    min-height: auto;
    max-width: 1320px;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

#ai-image .video-v2-log-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(76, 133, 240, 0.08), transparent 34%);
}

#ai-image #aiImageMessages.chat-messages {
    margin: 0;
    padding: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

#ai-image .video-v2-bottom-bar {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    width: auto;
    padding: 0 18px 18px;
    box-sizing: border-box;
    z-index: 120;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
}

body.sidebar-auto-hide #ai-image .video-v2-bottom-bar {
    left: 56px;
}

body.sidebar-collapsed #ai-image .video-v2-bottom-bar {
    left: 64px;
}

#ai-image #aiImageComposerBlock {
    position: relative;
    width: min(100%, 640px);
    max-width: 640px;
    min-width: 0;
    margin: 0 auto;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), max-width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#ai-image #aiImageComposerBlock:hover,
#ai-image #aiImageComposerBlock:focus-within,
#ai-image #aiImageComposerBlock.has-text {
    width: min(100%, 1040px);
    max-width: 1040px;
}

/* AI Image 输入框容器 */
#ai-image #aiImageMediaDrop.video-v2-chat-input-container {
    display: block;
    background: linear-gradient(180deg, rgba(29, 30, 34, 0.98) 0%, rgba(20, 21, 24, 1) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34) !important;
    padding: 14px 16px 12px !important;
    position: relative;
    min-width: 0;
    overflow: visible;
    cursor: text;
}

#ai-image .video-v2-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 100%;
    transition: align-items 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#ai-image .video-v2-inline-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #8fb4ff;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
    opacity: 1;
    pointer-events: auto;
    width: auto;
    margin: 0;
}

#ai-image .video-v2-inline-add-btn:hover {
    color: #c7ddff;
    background: transparent;
    border-color: transparent;
}

#ai-image #aiImageComposerBlock:hover .video-v2-inline-add-btn,
#ai-image #aiImageComposerBlock:focus-within .video-v2-inline-add-btn,
#ai-image #aiImageComposerBlock.has-text .video-v2-inline-add-btn {
    width: auto;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}

#ai-image .video-v2-inline-add-text-btn {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
}

#ai-image #aiImageComposerBlock:hover .video-v2-input-row,
#ai-image #aiImageComposerBlock:focus-within .video-v2-input-row,
#ai-image #aiImageComposerBlock.has-text .video-v2-input-row {
    align-items: flex-end;
}

#ai-image #aiImageMediaDrop.video-v2-chat-input-container.dragover {
    outline: 2px dashed var(--border-focus);
    outline-offset: 2px;
    border-radius: 20px;
}

/* AI Image 输入框样式 */
#ai-image #aiImagePromptInput.video-v2-chat-input {
    flex: 1;
    display: block;
    box-sizing: border-box;
    border: none;
    outline: none;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary, #94a3b8) !important;
    min-height: 40px;
    max-height: 40px;
    height: 40px;
    background: transparent;
    padding: 0 10px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: hidden;
    overflow-y: scroll !important;
    resize: none;
    transition: min-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), line-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s ease;
    position: relative;
    z-index: 2;
    margin: 0;
}

.video-v2-chat-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

/* 输入时始终显示的提示文字 - 图片预览旁边 */
#ai-image .ai-image-hint-text {
    display: flex;
    align-items: center;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(158, 169, 191, 0.5);
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 4px 8px;
    flex-shrink: 0;
}

#ai-image #aiImageComposerBlock:hover .ai-image-hint-text,
#ai-image #aiImageComposerBlock:focus-within .ai-image-hint-text,
#ai-image #aiImageComposerBlock.has-text .ai-image-hint-text {
    display: flex;
}

.video-v2-chat-input-highlights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-word;
    color: transparent;
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
    transition: padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), line-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.video-v2-chat-input-highlights .mention-hl {
    color: transparent;
    background-color: rgba(33, 150, 243, 0.2);
    border-radius: 4px;
    padding: 0;
}

#ai-image #aiImageComposerBlock:hover #aiImagePromptInput.video-v2-chat-input,
#ai-image #aiImageComposerBlock:focus-within #aiImagePromptInput.video-v2-chat-input,
#ai-image #aiImageComposerBlock.has-text #aiImagePromptInput.video-v2-chat-input {
    min-height: 92px;
    max-height: 200px;
    padding: 10px 46px 10px 10px !important;
    line-height: 1.65 !important;
    color: var(--text-primary) !important;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: scroll !important;
    overflow-x: hidden;
}

#ai-image #aiImageComposerBlock:hover .video-v2-chat-input-highlights,
#ai-image #aiImageComposerBlock:focus-within .video-v2-chat-input-highlights,
#ai-image #aiImageComposerBlock.has-text .video-v2-chat-input-highlights {
    padding: 10px 46px 10px 10px !important;
    line-height: 1.65 !important;
}

/* AI Image 发送按钮样式 */
#ai-image .video-v2-send-btn {
    border: none;
    width: 20px;
    height: 20px;
    font-size: 11px;
    border-radius: 999px;
    background: #313744;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease, background 0.3s ease, bottom 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease, font-size 0.22s ease, opacity 0.16s ease;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

#ai-image #aiImageComposerBlock:hover .video-v2-send-btn,
#ai-image #aiImageComposerBlock:focus-within .video-v2-send-btn,
#ai-image #aiImageComposerBlock.has-text .video-v2-send-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    top: auto;
    bottom: 8px;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    border: 1px solid #5880dd;
    background: radial-gradient(circle at 30% 28%, #6ea0ff 0%, #4f7fe6 45%, #3f6fd8 100%);
    box-shadow: 0 6px 14px rgba(43, 109, 229, 0.28);
}

#ai-image .video-v2-send-btn:hover {
    filter: brightness(1.08);
    border-color: #6f97f0;
    box-shadow: 0 8px 18px rgba(43, 109, 229, 0.32);
}

#ai-image .video-v2-send-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(43, 109, 229, 0.24);
}

/* AI Image 下拉框样式 */
#ai-image .ai-image-dropdowns {
    position: absolute;
    right: 8px;
    bottom: 48px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

#ai-image #aiImageComposerBlock:hover .ai-image-dropdowns,
#ai-image #aiImageComposerBlock:focus-within .ai-image-dropdowns,
#ai-image #aiImageComposerBlock.has-text .ai-image-dropdowns {
    display: flex;
}

#ai-image .ai-image-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(30, 33, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #9ea9bf;
    font-size: 12px;
    padding: 4px 24px 4px 8px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ea9bf'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
    transition: border-color 0.2s, color 0.2s;
}

#ai-image .ai-image-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

#ai-image .ai-image-select:focus {
    border-color: #4968b8;
    color: #fff;
}

#ai-image .ai-image-select option {
    background: #1e2128;
    color: #e2e8f0;
}

/* AI Image 控制按钮行样式 */
#ai-image .video-v2-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border-top: 1px solid transparent;
    margin-top: 0;
    flex-wrap: wrap;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), max-height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), margin 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
}

#ai-image #aiImageComposerBlock:hover .video-v2-controls-row,
#ai-image #aiImageComposerBlock:focus-within .video-v2-controls-row,
#ai-image #aiImageComposerBlock.has-text .video-v2-controls-row {
    padding: 10px 4px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 100px;
}

#ai-image .video-v2-controls-actions {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#ai-image .video-v2-control-item {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    border: none;
    background: transparent;
    padding: 0;
}

#ai-image .video-v2-control-item:hover {
    color: var(--text-primary);
}

#ai-image .video-v2-add-media-btn {
    width: auto;
    height: auto;
    border-radius: 0;
    padding: 0;
    justify-content: flex-start;
}

#ai-image .video-v2-add-media-text-btn {
    color: #8fb4ff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

#ai-image .video-v2-add-media-text-btn:hover {
    color: #c7ddff;
}

/* AI Image 参数面板样式 */
#ai-image .video-v2-param-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: min(380px, calc(100vw - 40px));
    max-width: 100%;
    background: #181b21;
    border: 1px solid #313744;
    border-radius: 20px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.44);
    padding: 24px;
    gap: 20px;
    z-index: 2000;
}

#ai-image .video-v2-param-group {
    display: grid;
    gap: 10px;
}

#ai-image .video-v2-param-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

#ai-image .video-v2-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

#ai-image .video-v2-btn-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#ai-image .video-v2-param-panel .video-option-btn {
    padding: 6px;
    font-size: 12px;
    border: 1px solid #343b49;
    background: #1f232b;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    color: #9ea9bf;
}

#ai-image .video-v2-param-panel .video-option-btn.active {
    border-color: #4968b8;
    color: #b6c8f3;
    background: #202a3f;
}

#ai-image .video-v2-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ai-image .video-v2-slider-row input[type="range"] {
    width: 100%;
}

#ai-image .video-v2-slider-value {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* AI Image 页面提示信息样式 */
#ai-image .video-v2-page-note {
    margin: 12px 20px 0;
    padding: 10px 14px;
    border: 1px solid rgba(88, 166, 255, 0.65);
    background: linear-gradient(90deg, rgba(16, 26, 46, 0.96), rgba(24, 39, 68, 0.96));
    border-radius: 12px;
    color: #eaf2ff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 10px 24px rgba(10, 18, 34, 0.28);
}

#ai-image .video-v2-page-note-sep {
    color: #7fc4ff;
    opacity: 0.9;
}

/* 通用按钮样式 */
.video-option-btn {
    height: 34px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--trans-fast);
}

.video-option-btn:hover {
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.video-option-btn.active {
    border-color: var(--border-focus);
    color: var(--text-primary);
    background: #1c2230;
}

/* 媒体预览样式 */
.chat-media-preview-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.chat-media-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 280px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #17171b;
    padding: 4px 6px;
    min-height: 46px;
}

.chat-media-preview video,
.chat-media-preview img {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    background: #000;
}

.chat-media-preview audio {
    height: 34px;
    width: 220px;
    outline: none;
    border-radius: 6px;
}

.chat-media-preview audio::-webkit-media-controls-panel {
    background-color: #2a2d36;
    border-radius: 6px;
}

.chat-media-preview audio::-webkit-media-controls-current-time-display,
.chat-media-preview audio::-webkit-media-controls-time-remaining-display {
    color: #e2e8f0;
}

.chat-media-preview audio::-webkit-media-controls-play-button,
.chat-media-preview audio::-webkit-media-controls-mute-button {
    filter: invert(1);
}

.chat-media-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
    color: var(--text-secondary);
    font-size: 10.5px;
}

/* 聊天消息内容样式 */
.chat-message-content {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0;
}

.chat-user-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.chat-inline-previews {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chat-inline-thumb {
    width: 40px;
    height: 40px;
}