body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

#app {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #333;
}

#task-input {
    display: flex;
    margin-bottom: 1rem;
}

#task-description {
    flex-grow: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    opacity: 0.8;
}

#task-input button {
    background-color: rgb(213, 177, 138);
}

.task-item button {
    background-color: #333; /* 黑色 */
}

.delete-task {
    cursor: pointer;
    font-size: 1.2rem;
    color: #777 !important; /* 使用 !important 确保优先级 */
    transition: color 0.3s;
}

.delete-task:hover {
    color: #e74c3c !important; /* 使用 !important 确保优先级 */
}

#task-list-container {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 5rem; /* 添加右侧内边距 */
    padding-left: 5rem; /* 添加左侧内边距 */
}

.task-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}

.task-item h3 {
    margin-top: 0;
}

.task-item p {
    margin: 1rem 0;
}

.task-item .status-failed {
    color: #e74c3c;
}

.task-item .status-expired {
    color: #f39c12;
}

.countdown {
    font-weight: bold;
    color: #e74c3c;
}

/* 修改 .modal 样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000; /* 增加 z-index 值 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

/* 修改 .modal-content 样式 */
.modal-content {
    background-color: #fff;
    margin: 15vh auto; /* 使用 vh 单位，确保在不同设备上都有足够的上边距 */
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative; /* 添加相对定位 */
    z-index: 2001; /* 确保内容在背景之上 */
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.modal-content input[type="date"],
.modal-content input[type="time"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

.modal-buttons {
    text-align: right;
    
}

.modal-buttons button {
    margin-left: -10px;
}

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setup-reminder {
    color: #3498db;
    font-weight: bold;
}

.task-placeholder {
    text-align: center;
    padding: 2rem;
    color: #777;
    font-style: italic;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

@keyframes flash {
    0% { background-color: #fff; }
    50% { background-color: #ff9999; }
    100% { background-color: #fff; }
}

.flashing {
    animation: flash 1s infinite;
}

#reminder-modal .modal-content {
    text-align: center;
}

#reminder-modal button {
    margin-top: 20px;
    background-color: #4CAF50;
}

.countdown-message {
    font-weight: bold;
    margin: 10px 0;
    color: #333;
    text-align: center;
}

.countdown-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.hourglass {
    font-size: 1.2rem;
    margin-right: 10px;
}

.countdown-bar-container {
    flex-grow: 1;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.countdown-bar {
    height: 100%;
    transition: width 0.5s linear;
    background-color: rgb(160, 189, 224) !important;
}

.countdown-bar-not-started {
    background-color: #3498db; /* 蓝色 */
}

.countdown-bar-in-progress {
    background-color: #e74c3c; /* 红色 */
}

/* 为移动设备添加响应式样式 */
@media (max-width: 600px) {
    #app {
        padding: 1rem;
    }

    .task-item {
        padding: 0.5rem;
    }

    .countdown-container {
        flex-direction: column;
        align-items: stretch;
    }

    .hourglass {
        margin-right: 0;
        margin-bottom: 5px;
        text-align: center;
    }

    .countdown-bar-container {
        margin-top: 5px;
    }
}

/* 在文件末尾添加以下样式 */

#time-picker-modal .modal-buttons button:first-child {
    background-color: #4CAF50; /* 绿色 */
}

#time-picker-modal .modal-buttons button:first-child:hover {
    background-color: #45a049; /* 深绿色，用于悬停效果 */
}

.task-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}


.right-button {
    align-self: flex-end;
}
.countdown-message {
    text-align: left;
    margin-bottom: 5px;
}


.left-button {
    align-self: flex-start;
    padding: 5px 5px;
    margin-top: 10px;
}

.right-button {
    align-self: flex-end;
    padding: 5px 5px;
}

.hourglass-gif {
    width: 30px;
    height: 30px;
    margin-left: 10px;
    vertical-align: middle;
}

.task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.task-header h3 {
    margin: 0;
    flex-grow: 1;
}

.tab {
    overflow: visible;
    border: 1px solid #ccc;
    background-color: #e0e0e0; /* 稍微深一点的灰色背景 */
    margin-bottom: 20px;
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tab button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    flex: 1;
    white-space: nowrap;
    color: black; /* 将文字颜色改为黑色 */
    font-weight: bold; /* 可选：使文字更粗，更易读 */
}

.tab button:hover {
    background-color: #ccc;
}

.tab button.active {
    background-color: #bbb; /* 活动标签的背景色稍微深一点 */
    color: #333; /* 活动标签的文字颜色可以稍微深一点 */
}

.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;
    flex: 1; /* 添加这行 */
    overflow-y: auto; /* 添加这行 */
}

#createEvent, #eventList {
    flex: 1;
    overflow-y: auto;
    padding-top: 10px; /* 添加这行 */
    max-width: 600px; /* 限制内容区域的最大宽度 */
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

#app h1 {
    margin-bottom: 20px;
    color: rgb(39, 24, 86);
}

.tab {
    margin-bottom: 20px;
}

#reset-task-description {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

#check-in-modal .modal-content {
    width: 90%;
    max-width: 500px;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box; /* 添加这行 */
}

#check-in-modal h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#end-event-btn {
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#end-event-btn:hover {
    background-color: #c0392b;
}

#upload-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box; /* 添加这行 */
}

.custom-file-upload {
    flex: 1;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
    background-color: #f8f8f8;
    color: #333;
    border-radius: 4px;
    transition: all 0.3s;
    text-align: center;
}

.upload-btn {
    align-self: center;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
    font-size: 16px;
}

.upload-btn:hover {
    background-color: #45a049;
}

#progress-bar-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 15px 0;
    overflow: hidden;
}

#progress-bar {
    width: 0;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 5px;
    transition: width 0.3s;
}

#progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

#uploaded-files {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f0f0f0;
}

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

.file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.file-item i {
    margin-right: 10px;
    color: #666;
    flex-shrink: 0;
}

.file-item button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.file-item button:hover {
    background-color: #c0392b;
}

#selected-files {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    word-break: break-all;
    max-height: 100px;
    overflow-y: auto;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

#drag-drop-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    width: 100%;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    box-sizing: border-box; /* 添加这行 */
}

#drag-drop-area:hover, #drag-drop-area.dragover {
    background-color: #e9e9e9;
    border-color: #999;
}

#drag-drop-area p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

#file-upload {
    display: none;
}

/* 添加媒体查询适应小屏幕设备 */
@media (max-width: 600px) {
    #check-in-modal .modal-content {
        width: 95%;
        padding: 15px;
    }

    #drag-drop-area {
        padding: 15px;
    }

    .upload-btn {
        width: 100%;
    }

    #app {
        width: 95%;
        padding: 1rem;
    }

    .task-item, #createEvent, #eventList {
        max-width: 100%;
    }
}

.show-all-btn {
    display: inline-block; /* 改为 inline-block */
    padding: 5px 5px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: 0;
    background-color: rgb(7, 35, 108);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    min-width: 30px; /* 添加最小宽度 */
    text-align: center; /* 确保文字居中 */
}

.show-all-btn:hover {
    background-color: rgba(7, 35, 108, 0.8);
}

.event-list-content {
    width: 90%;
    max-width: 600px; /* 改为与 #app 相同的最大宽度 */
    height: 80vh;
    padding: 20px;
    overflow-y: auto;
}

.close-btn {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

.modal h2 {
    margin-top: 0;
    padding-bottom: 10px;
    
}

.right-button-container {
    display: flex;
    align-items: center;
    gap: 10px; /* 按钮和图片之间的间距 */
}

.cup-icon {
    width: 32px; /* 从 24px 增加到 32px */
    height: 32px; /* 从 24px 增加到 32px */
    object-fit: contain;
}

.check-in-options {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap; /* 添加这行，实现自动换行 */
}

.check-in-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: calc(45% - 10px); /* 修改这行，考虑间距 */
    min-width: 150px; /* 添加这行，设置最小宽度 */
    margin-bottom: 10px; /* 添加这行，设置按钮之间的垂直间距 */
}

.check-in-btn:hover {
    border-color: #4CAF50;
    background-color: #f8f8f8;
}

.option-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    object-fit: contain;
}

.check-in-btn {
    font-size: 16px;
    color: #333;
}

.url-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.url-input-container input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.url-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.url-content {
    flex-grow: 1;
    margin-right: 10px;
}

.url-link {
    color: #2196F3;
    text-decoration: none;
    word-break: break-all;
}

.url-link:hover {
    text-decoration: underline;
}

.url-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    background-color: #c0392b;
}

#task-input button:hover {
    background-color: rgba(213, 177, 138, 0.8);
}

.left-button {
    background-color: rgb(79, 143, 45) !important;
}

.right-button {
    background-color: rgb(215, 176, 29) !important;
}

/* 修改任务列表的内边距 */
#task-list {
    padding-left: 1em; /* 添加左侧留白，一个字的宽度 */
    padding-right: 1em; /* 添加右侧留白，一个字的宽度 */
}

/* 修改事��表模态框的内容样�� */
.event-list-content {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    padding: 20px;
    overflow-y: auto;
}

/* 修改事件列表标题样式 */
.event-list-content h2 {
    margin: 0;
    padding: 0 1em 10px 1em;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* 添加新样式用于底部线条 */
.event-list-content h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1em;  /* 与内容区域左边界对齐 */
    right: 1em; /* 与内容区域右边界对齐 */
    height: 1px;
    background-color: #ddd;
}

/* 移除原有的边框样式 */
.event-list-content h2 {
    border-bottom: none;
}

#time-picker-modal .modal-content {
    width: 90%;
    max-width: 500px;
    padding: 20px;
}

#time-picker-modal h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px; /* 添加这行，与输入框对齐 */
}

#reset-task-description {
    width: calc(100% - 40px); /* 修改这行，减去左右padding的总和 */
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 20px 20px 20px; /* 修改这行，添加左右margin */
}

#time-picker-modal .modal-buttons {
    text-align: center;
    padding: 0 20px; /* 添加这行，与输入框对齐 */
}

#time-picker-modal .modal-buttons button {
    background-color: #4CAF50;
    margin: 0; /* 移除按钮的外边距 */
}

#time-picker-modal .modal-buttons button:hover {
    background-color: #45a049;
}

.close-btn {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

/* 添加新的容器样式 */
.input-container {
    width: 90%; /* 设置容器宽度为90% */
}
