/* ============================ 输入区 composer ============================ */
.chat-input-area {
    padding: 8px 20px 18px;
    background: transparent;
}
.chat-input-area > * {
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
}
/* 图片附件预览 — 内嵌在输入框顶部的小缩略图 */
#imagePreviewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 2px 8px;
}
.image-preview-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--color-surface-hover);
    animation: thumb-in var(--duration-fast) var(--ease);
}
#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.image-remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease),
        background var(--duration-fast) var(--ease);
}
.image-remove-btn i { width: 12px; height: 12px; }
.image-preview-thumb:hover .image-remove-btn,
.image-remove-btn:focus-visible { opacity: 1; }
.image-remove-btn:hover { background: rgba(0, 0, 0, 0.78); }
/* 触屏无 hover,删除按钮常显 */
@media (hover: none) {
    .image-remove-btn { opacity: 1; }
}
@keyframes thumb-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    padding: 8px 8px 8px 10px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--duration-fast) var(--ease),
        box-shadow var(--duration-fast) var(--ease);
}
.chat-input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: 0.97rem;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    min-height: 24px;
    max-height: 180px;
    /* 默认不显示滚动条;autoResizeInput() 仅在内容超过 max-height 时切到 auto */
    overflow-y: hidden;
    outline: none;
    color: var(--color-text);
}
.chat-input::placeholder { color: var(--color-text-tertiary); }
/* 工具按钮（上传图片）— 幽灵风格 */
.composer-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--duration-fast) var(--ease),
        color var(--duration-fast) var(--ease);
}
.composer-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}
/* 发送按钮 — 主色圆形 */
.send-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-primary-text);
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--duration-fast) var(--ease),
        opacity var(--duration-fast) var(--ease),
        transform var(--duration-fast) var(--ease);
}
.send-btn:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}
.send-btn:disabled {
    background: var(--color-border-strong);
    color: var(--color-text-tertiary);
    cursor: not-allowed;
}
/* B1 停止生成:流式期间发送按钮切换为深色"停止"态,与紫色发送态明显区分 */
.send-btn.is-stop {
    background: var(--color-text);
    color: var(--color-bg);
}
.send-btn.is-stop:hover:not(:disabled) {
    background: var(--color-text);
    opacity: 0.85;
}
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 空状态 ============================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 50vh;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 0 20px;
}
.empty-state i,
.empty-state .lucide {
    font-size: 2.6rem;
    color: var(--color-primary);
    margin-bottom: 18px;
    opacity: 0.9;
}
.empty-state h4 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text);
}
.empty-state p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    max-width: 460px;
}

.system-info {
    padding: 6px 20px;
    background: transparent;
    font-size: 0.74rem;
    color: var(--color-text-tertiary);
    display: flex;
    justify-content: center;
}

