/* 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;
    padding: 24px;
    box-sizing: border-box;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.ai-image-preview-dialog {
    position: relative;
    width: min(92vw, 1080px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 16px;
    background: var(--mayaa-surface, #111114);
    box-shadow: 0 28px 80px rgba(0,0,0,.68);
    overflow: hidden;
    cursor: default;
}

.ai-image-preview-stage {
    min-height: 0;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #08080a;
}

.ai-image-preview-overlay .ai-image-preview-full {
    max-width: 100%;
    max-height: 66vh;
    object-fit: contain;
    border-radius: 8px;
}

.ai-image-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.ai-image-preview-actions {
    display: flex;
    justify-content: center;
    gap: 22px;
    padding: 14px 18px;
    border-top: 1px solid var(--mayaa-line, rgba(255,255,255,.09));
}

.ai-image-preview-action,
.ai-image-preview-submit-audit {
    min-height: 38px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 9px;
    background: var(--mayaa-surface-2, #18181c);
    color: var(--mayaa-text, #f5f5f6);
    font-weight: 600;
    cursor: pointer;
}

.ai-image-preview-action.audit,
.ai-image-preview-submit-audit {
    border-color: var(--mayaa-gold, #ffae19);
    background: linear-gradient(135deg, var(--mayaa-gold-bright, #ffc34f), #ff9f0a);
    color: #18120a;
}

.ai-image-preview-audit-form {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 10003;
    width: min(440px, calc(100vw - 40px));
    padding: 18px 20px 20px;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 14px;
    background: var(--mayaa-surface, #111114);
    box-shadow: 0 30px 90px rgba(0,0,0,.78), 0 0 0 9999px rgba(0,0,0,.5);
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.ai-image-preview-audit-form[hidden] {
    display: none;
}

.ai-image-preview-audit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    color: var(--mayaa-text, #f5f5f6);
    font-size: 17px;
}

.ai-image-preview-audit-close {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 50%;
    background: var(--mayaa-surface-2, #18181c);
    color: var(--mayaa-muted, #b3b3b8);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.ai-image-preview-audit-close:hover {
    border-color: var(--mayaa-gold, #ffae19);
    color: var(--mayaa-gold-bright, #ffc34f);
}

.ai-image-preview-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--mayaa-muted, #b3b3b8);
    font-size: 13px;
}

.ai-image-preview-field input[type="text"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 9px;
    outline: none;
    background: var(--mayaa-surface-2, #18181c);
    color: var(--mayaa-text, #f5f5f6);
}

.ai-image-preview-field input[type="text"]:focus {
    border-color: var(--mayaa-gold, #ffae19);
}

.ai-image-preview-category-list {
    display: flex;
    gap: 8px;
}

.ai-image-preview-category-list label {
    cursor: pointer;
}

.ai-image-preview-category-list input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ai-image-preview-category-list span {
    min-width: 72px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 8px;
    background: var(--mayaa-surface-2, #18181c);
    color: var(--mayaa-muted, #b3b3b8);
}

.ai-image-preview-category-list input:checked + span {
    border-color: var(--mayaa-gold, #ffae19);
    background: rgba(255,174,25,.1);
    color: var(--mayaa-gold-bright, #ffc34f);
}

.ai-image-preview-submit-audit {
    width: 100%;
}

.ai-image-preview-submit-audit:disabled {
    opacity: .65;
    cursor: wait;
}

/* Audit success / save-to-library modal in the project black-and-gold theme. */
.audit-save-modal {
    background: rgba(0, 0, 0, .76) !important;
    backdrop-filter: blur(8px);
}

.audit-save-modal .audit-save-modal-card {
    background: linear-gradient(180deg, var(--mayaa-surface, #111114), #0b0b0e) !important;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14));
    border-radius: 18px !important;
    box-shadow: 0 30px 90px rgba(0,0,0,.72), 0 0 0 1px rgba(255,174,25,.035) inset !important;
}

.audit-save-modal .audit-save-modal-card > div:first-child {
    color: var(--mayaa-gold-bright, #ffc34f) !important;
}

.audit-save-modal .audit-save-modal-card h3 {
    color: var(--mayaa-text, #f7f7f8) !important;
}

.audit-save-modal .audit-save-modal-card p {
    color: var(--mayaa-muted, #a7a7ad) !important;
}

.audit-save-modal .audit-save-modal-card > div[style*="background:rgba(255,255,255,0.05)"] {
    background: var(--mayaa-surface-2, #18181c) !important;
    border: 1px solid var(--mayaa-line, rgba(255,255,255,.09));
}

.audit-save-modal .audit-save-modal-card > div[style*="background:rgba(255,255,255,0.05)"] > div:last-child {
    color: var(--mayaa-gold-bright, #ffc34f) !important;
}

.audit-save-modal #assetNameInput,
.audit-save-modal #assetCategorySelect {
    border-color: var(--mayaa-line-strong, rgba(255,255,255,.14)) !important;
    background: var(--mayaa-surface-2, #18181c) !important;
    color: var(--mayaa-text, #f7f7f8) !important;
}

.audit-save-modal #assetNameInput:focus,
.audit-save-modal #assetCategorySelect:focus {
    border-color: var(--mayaa-gold, #ffae19) !important;
    box-shadow: 0 0 0 3px rgba(255,174,25,.1);
}

.audit-save-modal #saveToAssetLibBtn {
    background: linear-gradient(135deg, var(--mayaa-gold-bright, #ffc34f), #ff9f0a) !important;
    color: #18120a !important;
    box-shadow: 0 8px 22px rgba(255,159,10,.2);
}

.audit-save-modal #closeModalBtn {
    background: var(--mayaa-surface-2, #18181c) !important;
    color: var(--mayaa-muted, #b3b3b8) !important;
    border: 1px solid var(--mayaa-line-strong, rgba(255,255,255,.14)) !important;
}

.audit-save-modal #closeModalBtn:hover {
    border-color: var(--mayaa-gold-line, rgba(255,174,25,.42)) !important;
    color: var(--mayaa-gold-bright, #ffc34f) !important;
}

@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 .chat-message.user .ai-image-user-media-group {
    max-width: min(100%, 360px);
    gap: 8px;
}

#ai-image .chat-message.user .chat-image.ai-image-user-thumb {
    width: 72px;
    height: 72px;
    max-width: 72px;
    max-height: 72px;
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in;
}

/* AI Image 主要布局样式 */
#ai-image.section {
    padding: 0;
    overflow: hidden;
    background: #0b0d13;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

#ai-image.section.active {
    display: flex;
}

#ai-image .video-v2-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px clamp(16px, 3vw, 32px) 20px;
    max-width: 100%;
    margin: 0 0 110px 0;
    width: 100%;
    min-width: 0;
    scroll-behavior: smooth;
    background: #0b0d13 !important;
    transition: margin-bottom 0.3s ease;
}

#ai-image:has(#aiImageComposerBlock:hover) .video-v2-main,
#ai-image:has(#aiImageComposerBlock:focus-within) .video-v2-main,
#ai-image:has(#aiImageComposerBlock.has-text) .video-v2-main {
    margin-bottom: 210px;
}

#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 10px;
    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%, 840px);
    max-width: 840px;
    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%, 1120px);
    max-width: 1120px;
}

/* 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: 300px;
    height: 40px;
    background: transparent;
    padding: 0 10px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: hidden;
    overflow-y: hidden !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: 300px;
    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: auto !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: relative;
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    z-index: 80;
}

#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 {
    flex: 1 1 0;
    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: 0;
    height: 34px;
    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-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#ai-image .ai-image-custom-select {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

#ai-image .ai-image-custom-trigger {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(143, 180, 255, 0.24);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(30, 35, 46, 0.96), rgba(22, 26, 34, 0.96));
    color: #c8d3e6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#ai-image .ai-image-custom-trigger:hover,
#ai-image .ai-image-custom-select.open .ai-image-custom-trigger {
    border-color: rgba(127, 196, 255, 0.72);
    color: #ffffff;
    background: linear-gradient(180deg, rgba(35, 43, 58, 0.98), rgba(24, 30, 42, 0.98));
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#ai-image .ai-image-custom-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#ai-image .ai-image-custom-trigger i {
    flex: 0 0 auto;
    color: #8fb4ff;
    font-size: 11px;
    transition: transform 0.16s ease;
}

#ai-image .ai-image-custom-select.open .ai-image-custom-trigger i {
    transform: rotate(180deg);
}

#ai-image .ai-image-custom-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    width: 100%;
    max-height: 168px;
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(127, 196, 255, 0.34);
    border-radius: 10px;
    background: rgba(18, 22, 31, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transform-origin: bottom center;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 40;
}

#ai-image .ai-image-custom-select.open .ai-image-custom-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 768px) {
    #ai-image .ai-image-custom-menu {
        top: calc(100% + 6px);
        bottom: auto;
        transform: translateY(-6px) scale(0.98);
        transform-origin: top center;
        z-index: 120;
    }

    #ai-image .ai-image-custom-select.open .ai-image-custom-menu {
        transform: translateY(0) scale(1);
    }
}

#ai-image .ai-image-custom-option {
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #d7e3f7;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

#ai-image .ai-image-custom-option:hover,
#ai-image .ai-image-custom-option.active {
    background: rgba(59, 130, 246, 0.18);
    color: #ffffff;
}

/* 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-row .ai-image-free-create-btn {
    width: 88px;
    flex: 0 0 auto;
    height: 28px;
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
    line-height: 28px;
    border-radius: 8px;
}

#ai-image .video-v2-controls-row .ai-image-upload-images-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 88px;
    height: 28px;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 12px;
    line-height: 28px;
    border-radius: 8px;
    color: #8fb4ff;
}

#ai-image .video-v2-controls-row .ai-image-upload-images-btn:hover {
    color: #ffffff;
}

#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 {
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: 1320px;
    margin: 12px auto 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;
}

.video-option-btn.dimmed {
    opacity: 0.35;
    border-color: var(--border-light);
    color: var(--text-secondary);
    background: var(--bg-card);
}

/* 媒体预览样式 */
.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;
}

#ai-image #aiImagePreviewImageWrap.video-v2-image-preview-strip {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
}

#ai-image #aiImageThumbList.video-v2-image-thumb-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: max-content;
    min-width: 0;
}

#ai-image #aiImageThumbList .video-v2-image-thumb {
    position: relative;
    flex: 0 0 auto;
}

#ai-image #aiImageThumbList .video-v2-image-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
}

.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;
}

/* Desktop AI image studio: controls on the left, generated work on the right. */
@media (min-width: 901px) {
    #ai-image.section.active {
        display: grid;
        grid-template-columns: minmax(480px, 1.25fr) minmax(380px, 0.88fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 14px;
        padding: 0 18px 18px;
        background:
            radial-gradient(circle at 18% 18%, rgba(53, 105, 196, 0.12), transparent 32%),
            #0b0d13;
    }

    #ai-image .video-v2-page-note {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    #ai-image .video-v2-bottom-bar {
        grid-column: 2;
        grid-row: 2;
        position: relative;
        inset: auto;
        width: 100%;
        min-width: 0;
        height: 100% !important;
        margin: 22px 0 0 !important;
        padding: 16px 14px !important;
        border: 1px solid rgba(115, 154, 219, 0.18);
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(20, 27, 41, 0.98), rgba(13, 17, 27, 0.98));
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
        align-items: flex-start;
        overflow-y: auto;
        pointer-events: auto;
        align-self: stretch;
    }

    #ai-image .video-v2-bottom-bar::before {
        display: none;
        content: "创作设置";
        position: absolute;
        top: 18px;
        left: 20px;
        color: #f1f5ff;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.02em;
        z-index: 2;
        pointer-events: none;
    }

    #ai-image #aiImageComposerBlock,
    #ai-image #aiImageComposerBlock:hover,
    #ai-image #aiImageComposerBlock:focus-within,
    #ai-image #aiImageComposerBlock.has-text {
        width: 100%;
        max-width: none;
        height: auto;
        align-self: stretch;
        margin: 0 !important;
    }

    #ai-image #aiImageMediaDrop.video-v2-chat-input-container {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        gap: 16px;
        background: #18375f !important;
        border-color: rgba(93, 167, 255, 0.24) !important;
        border-radius: 16px !important;
        box-shadow: none !important;
    }

    #ai-image .ai-image-dropdowns,
    #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;
        margin-top: 2px;
        order: 3;
    }

    #ai-image .video-v2-controls-row,
    #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 {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        opacity: 1;
        transform: none;
        pointer-events: auto;
        max-height: none;
        overflow: visible;
        padding: 12px 4px 2px;
        margin-top: 2px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        flex-wrap: wrap !important;
        order: 1;
    }

    #ai-image .video-v2-input-row,
    #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 {
        order: 4;
        flex: 1 1 150px;
        min-height: 150px;
        align-items: stretch;
        overflow: hidden;
    }

    #ai-image .video-v2-input-row .video-v2-chat-input-wrapper {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #ai-image #aiImageMediaPreviewGroup {
        order: 0;
    }

    #ai-image .ai-image-generation-options {
        order: 2;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
    }

    #ai-image .ai-image-generation-options > label {
        display: grid;
        gap: 7px;
        min-width: 0;
        color: var(--mayaa-muted, #b3b3b8);
        font-size: 12px;
        font-weight: 600;
    }

    #ai-image .ai-image-type-options {
        display: grid;
        gap: 7px;
        min-width: 0;
        color: var(--mayaa-muted, #b3b3b8);
        font-size: 12px;
        font-weight: 600;
    }

    #ai-image .ai-image-type-buttons {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    #ai-image .ai-image-type-buttons .video-option-btn {
        width: 100%;
        min-width: 0;
        height: 34px;
        padding-inline: 6px;
        white-space: nowrap;
        line-height: 1;
    }

    #ai-image .ai-image-generation-options .ai-image-custom-select {
        width: 100%;
    }

    #ai-image .video-v2-controls-row .ai-image-upload-images-btn {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        height: 190px;
        border: 1px dashed rgba(66, 168, 255, 0.65);
        border-radius: 12px;
        background: rgba(21, 67, 111, 0.68);
        color: #56b1ff;
        font-size: 14px;
        flex-direction: column;
        gap: 10px;
    }

    #ai-image .video-v2-controls-row .ai-image-upload-images-btn i {
        font-size: 27px;
    }

    #ai-image .video-v2-controls-row .ai-image-type-label {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 6px;
        padding-top: 2px;
        color: var(--mayaa-muted, #b3b3b8);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
    }

    #ai-image .video-v2-controls-row .video-option-btn:not(.ai-image-upload-images-btn) {
        grid-row: 3;
        width: 100%;
        min-width: 0;
        height: 34px;
        padding-inline: 6px;
        white-space: nowrap;
        line-height: 1;
        color: #dcecff;
        border-color: rgba(95, 160, 232, 0.34);
        background: rgba(13, 42, 75, 0.66);
    }

    #ai-image .video-v2-send-btn,
    #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 {
        opacity: 1;
        pointer-events: auto;
        top: auto;
        bottom: 8px;
        transform: none;
    }

    #ai-image #aiImagePromptInput.video-v2-chat-input,
    #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: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        padding: 12px 48px 12px 10px !important;
        line-height: 1.65 !important;
        color: var(--text-primary) !important;
    }

    #ai-image .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:hover) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:focus-within) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock.has-text) .video-v2-main {
        grid-column: 1;
        grid-row: 2;
        position: relative;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        margin: 0 !important;
        padding: 66px 20px 22px;
        border: 1px solid rgba(115, 154, 219, 0.18);
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(17, 23, 36, 0.98), rgba(11, 14, 23, 0.98)) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
        box-sizing: border-box;
        overflow-y: auto;
    }

    #ai-image .video-v2-main::before {
        content: none;
    }

    #ai-image .ai-image-result-toolbar {
        position: absolute;
        top: 16px;
        left: 20px;
        right: 20px;
        display: flex;
        align-items: center;
        gap: 8px;
        z-index: 3;
    }

    #ai-image .ai-image-toolbar-btn {
        height: 32px;
        padding: 0 13px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 7px;
        background: rgba(13, 30, 53, 0.76);
        color: #dce9fb;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: transform .16s ease, background .16s ease;
    }

    #ai-image .ai-image-toolbar-btn.primary {
        border-color: #3f8cff;
        background: #3f8cff;
        color: #fff;
    }

    #ai-image .ai-image-toolbar-btn:hover {
        transform: translateY(-1px);
        background: #2d69b5;
    }

    #ai-image .ai-image-toolbar-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
    }

    #ai-image #aiImageMessages.chat-messages:empty::before {
        content: "生成的图片会显示在这里";
        display: grid;
        place-items: center;
        width: 100%;
        min-height: 100%;
        flex: 1 1 auto;
        box-sizing: border-box;
        border: 1px dashed rgba(111, 158, 232, 0.34);
        border-radius: 14px;
        color: #6f7d96;
        font-size: 14px;
        background:
            radial-gradient(circle at center, rgba(53, 105, 196, 0.18), transparent 42%),
            #102b4b;
    }

    #ai-image #aiImageMessages.chat-messages:not(:empty) {
        display: grid;
        grid-template-columns: repeat(5, 110px);
        grid-auto-rows: max-content;
        align-items: start;
        align-content: start;
        justify-content: start;
        column-gap: 8px;
        row-gap: 12px;
    }

    #ai-image #aiImageMessages .chat-message.assistant {
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
    }

    #ai-image #aiImageMessages .chat-message.user {
        grid-column: 1 / -1;
        display: none;
    }

    #ai-image .ai-image-task-card-message {
        width: 110px;
        height: 100px;
        aspect-ratio: auto;
    }

    #ai-image .ai-image-task-card {
        width: 100%;
        height: 100%;
        min-height: 130px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: 1px solid rgba(85, 158, 239, .34);
        border-radius: 10px;
        background: #102844;
        box-shadow: 0 10px 24px rgba(3, 12, 26, .2);
    }

    #ai-image .ai-image-task-progress {
        width: 100%;
        height: 5px;
        flex: 0 0 5px;
        overflow: hidden;
        background: rgba(255, 255, 255, .09);
    }

    #ai-image .ai-image-task-progress span {
        display: block;
        height: 100%;
        border-radius: 0 5px 5px 0;
        background: linear-gradient(90deg, #338cff, #6db9ff);
        transition: width .45s ease;
    }

    #ai-image .ai-image-task-preview {
        position: relative;
        flex: 1;
        min-height: 0;
        display: grid;
        place-items: center;
        overflow: hidden;
        color: #6caef2;
        font-size: 28px;
    }

    #ai-image .ai-image-task-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: .22;
        filter: saturate(.6);
    }

    #ai-image .ai-image-task-spinner {
        position: absolute;
        width: 28px;
        height: 28px;
        border: 3px solid rgba(112, 183, 255, .25);
        border-top-color: #63b5ff;
        border-radius: 50%;
        animation: aiImageTaskSpin .9s linear infinite;
    }

    #ai-image .ai-image-task-status {
        padding: 8px 9px 3px;
        color: #d8eaff;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #ai-image .ai-image-task-prompt {
        padding: 2px 9px 9px;
        color: #7790ad;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #ai-image .ai-image-task-card-message.failed .ai-image-task-progress span {
        background: #e34a5f;
    }

    #ai-image .ai-image-task-card-message.failed .ai-image-task-spinner {
        display: none;
    }

    #ai-image .ai-image-task-card-message.failed .ai-image-task-status {
        color: #ff9aaa;
    }

    #ai-image .chat-message.assistant .chat-message-content,
    #ai-image .ai-image-result-wrap,
    #ai-image .ai-image-result-media {
        width: 100%;
    }

    #ai-image .ai-image-item-wrap {
        width: 100%;
    }

    #ai-image .chat-image {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        max-height: none;
        object-fit: cover;
        margin: 0 auto;
        border-radius: 10px;
        background: #102844;
    }

    #ai-image .ai-image-action-row {
        display: none;
    }

    #ai-image .video-v2-bottom-bar {
        background: linear-gradient(180deg, #173961, #102b4b);
    }

    #ai-image .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:hover) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:focus-within) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock.has-text) .video-v2-main {
        background: linear-gradient(180deg, #173961, #102b4b) !important;
    }
}

@keyframes aiImageTaskSpin {
    to { transform: rotate(360deg); }
}

/* Match the project's premium black-and-gold visual system. */
@media (min-width: 901px) {
    #ai-image.section.active {
        background:
            radial-gradient(circle at 18% 16%, rgba(255, 174, 25, .055), transparent 30%),
            var(--mayaa-bg, #08080a);
    }

    #ai-image .video-v2-bottom-bar,
    #ai-image .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:hover) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock:focus-within) .video-v2-main,
    #ai-image:has(#aiImageComposerBlock.has-text) .video-v2-main {
        border-color: var(--mayaa-line, rgba(255, 255, 255, .09));
        background: linear-gradient(180deg, var(--mayaa-surface, #111114), #0b0b0e) !important;
        box-shadow: var(--mayaa-shadow, 0 18px 44px rgba(0, 0, 0, .4));
    }

    #ai-image #aiImageMediaDrop.video-v2-chat-input-container {
        background: var(--mayaa-surface-2, #151519) !important;
        border-color: var(--mayaa-line-strong, rgba(255, 255, 255, .14)) !important;
    }

    #ai-image .video-v2-controls-row .ai-image-upload-images-btn {
        border-color: var(--mayaa-gold-line, rgba(255, 174, 25, .48));
        background: rgba(255, 174, 25, .045);
        color: var(--mayaa-gold-bright, #ffc34f);
    }

    #ai-image .video-v2-controls-row .video-option-btn:not(.ai-image-upload-images-btn),
    #ai-image .ai-image-type-buttons .video-option-btn,
    #ai-image .ai-image-custom-trigger {
        border-color: var(--mayaa-line-strong, rgba(255, 255, 255, .14));
        background: var(--mayaa-surface, #111114);
        color: var(--mayaa-text, #f5f5f6);
    }

    #ai-image .video-v2-controls-row .video-option-btn.active,
    #ai-image .ai-image-type-buttons .video-option-btn.active,
    #ai-image .ai-image-custom-trigger:hover,
    #ai-image .ai-image-custom-select.open .ai-image-custom-trigger {
        border-color: var(--mayaa-gold-line, rgba(255, 174, 25, .48));
        background: rgba(255, 174, 25, .08);
        color: var(--mayaa-gold-bright, #ffc34f);
    }

    #ai-image .ai-image-toolbar-btn {
        border-color: var(--mayaa-line, rgba(255, 255, 255, .09));
        background: var(--mayaa-surface-2, #151519);
        color: var(--mayaa-muted, #b3b3b8);
    }

    #ai-image .ai-image-toolbar-btn.primary,
    #ai-image .ai-image-toolbar-btn:hover {
        border-color: var(--mayaa-gold, #ffae19);
        background: linear-gradient(135deg, var(--mayaa-gold-bright, #ffc34f), #ff9f0a);
        color: #18120a;
    }

    #ai-image #aiImageMessages.chat-messages:empty::before {
        border-color: var(--mayaa-line-strong, rgba(255, 255, 255, .14));
        color: var(--mayaa-dim, #73737a);
        background:
            radial-gradient(circle at center, rgba(255, 174, 25, .045), transparent 44%),
            var(--mayaa-surface, #111114);
    }

    #ai-image .ai-image-task-card {
        border-color: var(--mayaa-line-strong, rgba(255, 255, 255, .14));
        background: var(--mayaa-surface-2, #151519);
    }

    #ai-image .ai-image-task-progress span {
        background: linear-gradient(90deg, var(--mayaa-gold, #ffae19), var(--mayaa-gold-bright, #ffc34f));
    }

    #ai-image .ai-image-task-preview {
        color: var(--mayaa-gold, #ffae19);
    }

    #ai-image .ai-image-task-spinner {
        border-color: rgba(255, 174, 25, .2);
        border-top-color: var(--mayaa-gold-bright, #ffc34f);
    }

    #ai-image .ai-image-task-status {
        color: var(--mayaa-text, #f5f5f6);
    }

    #ai-image .ai-image-task-prompt {
        color: var(--mayaa-dim, #73737a);
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    #ai-image #aiImageMessages.chat-messages:not(:empty) {
        grid-template-columns: repeat(5, 110px);
    }
}

@media (max-width: 900px) {
    #ai-image .video-v2-main {
        margin-bottom: 170px;
    }
}

/* 聊天消息内容样式 */
.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;
}
