/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 40px; /* 为错误信息预留足够空间 */
}

/* 输入组样式 - 使用相对定位 */
.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 标签样式 */
label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* 输入框样式 */
input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: #fff;
}

input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 错误状态 */
input.error {
    border-color: #e74c3c;
}

/* 成功状态 */
input.success {
    border-color: #27ae60;
}

/* 绝对定位的消息覆盖层 */
.message-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px; /* 固定高度，防止布局跳动 */
    display: flex;
    align-items: center;
    margin-top: 4px;
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

/* 成功消息样式 */
.success-message {
    color: #27ae60;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

/* 提交按钮样式 */
button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #357abd;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .form-group {
        gap: 35px;
    }
    
    input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}
