/* 配煤计算器样式 */

:root {
    --primary-color: #951D1D;
    --primary-hover: #7a1717;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #ccc;
    --bg-light: #f8f9fa;
}

/* 主容器 */
.blending-app {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    min-height: 800px;
}

/* 顶部导航 */
.blending-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.blending-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.blending-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.blending-tab:hover {
    color: var(--primary-color);
}

/* 两栏布局 */
.blending-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* 左侧煤种列表 */
.coal-list-panel {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    max-height: 700px;
    overflow-y: auto;
}

.coal-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.coal-list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-add-coal {
    padding: 6px 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-add-coal:hover {
    background: var(--primary-hover);
}

/* 三级煤种库样式 */
.coal-library-section {
    margin-bottom: 25px;
}

.library-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
    border-radius: 8px 8px 0 0;
    margin-bottom: 10px;
}

.library-icon {
    font-size: 20px;
}

.library-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    flex: 1;
}

.library-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.library-coal-list {
    /* 煤种卡片容器 */
}

.empty-library {
    padding: 30px 15px;
    text-align: center;
    color: #999;
    font-size: 13px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    border: 2px dashed #ddd;
}

/* 不同级别的颜色 */
.coal-library-section:nth-child(1) .library-section-header {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
}

.coal-library-section:nth-child(2) .library-section-header {
    background: linear-gradient(135deg, #5A6C7D 0%, #394B59 100%);
}

.coal-library-section:nth-child(3) .library-section-header {
    background: linear-gradient(135deg, #6B7C8C 0%, #4A5B6A 100%);
}

.coal-library-section:nth-child(4) .library-section-header {
    background: linear-gradient(135deg, #7A8D9D 0%, #5A6C7A 100%);
}

/* 煤种卡片 */
.coal-card {
    background: #fff;
    border: 2px solid #999;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.coal-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(149, 29, 29, 0.15);
}

.coal-card.selected {
    border-color: var(--primary-color);
    background: #fff5f5;
}

.coal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.coal-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.coal-select-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.coal-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.coal-type-badge {
    padding: 2px 8px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

.coal-price {
    font-size: 14px;
    color: var(--success-color);
    font-weight: 600;
}

.coal-indicators {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.indicator {
    font-size: 13px;
    color: var(--text-light);
}

.coal-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-edit, .btn-delete {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--bg-light);
    color: var(--primary-color);
}

.btn-edit:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-delete {
    background: var(--bg-light);
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: #fff;
}

/* 配比滑块 */
.coal-ratio-slider {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ratio-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-dark);
}

.ratio-value {
    font-weight: 600;
    color: var(--primary-color);
}

.ratio-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, var(--border-color) 0%, var(--primary-color) 100%);
}

.ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ratio-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 右侧计算区域 */
.calculation-panel {
    background: #fff;
    border: 2px solid #999;
    border-radius: 8px;
    padding: 20px;
}

/* 计算结果 */
.blending-result {
    background: linear-gradient(135deg, #fff 0%, var(--bg-light) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    text-align: center;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.result-item {
    text-align: center;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #999;
}

.result-label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.result-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.result-value.cost {
    color: var(--success-color);
}

.unit {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
}

.ratio-check {
    text-align: center;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    font-size: 15px;
}

.ratio-total {
    font-size: 20px;
    font-weight: 700;
    margin: 0 8px;
}

.ratio-total.valid {
    color: var(--success-color);
}

.ratio-total.invalid {
    color: var(--danger-color);
}

.ratio-status {
    font-size: 18px;
}

.ratio-status.valid {
    color: var(--success-color);
}

.ratio-status.invalid {
    color: var(--danger-color);
}

/* 警告提示 */
.warning-message {
    background: #fff3cd;
    border: 1px solid var(--warning-color);
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    color: #856404;
    font-size: 14px;
}

/* 煤种推荐 */
.recommendation-panel {
    background: #e8f5e9;
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.recommendation-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-item {
    background: #fff;
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommendation-info {
    flex: 1;
}

.recommendation-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.recommendation-detail {
    font-size: 13px;
    color: var(--text-light);
}

.btn-use-recommendation {
    padding: 6px 16px;
    background: var(--success-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-use-recommendation:hover {
    background: #059669;
}

/* 历史记录 */
.history-panel {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.history-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #fff;
    border: 2px solid #999;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(149, 29, 29, 0.15);
}

.history-time {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.history-content {
    font-size: 14px;
    color: var(--text-dark);
}

/* 操作按钮 */
.blending-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn-reset, .btn-copy, .btn-save {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-reset:hover {
    background: var(--border-color);
}

.btn-copy {
    background: var(--primary-color);
    color: #fff;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

.btn-save {
    background: var(--success-color);
    color: #fff;
}

.btn-save:hover {
    background: #059669;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.btn-close:hover {
    color: var(--text-dark);
}

.modal-body {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #999;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(149, 29, 29, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel, .btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-submit {
    background: var(--primary-color);
    color: #fff;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.empty-text {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.6;
}

/* 删除 @media (max-width: 768px) - 移动端样式在 mobile.css */
