body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 8px;
    background-color: #f8f9fa;
    color: #343a40;
    font-size: 16px;
}


h1 {
    text-align: center;
    color: #2c3e50;
    margin: 5px auto 15px auto;
    font-size: 2.2em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    position: relative;
    padding: 5px 20px;
    line-height: 1.3;
    max-width: 600px;
}



.controls {
    margin-bottom: 10px;
    padding: 12px;
    background-color: #ffffff;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.controls label {
    font-weight: 600;
    color: #495057;
}

.controls input[type="number"],
.controls select {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95em;
    color: #495057;
}

.controls button {
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.2);
}

.controls button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.controls button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
}

#exportBtn {
    background-color: #28a745;
    /* Green for export button */
}

#exportBtn:hover {
    background-color: #218838;
}

#tableContainer {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

table {
    /* width: 100%; */
    /* 移除此行，允许表格根据内容扩展 */
    border-collapse: collapse;
    table-layout: auto;
    /* 根据内容自动调整列宽 */
    width: max-content;
    /* 强制表格宽度适应内容 */
    border: 1px solid #e0e0e0;
    /* Lighter border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    /* Rounded corners for the table */
    overflow: hidden;
    /* Ensures rounded corners apply to borders */
}

th,
td {
    border: 1px solid #e0e0e0;
    padding: 6px;
    text-align: center;
    font-size: 0.9em;
    word-break: break-word;
}

th {
    background-color: #E2F0D5;
    font-weight: bold;
    color: #343a40;
    padding: 8px 6px;
    vertical-align: middle;
    border-bottom: 2px solid #A9C4A0;
}

thead th {
    position: sticky;
    /* 使表头在滚动时固定 */
    top: 0;
    z-index: 2;
    background-color: #E2F0D5;
    /* Ensure sticky header has the same color */
}

/* 固定第一列（资源列表） */
td:first-child,
th:first-child {
    position: sticky;
    left: 0;
    background-color: #f8f9fa;
    /* Lighter background for sticky column */
    z-index: 3;
    /* min-width: 120px; */
    white-space: normal;
    font-weight: bold;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for sticky effect */
}

th:first-child {
    z-index: 4;
    left: 0;
    background-color: #E2F0D5;
    /* Match header background */
}


.resource-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}

.resource-select,
.custom-resource-input,
.man-day-input,
.unit-price-input,
.remarks-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9em;
    padding: 4px;
    border: 1px solid #d1d7dc;
    border-radius: 3px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: 600;
}

.man-day-input:focus,
.unit-price-input:focus,
.remarks-input:focus,
.resource-select:focus,
.custom-resource-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.subtotal,
.total-price,
.week-total,
.grand-total-manday,
.grand-total-price {
    font-weight: 600;
    background-color: #f0f0f0;
}

.phase-bar {
    font-weight: 600;
    background-color: #e6f7ff;
    /* Lighter blue for phase bar */
}

/* 斑马纹效果 */
tbody tr:nth-child(even) {
    background-color: #f9f9f9;
    /* Lighter gray for even rows */
}

/* --- 日期选择器样式 --- */
.date-picker-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    padding: 12px;
    background-color: #ffffff;
    border-radius: 6px;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.date-picker-group {
    display: flex;
    flex-direction: column;
}

.date-picker-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 1em;
}

.date-picker-group input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    margin-bottom: 5px;
    font-size: 0.95em;
    color: #495057;
}

.date-picker-group input[type="text"]:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}



.date-picker-group button {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.date-picker-group button:hover {
    background-color: #218838;
}

.date-list {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 50px;
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e9ecef;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    /* Adjusted font size */
}

.remove-date-btn {
    color: red;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

/* 已移除空规则集 */

/* 调整总计行的样式 */
tbody tr:last-child td {
    background-color: #e9ecef;
    /* Match header background */
    font-weight: bold;
    color: #343a40;
}

.sticky-total-cell {
    position: sticky;
    left: 0;
    background-color: #e9ecef;
    /* Match total row background */
    z-index: 3;
    font-weight: bold;
    text-align: center;
    /* Align text to center */
    padding-right: 20px;
    /* Add some padding */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for sticky effect */
}



.remarks-input[data-row="total"] {
    width: 100%;
}

.delete-row-btn {
    background-color: #dc3545;
    /* Red */
    color: white;
    border: none;
    border-radius: 4px;
    /* Slightly rounded */
    padding: 4px 8px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.delete-row-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

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

/* Ensure the resource select and custom input are aligned */
.phase-bar {
    display: flex;
    align-items: center;
    gap: 5px;
}

.phase-bar select,
.phase-bar input[type="text"] {
    flex-grow: 1;
    /* Allow them to take available space */
}

/* 已移除空规则集 */

/* 已移除空规则集 */

/* Ensure the total row's remarks input is full width */
tbody tr:last-child td:last-child input {
    width: calc(100% - 10px);
    /* Account for padding */
}

.weekly-header {
    white-space: normal;
    overflow-wrap: break-word;
}

/* 通知样式 */
.notification {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.notification-message {
    margin-right: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-notification {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #856404;
    position: absolute;
    top: 5px;
    right: 10px;
}

.close-notification:hover {
    color: #533f03;
}

/* 按钮高亮样式 */
.highlight-button {
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}