/* DS随心转 AI聊天页面 - 输入区域样式 */

/* 输入区域通用样式 */
.chat-input-container {
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.02);
    padding: 6px;
    background: #ffffff;
}

.chat-input-container:focus-within {
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08), 0 4px 8px rgba(37, 99, 235, 0.04);
    transform: translateY(-2px);
}

/* 输入框包装器通用样式 */
.input-wrapper {
    background: white;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border: 2px solid transparent;
}

/* 文件拖拽悬停状态 */
.input-wrapper.dragging {
    border-color: #3b82f6;
    border-style: dashed;
    background-color: rgba(59, 130, 246, 0.05);
}

/* 输入操作区域通用样式 */
.input-actions {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 0;
    gap: 12px;
}

.message-input-wrap {
    position: relative;
    width: 100%;
}

/* 输入选项区域通用样式 */
.input-options {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.input-options .deep-thinking-btn {
    margin-right: 0;
}

.input-options .upload-btn,
.input-options .send-btn {
    margin-left: 8px;
}

.input-options .model-select { order: 1; }
.input-options .deep-thinking-btn { order: 2; }
.input-options .prompt-entry-btn { order: 3; margin-left: 8px; margin-right: auto; }
.input-options .upload-btn { order: 4; }
.input-options .send-btn { order: 5; }

/* === 位置相关的特定样式 === */

/* 初始状态：输入框在欢迎内容中 */
.chat-welcome .chat-input-container {
    position: relative;
    width: 100%;
    transform: none;
}

/* 遮罩层：防止消息穿透输入框 */
.chat-input-backdrop {
    position: sticky;
    bottom: 0;
    background: transparent;
    z-index: 10;
    padding: 10px;
    pointer-events: none;
    margin-top: auto;
}

/* 对话状态：输入框在底部 */
.chat-input-container.bottom-fixed {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: white;
    z-index: 100;
    border-radius: 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.chat-input-container.bottom-fixed .input-wrapper {
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.chat-input-container.bottom-fixed .input-wrapper:focus-within {
    box-shadow: none;
}

.chat-input-container.bottom-fixed .input-actions {
    padding: 10px 16px;
}

.chat-input-container.bottom-fixed .input-options {
    padding: 0 10px;
}

.message-input {
    width: 100%;
    display: block;
    box-sizing: border-box;
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    background: transparent;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    min-height: calc(1.5em * 3);
    max-height: calc(1.5em * 10);
    overflow-y: hidden;
    padding-right: 34px;
    transition: height 0.15s ease;
}

.message-input::placeholder {
    color: #999;
}

.input-expand-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-expand-btn:hover {
    background: #F3F4F6;
    color: #2563EB;
}

.input-expand-btn .layui-icon {
    font-size: 16px;
}

.send-btn {
    width: 33px;
    height: 33px;
    border: 1px solid #1D4ED8;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.32);
}

.send-btn:disabled {
    background: #D1D5DB;
    border-color: #D1D5DB;
    color: #F9FAFB;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn .iconfont {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 流式响应时的发送按钮 (Stop btn) */
.send-btn.streaming {
    position: relative;
}

.send-btn.streaming .iconfont {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 2px;
    margin: 0;
}

.send-btn.streaming .iconfont::before {
    display: none;
}

/* 文件上传按钮 */
.upload-btn {
    width: 30px;
    height: 33px;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 8px;
    position: relative;
    color: #4b5563;
    /* Default dark mode friendly */
}

.upload-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(208, 212, 209, 0.4);
    color: #667eea;
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.upload-btn .layui-icon {
    font-size: 18px;
}

/* 上传按钮等待动画 */
.upload-btn.uploading {
    animation: uploadPulse 1.5s ease-in-out infinite;
}

.upload-btn.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: uploadLoading 1.5s linear infinite;
}

@keyframes uploadPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes uploadLoading {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 已上传文件显示区域 */
.uploaded-files {
    position: relative;
    z-index: 10;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.uploaded-file {
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #28a745;
    animation: fadeIn 0.3s ease;
    cursor: pointer;
    position: relative;
}

.uploaded-file .remove-file {
    margin: 0;
    padding: 0;
    position: absolute;
    top: -6px;
    right: -6px;
    display: none;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.uploaded-file:hover .remove-file {
    display: flex;
}

.uploaded-file svg {
    width: 26px;
    height: 26px;
}

.uploaded-file .file-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 深度思考按钮 */
.deep-thinking-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.deep-thinking-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.deep-thinking-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.deep-thinking-btn .layui-icon {
    font-size: 16px;
}

.deep-thinking-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

/* 模型选择框 */
.model-select {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 100px;
    height: 32px;
}

.model-select:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.model-select:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.input-options .model-select {
    margin-right: 8px;
}

/* 头部快捷功能区 */
.header-quick-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5da;
    color: #1a73e8;
}

.quick-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.quick-action-btn i {
    font-size: 16px;
}

/* Dark Mode Support for Input Area */
@media (prefers-color-scheme: dark) {
    .message-input {
        color: #0d0e0e;
        background: transparent;
    }

    .message-input::placeholder {
        color: #b0b3b8;
    }

    .chat-input-backdrop {
        background-color: transparent;
    }
}

.input-tips {
    color: #999;
}
