/* 日程表模块样式 */

/* 日程表容器样式 */
.calendar-widget {
    margin-bottom: 20px;
}

.schedule-widget {
    flex: 1;
    overflow-y: visible; /* 移除垂直滚动条 */
}

/* 左右分栏布局 */
.modal-split-layout {
    display: flex;
    gap: 20px;
    height: 70vh;
    min-height: 500px;
}

.modal-left-panel {
    flex: 1;
    min-width: 300px;
    border-right: 1px solid #e0e0e0;
    padding-right: 20px;
}

.modal-right-panel {
    flex: 1;
    min-width: 350px;
    padding-left: 20px;
    overflow-y: auto;
}

/* 中文日历样式 */
.calendar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
    width: 100%; /* 确保占满容器宽度 */
}

.calendar-header {
    background: #ffffff;
    color: #333;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-nav button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-nav button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.calendar-grid {
    padding: 20px;
}

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

.calendar-weekday {
    text-align: center;
    padding: 10px 5px;
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    font-size: 14px;
}

.calendar-weekday.weekend {
    color: #e74c3c;
}

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

.calendar-day {
    background: white;
    padding: 4px 4px;
    min-height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0px;
}

.calendar-day:hover {
    background: #f0f8ff;
    border-color: #2196f3;
}

.calendar-day.today {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    font-weight: bold;
}

.calendar-day.other-month {
    color: #ccc;
    background: #f9f9f9;
}

.calendar-day.selected {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.calendar-day.has-event {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.day-number {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0px;
}

.day-lunar {
    font-size: 10px;
    color: #666;
    line-height: 1;
    margin-bottom: 0px;
}

.calendar-day.today .day-lunar {
    color: rgba(255, 255, 255, 0.8);
}

.day-festival {
    font-size: 9px;
    color: #e74c3c;
    font-weight: bold;
    line-height: 1;
    margin-top: 1px;
}

.calendar-day.today .day-festival {
    color: #ffeb3b;
}

.day-events {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
}

.day-event-dot {
    width: 4px;
    height: 4px;
    background: #ff5722;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
}

/* 日程列表样式 */
.schedule-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%; /* 确保占满容器宽度 */
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.schedule-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.schedule-controls label {
    font-size: 14px;
    color: #555;
}

.schedule-controls input[type="number"] {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.schedule-title {
    font-size: 16px;
    font-weight: 600;
}

.view-all-schedules {
    font-size: 13px;
    color: #1e88e5;
    text-decoration: none;
    transition: color 0.3s;
}

.view-all-schedules:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.add-schedule-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.add-schedule-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.schedule-list {
    max-height: none; /* 移除最大高度限制 */
    overflow-y: visible; /* 移除垂直滚动条 */
    padding: 20px;
}

.schedule-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.schedule-footer .view-all-schedules {
    font-size: 14px;
    color: #1e88e5;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-block;
}

.schedule-footer .view-all-schedules:hover {
    color: #0d47a1;
    background: rgba(30, 136, 229, 0.1);
    text-decoration: none;
}

.schedule-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.schedule-info {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin-right: 12px;
    min-width: 60px;
    padding-top: 2px;
}

.schedule-date {
    font-size: 15px;
    color: #666;
    white-space: nowrap;
}

.schedule-time {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

.schedule-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 72px);
}

.schedule-item:hover {
    background: #e3f2fd;
    transform: translateX(2px);
}

.schedule-item.urgent {
    border-left-color: #ffcdd2;
    background: #ffebee;
}

.schedule-item.normal {
    border-left-color: #fff176;
    background: #fffde7;
}

.schedule-item.low {
    background: #f8f9fa;
}

.schedule-item.completed {
    border-left-color: #4caf50;
    opacity: 0.7;
}

.schedule-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.schedule-title-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.3;
}

.schedule-desc {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.3;
}

.schedule-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* 添加日程表单 */
.schedule-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

.schedule-form.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-split-layout {
        flex-direction: column;
        height: auto;
    }
    
    .modal-left-panel,
    .modal-right-panel {
        min-width: auto;
        padding: 0;
        border: none;
    }
    
    .modal-right-panel {
        margin-top: 20px;
    }
    
    .calendar-days {
        gap: 0;
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 4px 2px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-lunar {
        font-size: 9px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 移动端日程列表优化 */
    .schedule-item {
        padding: 8px;
        min-height: 50px;
        gap: 8px;
    }
    
    .schedule-info {
        min-width: 50px;
        margin-right: 10px;
    }
    
    .schedule-date {
        font-size: 12px;
    }
    
    .schedule-time {
        font-size: 11px;
    }
    
    .schedule-title-text {
        font-size: 13px;
    }
    
    .schedule-desc {
        font-size: 11px;
    }
    
    .schedule-content {
        margin-right: 35px; /* 为删除按钮留出更少空间 */
    }
    
    .delete-schedule-btn {
        font-size: 14px;
        padding: 3px;
    }
    
    .schedule-footer {
        padding: 12px 15px;
    }
    
    .schedule-footer .view-all-schedules {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* 导入模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    background-color: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}



/* 分隔线样式 */
.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
    color: #999;
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.divider::after {
    content: attr(data-text);
    background: #fff;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}





.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #999;
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.divider::after {
    content: attr(data-text);
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.new-config-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 0;
}

.btn-link:hover {
    color: #0056b3;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}