* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 顶部导航栏 */
/*.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.navbar .nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.navbar .nav-links a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.navbar .nav-links a:hover {
    background: #3498db;
    color: white;
}

.navbar .nav-links a.active {
    background: #3498db;
    color: white;
}*/

.main_container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-container {
    padding: 30px;
}

.form-section {
    margin-bottom: 40px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 25px;
    background: #fafafa;
}

.section-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
}

/* 多选框样式 */
.multi-select {
    position: relative;
    width: 100%;
}

.multi-select-header {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    transition: border-color 0.3s;
}

.multi-select-header:hover {
    border-color: #3498db;
}

.multi-select.active .multi-select-header {
    border-color: #3498db;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3498db;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.multi-select.active .multi-select-dropdown {
    display: block;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.checkbox-item:hover {
    background: #f0f8ff;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
}

/* 条件配置样式 */
.conditions-section {
    background: white;
    border: 2px solid #e3f2fd;
    border-radius: 15px;
    padding: 20px;
}

.condition-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.condition-content {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 40px;
    gap: 15px;
    align-items: center;
}

.condition-factor {
    font-weight: 600;
    color: #2c3e50;
}

.factor-unit {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.operator-select, .value-input {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.operator-select:focus, .value-input:focus {
    outline: none;
    border-color: #3498db;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

.add-condition-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-condition-btn:hover {
    background: #2980b9;
}

.submit-section {
    text-align: center;
    padding: 30px;
}

.submit-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 因子选择模态框样式 - 重新设计 */
.factor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.factor-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.factor-sidebar {
    width: 200px;
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
    overflow-y: auto;
    flex-shrink: 0;
}

.category-item {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s;
}

.category-item:hover {
    background: #e9ecef;
}

.category-item.active {
    background: #3498db;
    color: white;
}

.factor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.factor-subcategory-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    flex-shrink: 0;
}

.subcategory-tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.subcategory-tab:hover {
    background: #e9ecef;
}

.subcategory-tab.active {
    background: white;
    border-bottom-color: #3498db;
}

.factor-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.factor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.factor-item {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    background: white;
    font-size: 14px;
}

.factor-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.factor-item.selected {
    border-color: #27ae60;
    background: #e8f5e8;
}

/* 自定义输入区域 */
.custom-input-section {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #e9ecef;
    padding: 15px 20px;
    display: none;
}

.custom-input-section.show {
    display: block;
}

.custom-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
}

.custom-confirm-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.custom-cancel-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* 时间区间选择 */
.time-period-section {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 20px;
    display: none;
}

.time-period-section.show {
    display: block;
}

.time-period-section label {
    font-weight: 600;
    color: #1976d2;
    margin-right: 10px;
}

.time-period-section select {
    padding: 6px 10px;
    border: 1px solid #2196f3;
    border-radius: 4px;
    background: white;
}

@media (max-width: 768px) {
    .condition-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .factor-modal-content {
        width: 95%;
        height: 90vh;
    }

    .modal-body {
        flex-direction: column;
    }

    .factor-sidebar {
        width: 100%;
        height: 120px;
        border-right: none;
        border-bottom: 2px solid #e9ecef;
    }

    .factor-subcategory-tabs {
        flex-wrap: wrap;
    }
}

/* 范围输入样式 */
.range-end-container {
    display: none;
    align-items: center;
    gap: 10px;
}

.value-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.factor-input-group {
    display: none;
}

.factor-compare-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s;
}

.factor-compare-btn:hover {
    background: #e9ecef;
    border-color: #3498db;
}