/* ========================================
   表单和控件样式
   ======================================== */

/* === 表单元素 === */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 15px 0;
    overflow: visible;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #a8b2d1;
    font-weight: 500;
}

input[type="text"],
textarea,
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

select {
    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='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    background-color: rgba(0, 0, 0, 0.5);
}

select option {
    background: #1a1625;
    color: #e0e6ed;
    padding: 10px;
}

input[type="text"]:focus,
textarea:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

input::placeholder,
textarea::placeholder {
    color: #4a5568;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* === 日期输入美化 === */
.date-label-icon {
    font-size: 1.1rem;
    margin-right: 6px;
    vertical-align: middle;
}

input[type="date"].date-input {
    padding: 10px 14px;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #e0e6ed;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    font-weight: 400;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.8) brightness(1.2);
    cursor: pointer;
    width: 18px;
    height: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

input[type="date"].date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.15);
    transform-origin: left center;
    z-index: 100;
    position: relative;
}

/* === 优化目标系数控件 === */
.info-text-small {
    font-size: 0.85rem;
    color: #8892b0;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.coefficient-controls-row {
    display: flex;
    gap: 25px;
    margin-top: 10px;
    align-items: flex-end;
}

.coefficient-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.coefficient-item label {
    font-size: 0.85rem;
    margin-bottom: 0;
    color: #a8b2d1;
}

.coefficient-input {
    width: 100%;
    min-width: 120px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 0.95rem;
}

.coefficient-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

input[type="date"].date-input:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

/* === 风格因子控制器 === */
.style-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.factor-control-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(15, 12, 41, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.factor-control-compact:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(15, 12, 41, 0.6);
}

.factor-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.factor-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.factor-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
    min-width: 60px;
}

/* === 双滑块样式 === */
.dual-slider-compact {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 320px;
    width: 100%;
}

.dual-slider-compact .range-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.dual-slider-compact .range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #e0e6ed;
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.dual-slider-compact .range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #e0e6ed;
    pointer-events: all;
    position: relative;
    z-index: 2;
}

.dual-slider-compact .range-slider-min::-webkit-slider-thumb {
    background: linear-gradient(135deg, #FF6B6B 0%, #E74C3C 100%);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.dual-slider-compact .range-slider-max::-webkit-slider-thumb {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

.dual-slider-compact .range-slider-min::-moz-range-thumb {
    background: linear-gradient(135deg, #FF6B6B 0%, #E74C3C 100%);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.dual-slider-compact .range-slider-max::-moz-range-thumb {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

.dual-slider-compact .range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dual-slider-compact::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right, 
        rgba(231, 76, 60, 0.3) 0%, 
        rgba(102, 126, 234, 0.3) 50%, 
        rgba(46, 204, 113, 0.3) 100%);
    border-radius: 4px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 0;
}

/* === 单滑块样式 === */
.single-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        rgba(102, 126, 234, 0.3) 0%, 
        rgba(118, 75, 162, 0.3) 100%);
    outline: none;
    border: 1px solid rgba(102, 126, 234, 0.3);
    cursor: pointer;
}

.single-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 2px solid #e0e6ed;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
    transition: all 0.2s ease;
}

.single-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.9);
}

.single-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 2px solid #e0e6ed;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
}

/* === 滑块和文本框联动组 === */
.slider-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.slider-input-group .single-slider {
    flex: 1;
    min-width: 200px;
}

.slider-value-input {
    width: 100px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.slider-value-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
    background: rgba(0, 0, 0, 0.6);
}

.input-suffix {
    color: #a8b2d1;
    font-size: 1rem;
    font-weight: 600;
    margin-left: -10px;
}

/* === 因子输入框 === */
.factor-range-input {
    width: 50px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    color: #e0e6ed;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.factor-range-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

/* === 因子统计信息 === */
.factor-stats-inline {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: #8892b0;
    white-space: nowrap;
    min-width: 140px;
}

.factor-stats-inline span {
    white-space: nowrap;
}

.factor-stats-inline strong {
    color: #e0e6ed;
    margin-left: 3px;
}

/* === 因子数据期间说明 === */
.factor-data-period {
    padding: 12px 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #e0e6ed;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-icon {
    font-size: 1.2rem;
}

.factor-data-period strong {
    color: #667eea;
    font-weight: 600;
}

/* === 响应式 === */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .factor-control-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .dual-slider-compact {
        width: 100%;
        min-width: 0;
        height: 28px;
    }
    
    .factor-range-input {
        width: 50px;
    }
    
    .factor-stats-inline {
        flex-direction: row;
        gap: 15px;
    }
    
    .slider-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .slider-input-group .single-slider {
        min-width: auto;
        width: 100%;
    }
    
    .slider-value-input {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .slider-value-input {
        width: 100px;
    }
    .dual-slider-compact {
        height: 32px;
    }
    .factor-range-input {
        width: 50px;
    }
}

