/* ==================== 耗材档案页面样式 ==================== */
/* 样式前缀: ca- (consumables-archive) */

/* -------------------- 卡片容器样式 -------------------- */
/* 与出库单策略页面保持一致 */
.ca-card {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

/* -------------------- 列表区域样式 -------------------- */
/* 与出库单策略页面保持一致 */

/* 列表区域容器 */
.ca-list {
    height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    border-radius: 0px 0px 8px 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* 表格容器 */
.ca-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}

/* 数据表格样式 */
.ca-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 1900px;
}

.ca-table th,
.ca-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ebeef5;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ca-table th {
    background-color: #f5f7fa;
    font-weight: 500;
    color: #303133;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #ebeef5;
}

.ca-table td {
    color: #303133;
}

.ca-table tbody tr {
    cursor: pointer;
}

.ca-table tbody tr:hover {
    background-color: #f5f7fa;
}

/* 回收耗材列居中 */
.ca-table .ca-col-reusable {
    text-align: center;
}

/* 居中列样式：耗材类型、耗材条码、回收耗材、单位、尺寸信息、出库单价、托盘规格、限用范围、库存预警、是否禁用 */
.ca-table th:nth-child(3),
.ca-table td:nth-child(3),
.ca-table th:nth-child(4),
.ca-table td:nth-child(4),
.ca-table th:nth-child(5),
.ca-table td:nth-child(5),
.ca-table th:nth-child(6),
.ca-table td:nth-child(6),
.ca-table th:nth-child(7),
.ca-table td:nth-child(7),
.ca-table th:nth-child(8),
.ca-table td:nth-child(8),
.ca-table th:nth-child(9),
.ca-table td:nth-child(9),
.ca-table th:nth-child(12),
.ca-table td:nth-child(12),
.ca-table th:nth-child(13),
.ca-table td:nth-child(13),
.ca-table th:nth-child(14),
.ca-table td:nth-child(14) {
    text-align: center;
}

/* 操作列样式 - 与出库单策略页面保持一致 */
.ca-table th:nth-child(17),
.ca-table td:nth-child(17) {
    width: 180px;
    text-align: center;
    white-space: nowrap;
}

/* 尺寸信息列样式 */
.ca-table th:nth-child(7),
.ca-table td:nth-child(7) {
    text-align: center;
    white-space: nowrap;
}

/* 操作按钮容器 */
.ca-table .ca-action-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

/* 操作按钮样式 - 扁平化设计 */
.ca-table .ca-btn-action {
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
    line-height: 1.4;
}

.ca-table .ca-btn-action.ca-toggle-status {
    background-color: #f6ffed;
    color: #52c41a;

}
.ca-table .ca-btn-action.ca-toggle-status:hover {
    background-color: #d9f7be;
}


.ca-table .ca-btn-action.ca-edit {
    background-color: #e6f7ff;
    color: #1890ff;
}

.ca-table .ca-btn-action.ca-edit:hover {
    background-color: #bae7ff;
}

.ca-table .ca-btn-action.ca-delete {
    background-color: #fff2f0;
    color: #ff4d4f;
}

.ca-table .ca-btn-action.ca-delete:hover {
    background-color: #ffccc7;
}

.ca-table .ca-btn-action.ca-log {
    background-color: #f9f0ff;
    color: #722ed1;
}

.ca-table .ca-btn-action.ca-log:hover {
    background-color: #efdbff;
}

/* 查看尺寸超链接样式 */
.ca-table td:nth-child(7) .link-view-size {
    color: #0052d9;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.ca-table td:nth-child(7) .link-view-size:hover {
    color: #266fe8;
}

/* -------------------- 尺寸信息弹窗样式 -------------------- */

.ca-size-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.ca-size-modal {
    background: white;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: ca-modal-fade-in 0.2s ease-out;
}

@keyframes ca-modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ca-size-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.ca-size-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #1d2129;
}

.ca-size-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #86909c;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.ca-size-modal-close:hover {
    background: #f2f3f5;
    color: #1d2129;
}

.ca-size-modal-body {
    padding: 20px;
}

.ca-size-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ca-size-info-row:last-child {
    border-bottom: none;
}

.ca-size-label {
    color: #4e5969;
    font-size: 14px;
}

.ca-size-value {
    color: #1d2129;
    font-size: 14px;
    font-weight: 500;
}

.ca-size-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* -------------------- 搜索表单样式 -------------------- */

/* 搜索表单 - 与出库单策略页面保持一致 */
.ca-search-form {
    background: #ffffff;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ca-search-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.ca-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ca-search-label {
    font-size: 13px;
    font-weight: 500;
    color: #1d2129;
    min-width: 80px;
}

/* 组合搜索框 */
.ca-search-field .ca-search-combined {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e5e6eb;
    width: 100%;
    min-width: 200px;
}

.ca-search-field .ca-search-type {
    width: 100px;
    height: 36px;
    border: none;
    border-right: 1px solid #e5e6eb;
    border-radius: 0;
    padding: 0 12px;
    cursor: pointer;
    margin: 0;
    background-color: #ffffff;
}

.ca-search-field .ca-search-value {
    flex: 1;
    border: none;
    border-radius: 0;
    height: 36px;
    background: #ffffff;
    padding: 0 12px;
    margin: 0;
}

.ca-search-field .ca-search-type:focus,
.ca-search-field .ca-search-value:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

/* -------------------- 搜索输入框和下拉框样式 -------------------- */

.ca-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    vertical-align: middle;
    box-sizing: border-box;
}

.ca-search-select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    vertical-align: middle;
    box-sizing: border-box;
}

.ca-search-input:focus,
.ca-search-select:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.ca-search-input:hover,
.ca-search-select:hover {
    border-color: #c9cdd4;
}

/* -------------------- 树形选择器样式 -------------------- */

.ca-tree-select {
    position: relative;
    min-width: 180px;
    width: 100%;
}

.ca-tree-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.ca-tree-select-trigger .ca-search-input {
    width: 100%;
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.ca-tree-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    box-sizing: border-box;
}

.ca-tree-search {
    padding: 8px;
    border-bottom: 1px solid #e5e6eb;
}

.ca-tree-search-input {
    width: 100%;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.ca-tree-search-input:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.ca-tree-search-input:hover {
    border-color: #c9cdd4;
}

.ca-tree-content {
    padding: 8px 0;
}

.ca-tree-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    color: #1d2129;
}

.ca-tree-item:hover {
    background: #f2f3f5;
}

.ca-tree-item.selected {
    background: #e8f0ff;
    color: #0052d9;
}

.ca-tree-group {
    margin-bottom: 8px;
}

.ca-tree-header {
    padding: 8px 16px;
    font-weight: 500;
    color: #86909c;
    font-size: 12px;
}

.ca-tree-children {
    padding-left: 16px;
}

.ca-tree-text {
    font-size: 13px;
    color: #1d2129;
}

/* -------------------- 货主选择样式 -------------------- */

.ca-owner-select-container {
    position: relative;
    min-width: 200px;
}

.ca-owner-select-input {
    width: 100%;
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    font-size: 13px;
    box-sizing: border-box;
}

.ca-owner-select-input:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.ca-owner-select-input:hover {
    border-color: #c9cdd4;
}

.ca-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #86909c;
    pointer-events: none;
}

.ca-owner-clear-btn {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
}

.ca-owner-clear-btn:hover {
    color: #f53f3f;
}

/* -------------------- 表格头部样式 -------------------- */

.ca-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.ca-table-title {
    font-size: 16px;
    font-weight: 500;
    color: #303133;
    margin: 0;
}

.ca-table-actions-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* -------------------- 分页样式 -------------------- */
/* 与出库单策略页面保持一致 */

.ca-pagination {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.ca-pagination-info {
    font-size: 14px;
    color: #4b5563;
}

.ca-pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ca-page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4b5563;
}

.ca-page-size-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
}

/* -------------------- 按钮样式 -------------------- */

.ca-btn {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f5f5f5;
    color: #4e5969;
    border: 1px solid #d9d9d9;
}

.ca-btn:hover {
    background-color: #e6e6e6;
}

.ca-btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.ca-btn-primary {
    background-color: #0052d9;
    color: white;
    border-color: #0052d9;
}

.ca-btn-primary:hover {
    background-color: #003bb3;
    border-color: #003bb3;
}

.ca-btn-secondary {
    background-color: #f5f5f5;
    color: #4e5969;
    border-color: #d9d9d9;
}

.ca-btn-secondary:hover {
    background-color: #e6e6e6;
}

.ca-btn-pagination {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ca-btn-pagination:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ca-btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -------------------- 响应式调整 -------------------- */
@media (max-width: 1200px) {
    .ca-search-row {
        gap: 12px;
    }
    
    .ca-search-field {
        flex: 1 1 calc(33.333% - 12px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .ca-search-form {
        padding: 16px;
    }
    
    .ca-search-field {
        flex: 1 1 100%;
    }
    
    .ca-table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 16px;
    }
    
    .ca-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .ca-table-footer {
        padding: 16px;
    }
}
