﻿/* 系数设置页面专用样式 */

/* 标题和工具栏包装器 - 同一行显示 */
.header-toolbar-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,.05);
    margin-bottom: 16px;
    border: 1px solid #eef2f7;
}

/* 标题区域 */
.header-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

/* 标题内联样式 */
.header-inline {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
}

.header-inline h1 {
    margin: 0 0 6px 0;
    font-size: 22px;
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-inline .sub {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

/* 工具栏内联样式 */
.toolbar-inline {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
    justify-content: flex-end;
}

.toolbar-inline .toolbar-left {
    margin-left: auto;
}

/* 工具栏样式 */
.toolbar {
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,.05);
    margin-bottom: 16px;
    border: 1px solid #eef2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    font-size: 16px;
}

/* 筛选区域样式 */
.filter-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* 筛选区域内联样式 - 保留背景框 */
.filter-section.filter-inline {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex-wrap: wrap;
}

.filter-grid {
    display: flex;
    gap: 0;
    flex: 1;
    min-width: 0;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    width: 200px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.filter-group:not(:first-child) {
    margin-left: 4px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.filter-input {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.filter-actions-group {
    display: flex;
    flex-direction: column;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-start;
}

.filter-actions button {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.filter-actions button:nth-child(2) {
    margin-right: 12px;
}

.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .header-toolbar-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .header-section {
        width: 100%;
    }
    .filter-inline {
        width: 100%;
    }
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-grid {
        grid-template-columns: 1fr;
    }
    .filter-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.filter-info {
    display: flex;
    align-items: center;
}

.filter-status {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.filter-status.active {
    color: #3b82f6;
    font-weight: 600;
}

/* 系数设置表格容器 */
.coefficient-table-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,.05);
    border: 1px solid #eef2f7;
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* 系数设置表格样式 */
.coefficient-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.coefficient-table thead {
    position: sticky;
    top: 0;
    background: #f9fafb;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coefficient-table th,
.coefficient-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.coefficient-table th {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    position: relative;
    color: #000;
}

.coefficient-table tbody tr {
    transition: background-color 0.2s;
}

.coefficient-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.coefficient-table tbody tr:hover {
    background: #eef2ff;
}

/* 列宽设置 - 调整特定列宽度时，修改对应的width值 */
/* 
调整示例：
- 增加产品组描述列宽度：.col-product-group-desc { width: 300px; }
- 减少GCK列宽度：.col-gck { width: 80px; }
- 调整操作列宽度：.col-operation { width: 180px; }
*/
.coefficient-table .col-no { width: 25px; } /* No. */
.coefficient-table .col-product-group-desc { width: 100px; } /* 产品组描述 */
.coefficient-table .col-gck { width: 30px; } /* GCK */
.coefficient-table .col-price-group { width: 30px; } /* 价格组 */
.coefficient-table .col-product-group { width: 30px; } /* 产品组 */
.coefficient-table .col-bu { width: 30px; } /* BU */
.coefficient-table .col-standard-discount { width: 40px; } /* 标准折扣 */
.coefficient-table .col-special-discount { width: 40px; } /* 特殊折扣 */
.coefficient-table .col-special-discount-intl { width: 50px; } /* 特殊折扣_INTL */
.coefficient-table .col-jhdl-ouyeel { width: 50px; } /* JHDL-欧冶系数 */
.coefficient-table .col-ouyeel-fdzb { width: 50px; } /* 欧冶-方大系数 */
.coefficient-table .col-fdzb-enduser { width: 50px; } /* 方大-钢厂系数 */
.coefficient-table .col-siemens-fdgt { width: 50px; } /* 西门子-方大系数 */
.coefficient-table .col-coefficient { width: 30px; } /* 系数 */
.coefficient-table .col-coefficient-intl { width: 40px; } /* 系数_INTL */
.coefficient-table .col-spare-parts-kp { width: 40px; } /* 备件系数 */
.coefficient-table .col-agreement { width: 30px; } /* 协议 */
.coefficient-table .col-operation { width: 50px; } /* 操作 */

/* 可编辑单元格样式 */
.editable-cell {
    outline: none;
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
    font-size: 12px;
}

/* 隐藏数字输入框的spinner箭头 */
.editable-cell[type="number"]::-webkit-inner-spin-button,
.editable-cell[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.editable-cell[type="number"] {
    -moz-appearance: textfield;
}

.editable-cell:focus {
    border-color: #3b82f6;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.editable-cell:hover {
    border-color: #cbd5e1;
}

/* 折扣输入框样式 */
.discount-input {
    text-align: right;
    font-weight: 500;
    color: #374151;
}

.discount-input:focus {
    background: #f0f9ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 保存按钮样式 */
.save-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-right: 4px;
}

.save-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.save-btn:active {
    transform: translateY(0);
}

.save-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 删除按钮样式 */
.delete-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-state-description {
    font-size: 14px;
    margin-bottom: 24px;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6b7280;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误提示 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* 清除筛选、导入数据、导出数据按钮样式 */
#clearFilter,
#importData,
#exportData {
    background: #FFFFFF !important;
    color: #374151 !important;
}
#clearFilter:hover,
#importData:hover,
#exportData:hover {
    background: #f3f4f6 !important;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .coefficient-table th,
    .coefficient-table td {
        padding: 10px 6px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .header-toolbar-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .toolbar-inline {
        justify-content: center;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left, .toolbar-right {
        justify-content: center;
    }
    
    .coefficient-table th,
    .coefficient-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .coefficient-table th,
    .coefficient-table td {
        padding: 6px 2px;
        font-size: 11px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 表格行状态指示 */
.row-modified {
    background: #fef3c7 !important;
}

.row-saved {
    background: #d1fae5 !important;
}

.row-error {
    background: #fee2e2 !important;
}

/* 输入验证样式 */
.input-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.input-success {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
}

/* 模态框增强样式 */
.modal-content {
    max-width: 600px;
    width: 95%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 隐藏表单中数字输入框的spinner箭头 */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
