/* AI功能配置组件样式 - 模态窗口版本 */

/* 按钮样式 */
.config-toggle-btn {
    padding: 10px 20px;
    background: #6366f1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.config-toggle-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.config-toggle-btn:active {
    transform: translateY(0);
}

.toggle-icon {
    font-size: 14px;
}

/* 模态窗口遮罩 */
.config-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 模态窗口主体 */
.config-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    min-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态窗口头部 */
.config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.config-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.config-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.config-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 模态窗口主体内容 */
.config-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 配置区块 */
.config-section {
    margin-bottom: 20px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

.label-icon {
    font-size: 18px;
}

.btn-reset {
    margin-left: auto;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
}

.btn-reset:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* 模型选择器 */
.model-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
}

.model-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.model-option input[type="radio"] {
    margin: 0 10px 0 0;
    cursor: pointer;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.model-option:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}

.model-option input[type="radio"]:checked + .model-name {
    color: #4f46e5;
    font-weight: 600;
}

.model-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    word-break: keep-all;
    overflow-wrap: normal;
}

.model-badge {
    padding: 3px 10px;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 8px;
    flex-shrink: 0;
}

/* RAG开关 */
.rag-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
}

.rag-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.rag-toggle:hover {
    background: #f9fafb;
}

/* 提示词编辑器 */
.prompt-editor {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    background: #fff;
    color: #111827;
    transition: all 0.2s;
}

.prompt-editor:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-view-final {
    padding: 8px 16px;
    background: #fff;
    color: #6366f1;
    border: 1px solid #6366f1;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-view-final:hover {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #4f46e5;
}

.btn-view-final:active {
    transform: scale(0.98);
}

/* 模态窗口底部 */
.config-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary {
    padding: 10px 24px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 提示词模板选择器 */
.prompt-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-option {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.prompt-option input[type="radio"] {
    margin: 0 10px 0 0;
    cursor: pointer;
}

.prompt-option:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}

.prompt-option input[type="radio"]:checked + .prompt-name {
    color: #4f46e5;
    font-weight: 600;
}

.prompt-name {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

/* 响应式 */
@media (max-width: 768px) {
    .config-modal-content {
        width: 95%;
        min-width: 320px;
        max-height: 90vh;
    }

    .config-modal-header {
        padding: 16px 20px;
    }

    .config-modal-header h3 {
        font-size: 16px;
    }

    .config-modal-body {
        padding: 20px;
    }

    .config-modal-footer {
        padding: 12px 20px;
    }

    .model-option,
    .rag-toggle,
    .prompt-option {
        padding: 10px 12px;
    }

    .prompt-editor {
        font-size: 12px;
    }
}
