/* 点检绑定矩阵样式 */

.binding-matrix-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* 确保 a-spin 内部容器正确继承 flex 布局 */
.binding-matrix-container .ant-spin-nested-loading,
.binding-matrix-container .ant-spin-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.matrix-toolbar {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.binding-matrix-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.binding-matrix-table th,
.binding-matrix-table td {
    border: 1px solid #f0f0f0;
    padding: 12px;
    text-align: center;
}

.binding-matrix-table th {
    background: #fafafa;
    font-weight: 600;
    min-width: 150px;
}

.binding-matrix-table .fixed-column {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #fff;
}

.binding-matrix-table th.fixed-column {
    background: #fafafa;
    z-index: 20;
}

.binding-matrix-table .template-name {
    font-weight: 500;
    text-align: left;
    min-width: 200px;
}

/* 单元格状态样式 */
.unbound-cell {
    background: #fafafa;
    color: #d9d9d9;
}

.unbound-cell:hover {
    background: #f0f0f0;
}

.direct-cell {
    background: #f6ffed;
}

.direct-cell:hover {
    background: #d9f7be;
}

.inherited-cell {
    background: #e6f7ff;
}

.inherited-cell:hover {
    background: #bae7ff;
}

/* 优先级徽章 */
.priority-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .binding-matrix-table {
        font-size: 12px;
    }
    
    .binding-matrix-table th,
    .binding-matrix-table td {
        padding: 8px;
        min-width: 100px;
    }
    
    .binding-matrix-table .template-name {
        min-width: 150px;
    }
}

/* 表格滚动容器 - flex自适应高度 */
.matrix-table-wrapper {
    overflow: auto !important;  /* 自动显示滚动条 */
    flex: 1;
    min-height: 0;
    max-height: 100%;
    scrollbar-width: auto;  /* Firefox */
    -ms-overflow-style: scrollbar;  /* IE/Edge */
    position: relative;
}

/* 旧的表格滚动容器（兼容） */
.matrix-table {
    overflow-x: auto;
    max-width: 100%;
}

/* 滚动条样式优化 - 更粗更明显 */
.matrix-table-wrapper::-webkit-scrollbar,
.matrix-table::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
    display: block !important;
}

.matrix-table-wrapper::-webkit-scrollbar-track,
.matrix-table::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 6px;
}

.matrix-table-wrapper::-webkit-scrollbar-thumb,
.matrix-table::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
}

.matrix-table-wrapper::-webkit-scrollbar-thumb:hover,
.matrix-table::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* 确保滚动条角落样式 */
.matrix-table-wrapper::-webkit-scrollbar-corner {
    background: #f0f0f0;
}

/* 筛选栏样式 */
.matrix-filter {
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    flex-shrink: 0;
}