/**
 * 工作流参数配置系统样式
 * 
 * @author Wukong Team
 * @version 1.0.0
 */

/* ============================================
   📋 参数配置面板
   ============================================ */

.workflow-params-config-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.params-config-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.params-config-header h2 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.params-config-subtitle {
    margin: 4px 0 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 工具栏 - 紧凑 */
.params-config-toolbar {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.params-config-toolbar button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-smart-recommend {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-smart-recommend:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-select-all,
.btn-deselect-all {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-select-all:hover,
.btn-deselect-all:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-save-config {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
    font-weight: 600;
    margin-left: auto;
}

.btn-save-config:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 171, 47, 0.4);
}

.btn-close-config {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6464;
}

.btn-close-config:hover {
    background: rgba(255, 100, 100, 0.3);
}

/* 统计信息 - 紧凑 */
.params-config-stats {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.params-config-stats strong {
    color: #667eea;
    font-weight: 600;
}

/* 内容区域 - 紧凑 */
.params-config-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* 节点区块 - 紧凑设计 */
.params-node-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.params-node-header {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.params-node-header .node-icon {
    font-size: 16px;
}

.params-node-header .node-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.params-node-header .node-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
}

.params-node-header .node-id {
    font-size: 11px;
    color: rgba(102, 126, 234, 0.7);
    margin-left: auto;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* 参数列表 - 紧凑布局 */
.params-list {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.param-item {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: start;
    gap: 8px;
    padding: 6px 8px;
    background: transparent;
    border-radius: 4px;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.param-item:last-child {
    border-bottom: none;
}

.param-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.param-checkbox {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.param-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.param-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
}

.param-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.param-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.param-key {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.param-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.param-value {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.param-type {
    font-size: 12px;
    opacity: 0.7;
}

.param-control {
    color: rgba(102, 126, 234, 0.8);
    background: rgba(102, 126, 234, 0.12);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.param-actions {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding-top: 2px;
}

.param-actions button {
    background: transparent;
    border: none;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.5;
    font-size: 11px;
    line-height: 1;
}

.param-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

/* ============================================
   🎮 运行时参数面板
   ============================================ */

.workflow-params-runtime-panel {
    background: rgba(30, 30, 30, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.runtime-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.runtime-panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.btn-toggle-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-toggle-panel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.runtime-panel-content {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.runtime-panel-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

/* 参数控件 */
.runtime-param-control {
    margin-bottom: 20px;
}

.control-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

/* 滑块控件 */
.slider-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.slider-value {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* 文本域控件 */
.runtime-param-control textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.runtime-param-control textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 下拉框控件 */
.runtime-param-control select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff !important;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

.runtime-param-control select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background-color: rgba(30, 30, 30, 0.95) !important;
}

/* 下拉框选项样式 */
.runtime-param-control select option {
    background: rgba(30, 30, 30, 0.98) !important;
    color: #fff !important;
    padding: 10px 12px;
}

.runtime-param-control select option:hover {
    background: rgba(102, 126, 234, 0.3) !important;
}

.runtime-param-control select option:checked {
    background: rgba(102, 126, 234, 0.5) !important;
    color: #fff !important;
}

/* 输入框控件 */
.runtime-param-control input[type="text"],
.runtime-param-control input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.runtime-param-control input[type="text"]:focus,
.runtime-param-control input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 开关控件 */
.switch-control {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch-control input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.4s;
    border-radius: 26px;
}

.switch-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input[type="checkbox"]:checked + .switch-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input[type="checkbox"]:checked + .switch-label:before {
    transform: translateX(24px);
}

/* ============================================
   📱 响应式设计
   ============================================ */

@media (max-width: 768px) {
    .workflow-params-config-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .params-config-toolbar {
        flex-direction: column;
    }
    
    .params-config-toolbar button {
        width: 100%;
    }
    
    .btn-save-config {
        margin-left: 0;
    }
}

/* ============================================
   🎨 滚动条样式
   ============================================ */

.params-config-content::-webkit-scrollbar,
.runtime-panel-content::-webkit-scrollbar {
    width: 8px;
}

.params-config-content::-webkit-scrollbar-track,
.runtime-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.params-config-content::-webkit-scrollbar-thumb,
.runtime-panel-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.params-config-content::-webkit-scrollbar-thumb:hover,
.runtime-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* ============================================
   ✨ 动画效果
   ============================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.workflow-params-config-panel {
    animation: slideInDown 0.3s ease-out;
}

/* ============================================
   🌙 深色模式优化
   ============================================ */

@media (prefers-color-scheme: dark) {
    .workflow-params-config-panel {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    }
}

/* ============================================
   ⚙️ 参数编辑对话框
   ============================================ */

.param-edit-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.param-edit-dialog-content {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 0.98) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.param-edit-header {
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.param-edit-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.btn-close-dialog {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close-dialog:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.param-edit-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.edit-field {
    margin-bottom: 16px;
}

.edit-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.edit-field input[type="text"],
.edit-field input[type="number"],
.edit-field select,
.edit-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edit-field input[type="text"]:focus,
.edit-field input[type="number"]:focus,
.edit-field select:focus,
.edit-field textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.edit-field textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

.param-info-display {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 12px;
}

.param-info-display span {
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
}

.param-edit-footer {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.param-edit-footer button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-edit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

.btn-save-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-cancel-edit {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-cancel-edit:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
    .param-edit-dialog-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .param-edit-body {
        padding: 16px;
    }
}

