/* 合并自projectList.html和projectEdit.html的CSS样式 */

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.container {
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* projectEdit.html特定的容器宽度 */
.project-selector + .container,
.projectEdit .container {
    max-width: 800px;
    padding: 24px;
}

h1 {
    color: #1890ff;
    margin-bottom: 20px;
}

/* projectEdit.html特定的标题样式 */
.projectEdit h1 {
    text-align: center;
    margin-bottom: 24px;
}

/* 表单样式 - projectEdit.html */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #262626;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.error-message {
    color: #ff4d4f;
    margin-top: 4px;
    font-size: 14px;
}

.project-selector {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #fafafa;
    border-radius: 4px;
}

.project-selector h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #262626;
}

/* 按钮样式 */
.btn {
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #262626;
    border: 1px solid #d9d9d9;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f0f0f0;
}

/* 搜索相关样式 - projectList.html */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 300px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.search-button, .schedule-button {
    padding: 8px 16px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-button:hover, .schedule-button:hover {
    background-color: #40a9ff;
}

.reset-button {
    padding: 8px 16px;
    background-color: #f5f5f5;
    color: #262626;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.reset-button:hover {
    background-color: #f0f0f0;
}

/* 表格样式 - projectList.html */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

th {
    background-color: #f0f2f5;
    font-weight: 600;
    color: #262626;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background-color: #fafafa;
}

/* 日期相关样式 */
.inline-date-button {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
}

.inline-date-button:hover {
    background-color: #e0e0e0;
    border-color: #bfbfbf;
}

.date-cell {
    white-space: nowrap;
    max-width: 180px;
    position: relative;
}

.date-cell-alert {
    white-space: nowrap;
    max-width: 180px;
    border: 2px solid red;
    border-radius: 4px;
    padding: 6px 4px;
    background-color: #fff0f0;
    display: inline-block;
}

/* 消息样式 */
.success-message-inline {
    color: green;
    font-size: 12px;
    margin-left: 5px;
}

.fail-message-inline {
    color: red;
    font-size: 12px;
    margin-left: 5px;
    font-weight: bold;
}

.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #52c41a;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

/* 加载和空数据样式 */
.empty-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #1890ff;
}

/* 日期模态框样式 */
.date-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.date-modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.date-modal h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.date-modal input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    margin-bottom: 16px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 状态相关样式 - projectList.html */
.status-count:hover {
    background-color: rgba(24, 144, 255, 0.1);
}

.status-count.active {
    background-color: rgba(24, 144, 255, 0.2);
    font-weight: bold;
    border: 1px solid #1890ff;
}

.status-details {
    margin-top: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-details h3 {
    margin-top: 0;
    color: #1890ff;
}

.back-to-all-btn {
    padding: 6px 12px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
}

.back-to-all-btn:hover {
    background-color: #40a9ff;
}

/* Project Block Styles - for sub-list layout */
.project-block {
    margin-bottom: 30px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background-color: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.project-block .table-container {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.project-table {
    width: 100%;
    margin-bottom: 0;
}

.project-main-row {
    background-color: white;
}

/* Schedule Styles */
.schedules-main-container {
    margin-top: 30px;
}

.project-schedules-section {
    margin-bottom: 0;
    border: none;
    border-top: 1px solid #e8e8e8;
    border-radius: 0;
    background-color: #fafafa;
    overflow: hidden;
}

.schedules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f0f2f5;
    border-bottom: 1px solid #e8e8e8;
}

.schedules-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.schedule-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.schedule-btn.add-btn {
    background-color: #52c41a;
    color: white;
}

.schedule-btn.add-btn:hover {
    background-color: #389e0d;
}

.schedule-btn.edit-btn {
    background-color: #1890ff;
    color: white;
}

.schedule-btn.edit-btn:hover {
    background-color: #096dd9;
}

.schedules-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.schedules-list {
    padding: 16px 20px;
}

.schedules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
}

.schedule-item {
    background-color: white;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.schedule-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Schedule Line Styles */
.schedule-line {
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.schedule-line:last-child {
    border-bottom: none;
}

.schedule-line:hover {
    background-color: #f5f5f5;
}

.schedule-event {
    font-weight: 500;
    color: #262626;
    min-width: 150px;
}

.schedule-plan {
    color: #1890ff;
    font-size: 14px;
}

.schedule-actual {
    color: #52c41a;
    font-size: 14px;
}

.schedule-memo {
    color: #722ed1;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.schedule-maker {
    color: #8c8c8c;
    font-size: 13px;
}

.schedule-line .edit-btn {
    margin-left: auto;
    padding: 4px 8px;
    font-size: 12px;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.schedule-header h5 {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.schedule-details {
    font-size: 12px;
}

.schedule-row {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
}

.schedule-row:last-child {
    margin-bottom: 0;
}

.schedule-label {
    font-weight: 500;
    color: #666;
    min-width: 70px;
    margin-right: 8px;
}

.schedule-value {
    color: #333;
    flex: 1;
    word-break: break-all;
}

.no-schedules {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.error-message {
    padding: 12px 16px;
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    color: #cf1322;
    text-align: center;
}

/* Responsive adjustments for schedule lines */
@media (max-width: 768px) {
    .schedules-grid {
        grid-template-columns: 1fr;
    }

    .schedule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .schedules-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .schedule-btn.add-btn-small {
        font-size: 10px;
        padding: 2px 6px;
    }

    .schedule-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 15px;
    }

    .schedule-event {
        min-width: auto;
        width: 100%;
    }

    .schedule-plan,
    .schedule-actual,
    .schedule-memo,
    .schedule-maker {
        font-size: 13px;
    }

    .schedule-memo {
        min-width: auto;
        flex: none;
        width: 100%;
    }

    .schedule-line .edit-btn {
        margin-left: 0;
    }
}

/* Small add button for table rows */
.schedule-btn.add-btn-small {
    padding: 4px 8px;
    font-size: 11px;
    background-color: #52c41a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.schedule-btn.add-btn-small:hover {
    background-color: #389e0d;
}