/* style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #444;
    text-align: center;
}

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

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

input[type="text"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.button-secondary {
    background-color: #6c757d;
}
.button-secondary:hover {
    background-color: #5a6268;
}
.button-danger {
    background-color: #dc3545;
}
.button-danger:hover {
    background-color: #c82333;
}

.task-list, .event-list {
    margin-top: 20px;
}

.task-item, .event-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #007bff;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.task-item .task-info,
.task-item .task-status {
    width: 100%;
    margin: 5px 0;
}

.task-item.uncompleted {
    border-left-color: #dc3545;
}
.event-item.completed, .task-item.completed {
    opacity: 0.8;
    border-left-color: #28a745;
}
.task-item .task-title, .event-item .event-title {
    font-weight: bold;
    width: 100%;
}
.task-item .task-actions, .event-item .event-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* 弹窗样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

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

/* 管理页面布局 */
/* 修改原有的.manage-header样式 */
.manage-header {
    display: flex;
    justify-content: space-between; /* 标题和按钮区域两端对齐 */
    align-items: center; /* 垂直居中对齐 */
    margin-bottom: 20px;
    flex-wrap: wrap; /* 允许换行，适配小屏幕 */
    gap: 15px; /* 标题和按钮区域之间的间距 */
}

/* 为按钮组添加样式 */
.manage-header .button-group {
    display: flex; /* 按钮横向排列 */
    gap: 10px; /* 按钮之间的间距 */
    align-items: center; /* 按钮垂直居中 */
}

/* 保持原有按钮样式，确保一致的尺寸 */
.manage-header button {
    white-space: nowrap; /* 防止按钮文字换行 */
    padding: 10px 16px; /* 统一按钮内边距 */
}

/* 响应式调整 - 小屏幕时按钮组自动换行 */
@media (max-width: 600px) {
    .manage-header {
        flex-direction: column; /* 垂直排列 */
        align-items: flex-start; /* 左对齐 */
    }
    
    .manage-header .button-group {
        width: 100%; /* 占满宽度 */
        justify-content: flex-start; /* 左对齐排列 */
        flex-wrap: wrap; /* 允许按钮换行 */
    }
}
.event-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}
.hidden {
    display: none;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    .task-item, .event-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .task-item .task-actions, .event-item .event-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    .manage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}