/* 整体容器 */ .container { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 550px; background-size: cover; position: relative; /* 确保背景图在表单之下 */ } /* 背景图片 */ .background-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; /* 将背景图置于底层 */ } /* 表单容器 */ .form-container { display: flex; flex-direction: column; align-items: center; /* 水平居中 */ justify-content: center; /* 垂直居中,如果需要的话 */ width: 90%; max-width: 400px; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, .1); background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */ } /* 欢迎语 */ .welcome-message { font-size: 20px; text-align: center; /* 文本内部居中 */ margin-bottom: 20px; } /* 输入框 */ .input { width: 90%; margin-bottom: 10px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 16px; } /* 登录按钮 */ .btn { width: 100%; padding: 10px; color: white; background-color: #3EC01E; border: none; border-radius: 5px; transition: background-color .3s; } .btn:hover { background-color: #179414; } /* 错误消息 */ .error { color: red; text-align: center; margin-top: 10px; }