/* 混合物性质功能样式 */

/* 混合物功能入口按钮 */
.btn-mixture {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.btn-mixture:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 混合物面板 */
.mixture-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.mixture-dialog {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

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

.mixture-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-radius: 16px 16px 0 0;
}
.mixture-dialog-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}
.mixture-dialog-header .btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 8px;
}
.mixture-dialog-header .btn-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.mixture-dialog-body {
    padding: 24px;
}

/* 标签页切换 */
.mixture-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
}
.mixture-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}
.mixture-tab.active {
    background: white;
    color: #7c3aed;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mixture-tab:hover:not(.active) {
    color: #374151;
}

/* 标签页内容 */
.mixture-tab-content {
    display: none;
}
.mixture-tab-content.active {
    display: block;
}

/* 物质选择器 */
.substance-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.substance-selector .selector-group {
    flex: 1;
    min-width: 200px;
}
.substance-selector label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.substance-selector input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.substance-selector input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* 二元参数结果 */
.binary-params-result {
    margin-top: 16px;
}
.param-model-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.param-model-card h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}
.param-model-card .badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}
.badge-nrtl { background: #dbeafe; color: #1d4ed8; }
.badge-uniquac { background: #dcfce7; color: #15803d; }
.badge-wilson { background: #fef3c7; color: #b45309; }
.badge-pr { background: #fce7f3; color: #be185d; }

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.param-table th {
    text-align: left;
    padding: 6px 12px;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 1px solid #e5e7eb;
}
.param-table td {
    padding: 6px 12px;
    color: #1f2937;
    font-family: 'Courier New', monospace;
}

/* UNIFAC 计算器 */
.unifac-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.unifac-substances {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.unifac-substance-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.unifac-substance-row input[type="text"] {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.unifac-substance-row input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    max-width: 100px;
}
.unifac-substance-row .btn-remove-sub {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

/* 控制行 */
.unifac-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.unifac-controls .control-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.unifac-controls label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.unifac-controls input, .unifac-controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.btn-add-substance {
    background: #f3f4f6;
    border: 1px dashed #9ca3af;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-add-substance:hover {
    background: #e5e7eb;
    border-color: #6b7280;
    color: #374151;
}
.btn-calc-unifac {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}
.btn-calc-unifac:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.btn-calc-unifac:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* UNIFAC 结果 */
.unifac-result {
    margin-top: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
.unifac-result h4 {
    margin: 0 0 12px 0;
    color: #1f2937;
}
.gamma-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.gamma-card {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.gamma-card .substance-name {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}
.gamma-card .gamma-value {
    font-size: 24px;
    font-weight: 700;
    color: #7c3aed;
    font-family: 'Courier New', monospace;
}
.gamma-card .gamma-label {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 图表容器 */
.unifac-chart-container {
    margin-top: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}
.unifac-chart-container canvas {
    width: 100% !important;
    max-height: 350px;
}

/* 无数据提示 */
.no-data-hint {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}
.no-data-hint .icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.no-data-hint p {
    font-size: 14px;
    margin: 4px 0;
}

/* 搜索建议下拉 */
.mixture-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1010;
    display: none;
}
.mixture-suggestions .suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}
.mixture-suggestions .suggestion-item:hover {
    background: #f5f3ff;
}
.mixture-suggestions .suggestion-item .cas {
    color: #9ca3af;
    font-size: 12px;
    margin-left: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .mixture-dialog {
        width: 95%;
        max-height: 90vh;
    }
    .substance-selector {
        flex-direction: column;
    }
    .unifac-substance-row {
        flex-wrap: wrap;
    }
    .gamma-cards {
        flex-direction: column;
    }
}
