/* keai-image-test.css — 可爱云生图测试，风格对齐 #ai-image */

/* ── 主滚动区 ── */
#keai-image-test .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;
}

/* ── 消息列表 ── */
#keai-image-test #kitMessages.chat-messages {
    margin: 0;
    padding: 0 0 120px;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    width: auto;
}

/* ── 固定底部栏 ── */
#keai-image-test .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 #keai-image-test .video-v2-bottom-bar { left: 56px; }
body.sidebar-collapsed  #keai-image-test .video-v2-bottom-bar { left: 64px; }

/* ── Composer block ── */
#keai-image-test #kitComposerBlock {
    position: relative;
    width: min(100%, 640px);
    max-width: 640px;
    min-width: 0;
    margin: 0 auto;
    pointer-events: auto;
    transition: 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);
}

#keai-image-test #kitComposerBlock:hover,
#keai-image-test #kitComposerBlock:focus-within,
#keai-image-test #kitComposerBlock.has-text {
    width: min(100%, 860px);
    max-width: 860px;
}

/* ── 输入容器 ── */
#keai-image-test #kitInputDrop.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;
}

/* ── 输入行 ── */
#keai-image-test .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);
}

#keai-image-test #kitComposerBlock:hover .video-v2-input-row,
#keai-image-test #kitComposerBlock:focus-within .video-v2-input-row,
#keai-image-test #kitComposerBlock.has-text .video-v2-input-row {
    align-items: flex-end;
}

/* ── Textarea ── */
#keai-image-test #kitPromptInput.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), color 0.3s ease;
}

#keai-image-test #kitComposerBlock:hover #kitPromptInput.video-v2-chat-input,
#keai-image-test #kitComposerBlock:focus-within #kitPromptInput.video-v2-chat-input,
#keai-image-test #kitComposerBlock.has-text #kitPromptInput.video-v2-chat-input {
    min-height: 72px;
    max-height: 160px;
    padding: 10px 46px 10px 10px !important;
    line-height: 1.65 !important;
    color: var(--text-primary) !important;
    overflow-y: scroll !important;
}

/* ── 模型下拉 ── */
#keai-image-test .kit-model-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: 5px 26px 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 160px;
    flex-shrink: 0;
    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;
}

#keai-image-test .kit-model-select:hover { border-color: rgba(255,255,255,0.25); color: #fff; }
#keai-image-test .kit-model-select:focus { border-color: #4968b8; color: #fff; }
#keai-image-test .kit-model-select option { background: #1e2128; color: #e2e8f0; }

/* 下拉框默认隐藏，hover/focus-within/has-text 时显示 */
#keai-image-test .kit-model-row {
    display: none;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 2px;
}

#keai-image-test #kitComposerBlock:hover .kit-model-row,
#keai-image-test #kitComposerBlock:focus-within .kit-model-row,
#keai-image-test #kitComposerBlock.has-text .kit-model-row {
    display: flex;
}

#keai-image-test .kit-model-label {
    font-size: 11px;
    color: rgba(148, 163, 184, 0.5);
    white-space: nowrap;
}

/* ── 发送按钮 ── */
#keai-image-test .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;
    transition: transform 0.16s ease, background 0.3s ease, opacity 0.16s ease, width 0.22s ease, height 0.22s ease, font-size 0.22s ease;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

#keai-image-test #kitComposerBlock:hover .video-v2-send-btn,
#keai-image-test #kitComposerBlock:focus-within .video-v2-send-btn,
#keai-image-test #kitComposerBlock.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);
}

#keai-image-test .video-v2-send-btn:hover { filter: brightness(1.08); }
#keai-image-test .video-v2-send-btn:active { transform: translateY(1px); }
#keai-image-test .video-v2-send-btn:disabled { opacity: 0.4 !important; pointer-events: none; }

/* ── 生成的图片 ── */
#keai-image-test .kit-gen-image {
    display: block;
    width: min(100%, 360px);
    max-width: 360px;
    border-radius: 12px;
    object-fit: contain;
}

#keai-image-test .kit-img-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#keai-image-test .kit-img-dl-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #9ea9bf;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s, color 0.2s;
}

#keai-image-test .kit-img-dl-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── 模型标签 ── */
#keai-image-test .kit-model-badge {
    font-size: 11px;
    color: rgba(148, 163, 184, 0.55);
    margin-bottom: 6px;
}

/* ── Admin Guard ── */
#keai-image-test .kit-guard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 12px;
    color: var(--text-muted, rgba(148,163,184,0.5));
    font-size: 13px;
}
