/**
 * 留言表单验证样式
 * 用于美化验证错误提示
 */

/* 错误字段样式 */
.guestbook-validate input.error,
.guestbook-validate select.error,
.guestbook-validate textarea.error {
    border: 2px solid #ff4444 !important;
    /* background-color: #fff5f5 !important; */
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.3) !important;
}

/* 错误信息样式 */
.guestbook-error {
    color: #ff4444 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    padding: 5px 10px !important;
    background-color: #fff5f5 !important;
    border: 1px solid #ffcccc !important;
    border-radius: 4px !important;
    display: block !important;
    position: relative !important;
    /* 新增：避免换行，超出省略号显示 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* 错误信息图标 */
.guestbook-error:before {
    content: "⚠ " !important;
    font-weight: bold !important;
}

/* 成功字段样式 */
.guestbook-validate input.success,
.guestbook-validate select.success,
.guestbook-validate textarea.success {
    border: 2px solid #44ff44 !important;
    background-color: #f5fff5 !important;
}

/* 成功信息样式 */
.guestbook-success {
    color: #44aa44 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    padding: 5px 10px !important;
    background-color: #f5fff5 !important;
    border: 1px solid #ccffcc !important;
    border-radius: 4px !important;
    display: block !important;
}

/* 成功信息图标 */
.guestbook-success:before {
    content: "✓ " !important;
    font-weight: bold !important;
}

/* 清空提示样式 */
.guestbook-clear-message {
    background-color: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    color: #856404 !important;
    padding: 15px !important;
    margin: 15px 0 !important;
    border-radius: 4px !important;
    text-align: center !important;
    font-weight: bold !important;
    position: relative !important;
}

/* 清空提示图标 */
.guestbook-clear-message:before {
    content: "⚠ " !important;
    font-weight: bold !important;
    font-size: 16px !important;
}

/* 验证提示动画 */
.guestbook-error,
.guestbook-success,
.guestbook-clear-message {
    animation: slideIn 0.3s ease-out !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单容器样式 */
.guestbook-validate {
    position: relative;
}

/* 响应式设计 */
@media (max-width: 768px) {

    .guestbook-error,
    .guestbook-success {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {

    .guestbook-validate input.error,
    .guestbook-validate select.error,
    .guestbook-validate textarea.error {
        border: 3px solid #ff0000 !important;
    }

    .guestbook-error {
        background-color: #ffffff !important;
        border: 2px solid #ff0000 !important;
        color: #000000 !important;
    }
}