// 整体页面容器
.pageContainer {
    width: 100%;
    height: 100vh;
    padding: 15px 0px 15px 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    
    // 顶部区域 (60%高度)
    .topSection {
        height: 60%;
        display: flex;
        gap: 15px;
        
        // 左侧排班表区域 (48%宽度)
        .scheduleSection {
            width: 48%;
            background: #fff;
            border-radius: 8px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            
            .sectionHeader {
                display: flex;
                align-items: center;
                margin-bottom: 16px;
                flex-shrink: 0;
                
                .titleBar {
                    width: 3px;
                    height: 16px;
                    background: #2E4CD4;
                    margin-right: 12px;
                }
                
                .sectionTitle {
                    margin: 0;
                    font-size: 16px;
                    font-weight: 500;
                    color: #333;
                }
            }
            
            // 控制栏
            .toolbar {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 16px;
                padding: 0 8px;
                flex-shrink: 0;
                
                .toolbarLeft {
                    flex: 1;
                    
                    .legend {
                        display: flex;
                        gap: 16px;
                        
                        .legendItem {
                            display: flex;
                            align-items: center;
                            font-size: 12px;
                            color: #666;
                            gap: 6px;
                            
                            .legendDot {
                                width: 10px;
                                height: 10px;
                                border-radius: 2px;
                                display: inline-block;
                                
                                &.onduty {
                                    background: #D4F4DD;
                                }
                                
                                &.leave {
                                    background: #FFE7BA;
                                }
                                
                                &.vacation {
                                    background: #FFD6E0;
                                }
                                
                                &.none {
                                    background: #E8E8E8;
                                }
                            }
                        }
                    }
                }
                
                .toolbarRight {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    
                    .dateRange {
                        font-size: 12px;
                        color: #666;
                    }
                    
                    .weekNav {
                        display: flex;
                        gap: 0;
                        border: 1px solid #d9d9d9;
                        border-radius: 2px;
                        overflow: hidden;
                        
                        .navButton {
                            border: none;
                            border-radius: 0;
                            background: #fff;
                            color: #666;
                            height: 28px;
                            font-size: 12px;
                            padding: 0 12px;
                            border-right: 1px solid #d9d9d9;
                            
                            &:last-child {
                                border-right: none;
                            }
                            
                            &:hover {
                                background: #f5f5f5;
                                color: #333;
                            }
                        }
                        
                        .navButtonActive {
                            background: #2E4CD4 !important;
                            color: #fff !important;
                            border: none;
                            
                            &:hover {
                                background: #1e3bb8 !important;
                            }
                        }
                    }
                }
            }
            
            // 排班表格
            .scheduleTable {
                flex: 1;
                overflow: auto;
                border: 1px solid #E5E5E5;
                border-radius: 4px;
                
                .table {
                    width: 100%;
                    border-collapse: collapse;
                    table-layout: fixed;
                    
                    th, td {
                        border: 1px solid #E5E5E5;
                        text-align: center;
                        vertical-align: middle;
                    }
                    
                    thead {
                        background: #FAFAFA;
                        position: sticky;
                        top: 0;
                        z-index: 10;
                        
                        th {
                            padding: 10px 6px;
                            font-weight: 500;
                            color: #333;
                            font-size: 12px;
                        }
                    }
                    
                    tbody {
                        td {
                            padding: 0;
                            height: 100px;
                        }
                    }
                    
                    // 第一列（班次列）
                    .shiftHeader {
                        width: 100px;
                        background: #FAFAFA;
                        color: #666;
                    }
                    
                    .shiftCell {
                        background: #FAFAFA;
                        padding: 12px 8px !important;
                        
                        .shiftName {
                            font-size: 13px;
                            font-weight: 500;
                            color: #333;
                            margin-bottom: 4px;
                        }
                        
                        .shiftTime {
                            font-size: 11px;
                            color: #999;
                        }
                    }
                    
                    // 日期表头
                    .dayHeader {
                        width: calc((100% - 100px) / 7);
                        
                        .dayName {
                            font-size: 12px;
                            color: #333;
                            margin-bottom: 3px;
                        }
                        
                        .dayDate {
                            font-size: 11px;
                            color: #999;
                            font-weight: normal;
                        }
                    }
                    
                    // 排班单元格
                    .scheduleCell {
                        position: relative;
                        padding: 0 !important;
                        
                        &.bg_onduty {
                            background: #D4F4DD;
                        }
                        
                        &.bg_leave {
                            background: #FFE7BA;
                        }
                        
                        &.bg_vacation {
                            background: #FFD6E0;
                        }
                        
                        &.bg_none {
                            background: #F5F5F5;
                        }
                        
                        &.bg_mixed {
                            background: linear-gradient(135deg, #D4F4DD 50%, #FFD6E0 50%);
                        }
                        
                        .emptyCell {
                            width: 100%;
                            height: 100px;
                        }
                        
                        .cellContent {
                            width: 100%;
                            height: 100px;
                            display: flex;
                            flex-direction: column;
                            align-items: center;
                            justify-content: center;
                            gap: 4px;
                            padding: 8px;
                            
                            .personItem {
                                display: flex;
                                flex-direction: column;
                                align-items: center;
                                gap: 2px;
                                
                                .personName {
                                    font-size: 12px;
                                    color: #333;
                                    font-weight: 500;
                                }
                                
                                .statusTag {
                                    font-size: 10px;
                                    padding: 2px 5px;
                                    border-radius: 2px;
                                    
                                    &.onduty {
                                        color: #52C41A;
                                    }
                                    
                                    &.leave {
                                        color: #FA8C16;
                                    }
                                    
                                    &.vacation {
                                        color: #F5222D;
                                    }
                                    
                                    &.none {
                                        color: transparent;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        // 中间区域：排班参数设置 (26%宽度)
        .middleSection {
            width: 26%;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            
            // 排班设置面板
            .settingPanel {
                flex: 1;
                background: #fff;
                border-radius: 8px;
                padding: 20px;
                overflow: auto;
                display: flex;
                flex-direction: column;
                
                .panelHeader {
                    display: flex;
                    align-items: center;
                    margin-bottom: 16px;
                    flex-shrink: 0;
                    
                    .titleBar {
                        width: 3px;
                        height: 16px;
                        background: #2E4CD4;
                        margin-right: 12px;
                    }
                    
                    .panelTitle {
                        margin: 0;
                        font-size: 16px;
                        font-weight: 500;
                        color: #333;
                    }
                }
                
                // 设置表单
                .settingForm {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    
                    .formItem {
                        margin-bottom: 16px;
                        flex-shrink: 0;
                        
                        .formLabel {
                            display: block;
                            font-size: 13px;
                            color: #666;
                            margin-bottom: 8px;
                        }
                        
                        .formInput {
                            width: 100%;
                        }
                    }
                    
                    .formActions {
                        margin-top: auto;
                        flex-shrink: 0;
                    }
                }
            }
        }
        
        // 右侧区域：统计概览和可用人员 (26%宽度)
        .rightSection {
            width: 26%;
            display: flex;
            flex-direction: column;
            gap: 15px;
            overflow: hidden;
            
            // 统计概览卡片
            .statsOverview {
                flex-shrink: 0;
                background: linear-gradient(135deg, #E6F4FF 0%, #F0F9FF 50%, #FFFFFF 100%);
                border-radius: 8px;
                padding: 20px;
                display: flex;
                flex-direction: column;
                
                .overviewHeader {
                    display: flex;
                    align-items: center;
                    margin-bottom: 16px;
                    flex-shrink: 0;
                    
                    .titleBar {
                        width: 3px;
                        height: 16px;
                        background: #2E4CD4;
                        margin-right: 12px;
                    }
                    
                    .overviewTitle {
                        margin: 0;
                        font-size: 16px;
                        font-weight: 500;
                        color: #333;
                    }
                }
                
                .statsGrid {
                    display: grid;
                    grid-template-columns: repeat(4, 1fr);
                    gap: 16px;
                    
                    .statItem {
                        background: rgba(255, 255, 255, 0.8);
                        border-radius: 6px;
                        padding: 16px;
                        text-align: center;
                        
                        .statValue {
                            font-size: 28px;
                            font-weight: bold;
                            color: #2E4CD4;
                            margin-bottom: 6px;
                            line-height: 1;
                        }
                        
                        .statLabel {
                            font-size: 12px;
                            color: #666;
                        }
                    }
                }
            }
            
            // 可用人员列表
            .availablePersons {
                flex: 1;
                background: #fff;
                border-radius: 8px;
                padding: 20px;
                display: flex;
                flex-direction: column;
                overflow: hidden;
                
                .personsHeader {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-bottom: 16px;
                    flex-shrink: 0;
                    
                    .titleBar {
                        width: 3px;
                        height: 16px;
                        background: #2E4CD4;
                        margin-right: 12px;
                    }
                    
                    .personsTitle {
                        flex: 1;
                        margin: 0;
                        font-size: 16px;
                        font-weight: 500;
                        color: #333;
                    }
                }
                
                .personsList {
                    flex: 1;
                    overflow: auto;
                    
                    .personCard {
                        display: flex;
                        align-items: center;
                        gap: 12px;
                        padding: 12px;
                        border: 1px solid #E5E5E5;
                        border-radius: 6px;
                        margin-bottom: 8px;
                        transition: all 0.3s;
                        
                        &:hover {
                            border-color: #2E4CD4;
                            box-shadow: 0 2px 8px rgba(46, 76, 212, 0.1);
                        }
                        
                        .personInfo {
                            flex: 1;
                            
                            .personName {
                                font-size: 14px;
                                color: #333;
                                font-weight: 500;
                                margin-bottom: 4px;
                            }
                            
                            .personDescription {
                                font-size: 12px;
                                color: #999;
                            }
                        }
                        
                        .addPersonButton {
                            flex-shrink: 0;
                            min-width: 32px;
                            height: 32px;
                            padding: 0;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                        }
                    }
                }
            }
        }
    }
    
    // 底部区域 (40%高度)
    .bottomSection {
        height: 40%;
        background: #fff;
        border-radius: 8px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        
        .sectionHeader {
            display: flex;
            align-items: center;
            margin-bottom: 16px;
            flex-shrink: 0;
            
            .titleBar {
                width: 3px;
                height: 16px;
                background: #2E4CD4;
                margin-right: 12px;
            }
            
            .sectionTitle {
                margin: 0;
                font-size: 16px;
                font-weight: 500;
                color: #333;
                flex: 1;
            }
        }
        
        .personTable {
            flex: 1;
            overflow: hidden;
            
            :global {
                .ant-table-wrapper {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                }
                
                .ant-spin-nested-loading {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                }
                
                .ant-spin-container {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                }
                
                .ant-table {
                    flex: 1;
                    overflow: hidden;
                }
                
                .ant-table-container {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                }
                
                .ant-table-body {
                    flex: 1;
                    overflow: auto !important;
                }
            }
            
            .tableActions {
                display: flex;
                gap: 12px;
                justify-content: center;
                align-items: center;
                
                :global {
                    .ant-btn-link {
                        padding: 0;
                        height: auto;
                        line-height: 1.5;
                    }
                }
            }
        }
    }
}

// 响应式
@media screen and (max-width: 1600px) {
    .pageContainer {
        .topSection {
            .scheduleSection {
                .scheduleTable {
                    .table {
                        font-size: 11px;
                        
                        tbody td {
                            height: 80px;
                        }
                        
                        .scheduleCell {
                            .emptyCell {
                                height: 80px;
                            }
                            
                            .cellContent {
                                height: 80px;
                            }
                        }
                    }
                }
            }
            
            .middleSection {
                .settingPanel {
                    padding: 16px;
                }
            }
            
            .rightSection {
                .statsOverview {
                    padding: 16px;
                    
                    .statsGrid {
                        grid-template-columns: repeat(4, 1fr);
                        gap: 12px;
                        
                        .statItem {
                            padding: 12px;
                            
                            .statValue {
                                font-size: 24px;
                            }
                            
                            .statLabel {
                                font-size: 11px;
                            }
                        }
                    }
                }
                
                .availablePersons {
                    padding: 16px;
                }
            }
        }
    }
}
