/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f5f0;
    background-image: linear-gradient(90deg, rgba(248,245,240,0.8) 0%, rgba(240,235,225,0.8) 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 30px;
    margin-top: 40px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #8B4513;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 600;
}

/* 添加待办区域 */
.add-todo {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#todo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0d5c0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#todo-input:focus {
    outline: none;
    border-color: #8B4513;
}

#add-btn {
    padding: 12px 24px;
    background-color: #8B4513;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#add-btn:hover {
    background-color: #6B340F;
}

#add-btn:active {
    transform: scale(0.98);
}

/* 待办列表 */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #faf8f5;
    border: 1px solid #e0d5c0;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: move;
}

.todo-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.todo-item.completed {
    background-color: #f0f5f0;
    opacity: 0.8;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #666;
}

.todo-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.todo-text {
    font-size: 16px;
    color: #333;
    line-height: 1.4;
}

.todo-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.todo-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.todo-image:hover {
    transform: scale(1.05);
}

.upload-btn, .delete-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn {
    background-color: #90EE90;
    color: #2d502d;
}

.upload-btn:hover {
    background-color: #7ccd7c;
}

.delete-btn {
    background-color: #ff6b6b;
    color: white;
}

.delete-btn:hover {
    background-color: #ff5252;
}

/* 模态框样式 */
.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.8);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#modal-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin-top: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .add-todo {
        flex-direction: column;
    }
    
    #add-btn {
        width: 100%;
    }
    
    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .todo-actions {
        align-self: flex-end;
    }
}