* {
    box-sizing: border-box;
}

body {
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.container {
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
}

.section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

/* 两列布局 */
.two-column-layout {
    display: flex;
    gap: 15px;
    flex-direction: row;
}

.column {
    flex: 1;
    
}

select, input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 5px;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

.grid-wrapper {
    display: grid;
    gap: 0;
    min-width: 250px;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.ban {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.grid-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    border: 1px solid #ddd;
    border-bottom: none;
}

.grid-row:last-child {
    border-bottom: 1px solid #ddd;
}

.grid-row > div {
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid #eee;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.head {
    font-weight: bold;
    background: #f0f8ff;
    color: #333;
}

.grid-row > div:last-child {
    border-right: none;
}

#result {
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    white-space: pre-line;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 个人排班网格样式 */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
    margin-top: 10px;
}

.schedule-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.day {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.shift {
    font-weight: bold;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.shift-off {
    background-color: #e0e0e0;
    color: #666;
}

.shift-day {
    background-color: #d4edda;
    color: #155724;
}

.shift-night {
    background-color: #cce5ff;
    color: #004085;
}

.shift-special {
    background-color: #fff3cd;
    color: #856404;
}

/* 比较排班区域样式 */

#compareBtn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#compareBtn:hover:not(:disabled) {
    background-color: #0056b3;
}

#compareBtn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 比较表格样式 */
.compare-table {
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.compare-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 40px;
    border-bottom: 1px solid #eee;
}

.compare-row:last-child {
    border-bottom: none;
}

.compare-header {
    background-color: #f8f9fa;
    font-weight: bold;
}

.compare-cell {
    padding: 8px;
    text-align: center;
    border-right: 1px solid #eee;
}

.compare-cell:last-child {
    border-right: none;
}

.same-shift {
    background-color: #fff3cd;
}

.same-shift .compare-cell {
    font-weight: bold;
    color: #856404;
}

.compare-stats {
    margin-top: 15px;
    padding: 12px;
    background-color: #e8f4f8;
    border: 1px solid #b8daff;
    border-radius: 6px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

/* 工时统计样式 */
.work-stats {
    margin-top: 15px;
    padding: 12px;
    background-color: #e8f4f8;
    border: 1px solid #b8daff;
    border-radius: 6px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.stat-item {
    padding: 5px 10px;
    text-align: center;
    color: #0c5460;
    font-weight: 500;
}

.shift-nodata {
    background-color: #f8d7da;
    color: #721c24;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .section {
        padding: 10px;
    }

    .grid-row > div {
        padding: 6px 2px;
        font-size: 0.8rem;
    }
    
    .schedule-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 4px;
    }
    
    .schedule-item {
        padding: 6px;
    }
    
    .day {
        font-size: 0.75rem;
    }
    
    .shift {
        font-size: 0.8rem;
    }
    
    .work-stats, .compare-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .compare-row {
        grid-template-columns: 50px 1fr 1fr 30px;
    }
    
    .compare-cell {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
}




