body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.calendar-header button:hover {
    background-color: #45a049;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background-color: #f0f0f0;
}

.day {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    padding: 8px;
    cursor: pointer;
    position: relative;
}

/* 工资周期边框颜色 */
.pay-period-0 {
    border: 2px solid #4CAF50;
}
.pay-period-1 {
    border: 2px solid #2196F3;
}
.pay-period-2 {
    border: 2px solid #9C27B0;
}
.pay-period-3 {
    border: 2px solid #FF9800;
}
.pay-period-4 {
    border: 2px solid #E91E63;
}

.pay-period-0 {
    border: 2px solid #4CAF50;
}

.pay-period-1 {
    border: 2px solid #2196F3;
}

.pay-period-2 {
    border: 2px solid #9C27B0;
}

.pay-period-3 {
    border: 2px solid #FF9800;
}

.day:hover {
    background-color: #f9f9f9;
}

.day-number {
    font-weight: bold;
}

.hours-display {
    font-size: 1em;
    color: #333;
    margin-top: 6px;
    font-weight: bold;
}

.day-off {
    color: #f44336;
    font-weight: bold;
}

.earnings-display {
    font-size: 0.9em;
    color: #4CAF50;
    margin-top: 4px;
    font-weight: bold;
}

.earnings-summary {
    margin-bottom: 20px;
}

.earnings-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.earnings-header h2 {
    margin: 0 15px 0 0;
}

.rate-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rate-control input {
    width: 60px;
    margin: 0 5px;
}

/* 餐补开关样式 */
.meal-allowance-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 10px;
}

.meal-allowance-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.meal-allowance-label {
    margin-left: 5px;
    font-size: 0.9em;
}

.earnings-info {
    margin: 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.earnings-info div {
    margin: 8px 0;
    font-size: 0.95em;
}

.earnings-info div:first-child {
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    font-size: 1em;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    max-width: 90%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#save-btn {
    background-color: #4CAF50;
    color: white;
}

#cancel-btn {
    background-color: #f44336;
    color: white;
}

#day-off-btn {
    background-color: #2196F3;
    color: white;
}

input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .day {
        padding: 4px;
        font-size: 0.9em;
    }
    
    .hours-display, .earnings-display {
        font-size: 0.8em;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-header button {
        padding: 6px 12px;
        font-size: 0.9em;
        width: 100%;
    }
    
    .modal-content {
        width: 90%;
    }
    
    .earnings-info {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .earnings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rate-control {
        width: 100%;
        justify-content: space-between;
    }
    
    .meal-allowance-switch {
        margin-left: 0;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .day-header {
        padding: 5px;
        font-size: 0.9em;
    }
}