* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
    background: linear-gradient(90deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

h1 {
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: 700;
}

.subtitle {
    color: #7f8c8d;
    font-size: 16px;
    font-weight: 500;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.result-section {
    flex: 3;
    min-height: 500px;
    transition: all 0.3s ease;
}

.settings-upload-section {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.panel {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(220, 220, 220, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #2c3e50);
}

h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2 i {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

h3 {
    color: #2c3e50;
    font-size: 17px;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: #fff;
}

input:focus, select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 12px;
    padding: 35px 25px;
    text-align: center;
    background-color: rgba(52, 152, 219, 0.05);
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-3px);
}

.upload-area i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
}

.upload-area small {
    color: #7f8c8d;
    display: block;
    line-height: 1.5;
}

#fileInput {
    display: none;
}

.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #219653);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #d68910);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.shift-definitions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.shift-def {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.shift-def:hover {
    border-color: #3498db;
    transform: translateY(-5px);
}

.shift-letter {
    font-size: 28px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
}

.shift-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.shift-input-group label {
    margin-bottom: 0;
    width: 50px;
    font-size: 13px;
}

.shift-input-group input {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.employee-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    padding: 10px;
    background: white;
}

.employee-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.employee-item:hover {
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
}

.employee-item:last-child {
    border-bottom: none;
}

.employee-info {
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-name {
    font-weight: 600;
    color: #2c3e50;
}

.employee-area {
    font-weight: bold;
    color: #3498db;
    font-size: 13px;
}

.employee-details {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 10px;
}

.employee-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 13px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 修改表头样式 - 使用浅色背景和深色文字 */
th {
    background: linear-gradient(135deg, #e8f0fe, #d0d7ff);
    color: #2c3e50;
    padding: 14px 6px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    font-size: 14px;
    border-bottom: 2px solid #3498db;
}

th:last-child {
    border-right: none;
}

/* 日期表头样式 */
.day-header {
    background: linear-gradient(135deg, #f0f8ff, #e6f7ff);
    color: #1a3658;
    font-weight: 700;
    border-right: 1px solid rgba(52, 152, 219, 0.2);
}

.day-header.weekend {
    background: linear-gradient(135deg, #fff0f0, #ffe6e6);
    color: #b33939;
}

.day-header.holiday {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    color: #e67e22;
}

td {
    padding: 10px 5px;
    text-align: center;
    border: 1px solid #e8e8e8;
    position: relative;
    transition: all 0.2s;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

tr:hover {
    background-color: rgba(52, 152, 219, 0.03);
}

.weekend {
    background-color: #fef2f2;
}

.holiday {
    background-color: #fff9e6;
}

.holiday::after {
    content: attr(data-holiday);
    position: absolute;
    top: 0;
    right: 0;
    font-size: 9px;
    background-color: #ffc107;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.shift-早11 {
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: bold;
}

.shift-夜11 {
    background-color: #fff3e0;
    color: #e65100;
    font-weight: bold;
}

.shift-日8 {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: bold;
}

.shift-休 {
    background-color: #f5f5f5;
    color: #616161;
    font-weight: bold;
}

.shift-change {
    position: relative;
}

.shift-change::before {
    content: "★";
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: #e74c3c;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #3498db;
    font-size: 16px;
}

.loading i {
    font-size: 28px;
    margin-right: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.instructions {
    background: linear-gradient(145deg, #fff8e1, #fff3cd);
    border-left: 5px solid #ffc107;
    padding: 20px;
    margin-top: 20px;
    border-radius: 10px;
    grid-column: 1 / -1;
}

.instructions h4 {
    color: #ff9800;
    margin-bottom: 12px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.5;
}

.instructions code {
    background-color: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: #7f8c8d;
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.result-info {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    border-left: 5px solid #4caf50;
    font-weight: 600;
    color: #2e7d32;
}

.holiday-management {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.holiday-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    background: white;
}

.holiday-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.holiday-item:hover {
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
}

.holiday-item:last-child {
    border-bottom: none;
}

.holiday-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
}

.holiday-date {
    font-weight: 600;
    color: #2c3e50;
}

.holiday-name {
    color: #e67e22;
    font-weight: 600;
}

.holiday-actions {
    display: flex;
    gap: 8px;
}

.holiday-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holiday-edit-btn {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.holiday-edit-btn:hover {
    background: rgba(52, 152, 219, 0.2);
}

.holiday-delete-btn {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.holiday-delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

.print-settings {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.print-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.print-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    transition: all 0.2s;
}

.print-option:hover {
    background: rgba(52, 152, 219, 0.05);
}

.print-option input {
    width: auto;
}

.print-option label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .settings-upload-section {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 4px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .shift-definitions {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .print-options {
        grid-template-columns: 1fr;
    }
    
    .holiday-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .holiday-actions {
        align-self: flex-end;
    }
    
    h1 {
        font-size: 26px;
    }
    
    h2 {
        font-size: 20px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .container, .container * {
        visibility: visible;
    }
    
    .container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        padding: 10px;
        background: white;
    }
    
    .panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .button-group, .upload-area, .instructions, footer, .print-settings {
        display: none !important;
    }
    
    table {
        font-size: 10px;
    }
    
    th, td {
        padding: 6px 3px;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}