/* =========================================
   基础设置
   ========================================= */
html {
    position: relative;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden; /* 防止缩放时出现滚动条 */
}

#DemoAndSolution {
    width: 100vw;
    height: 100vh;
    /* 假设背景图路径正确 */
    background: url(../images/demoAndSolution.png) no-repeat;
    background-size: 100vw 100vh;
    /* 使用 flex 布局将表单定位到右侧居中 */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
}

/* =========================================
   表单容器样式
   ========================================= */
.form-container {
    width: 477px;
    height: 620px;
    border-radius: 16px;
    border: 1px solid #FFF;
    background: rgba(255, 255, 255, 0.40);
    padding: 30px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin-right: 230px;
    /* 毛玻璃效果 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* --- 表单头部 --- */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-title {
    font-size: 20px;
    font-weight: bold;
    color: #333333;
    margin: 0 0 10px 0;
}

.form-subtitle {
    font-size: 13px;
    color: #999999;
    margin-top: 20px;
}

/* =========================================
   Element UI 表单样式覆盖 (修复高度和图标对齐)
   ========================================= */
.form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 调整 el-form-item 的底部边距，使其与原设计图间距一致 */
.custom-form-item {
    margin-bottom: 25px;
}

/* 1. 大屏默认高度 60px */
.custom-input.custom-height-60 .el-input__wrapper {
    height: 60px !important;
    min-height: 60px !important;
    background-color: #FFFFFF !important;
    border-radius: 4px;
    box-shadow: none !important;
    border: 1px solid transparent;
    padding-left: 15px;
    transition: all 0.3s;
}

.custom-input.custom-height-60 .el-input__inner {
    height: 60px !important;
    line-height: 60px !important;
    color: #333;
    font-size: 14px;
    border: 0;
}

/* =========================================
   关键：修复图标垂直对齐问题
   ========================================= */
/* 让 prefix 插槽的父容器变成 flex 容器，并垂直居中 */
.custom-input .el-input__prefix {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    left: 15px !important;
}

/* 让 prefix 内部的包裹层也变成 flex 并居中 */
.custom-input .el-input__prefix-inner {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* 图标本身的样式 */
.custom-icon {
    display: block !important; /* 改为 block 避免基线对齐问题 */
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    /* 移除 margin-right，因为 Element UI 自带的 prefix 有间距 */
    /* margin-right: 10px; */
}

/* 根据高度调整输入框内部文字的左内边距，为图标留出空间 */
.custom-input.custom-height-60 .el-input__inner {
    padding-left: 44px !important;
}

/* 2. 聚焦状态 */
.custom-input .el-input__wrapper.is-focus {
    border-color: #3b7cff !important;
    box-shadow: 0 0 0 3px rgba(59, 124, 255, 0.1) !important;
}

/* 您的 SVG 图标路径 */
.icon-user {
    background-image: url("../images/demoandsolution-form-1.svg");
}

.icon-company {
    background-image: url("../images/demoandsolution-form-2.svg");
}

.icon-job {
    background-image: url("../images/demoandsolution-form-3.svg");
}

.icon-phone {
    background-image: url("../images/demoandsolution-form-4.svg");
}

/* --- 提交按钮样式覆盖 --- */
.btn-wrapper {
    margin-top: 10px; /* 与上方输入框拉开距离 */
}

.submit-btn.el-button {
    width: 100%;
    height: 60px;
    background: #3b7cff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
}

.submit-btn.el-button:hover {
    background: #2a66e0;
}

/* --- 隐私协议样式覆盖 --- */
.agreement-item {
    margin-top: 20px;
    margin-bottom: 0;
}

.custom-checkbox {
    width: 100%;
    display: flex;
    justify-content: center;
}

.custom-checkbox .el-checkbox__label {
    font-size: 12px;
    color: #666;
}

.agreement-link {
    color: #000000;
    text-decoration: none;
}

/* 调整 Element UI 错误提示的位置，避免撑大表单 */
.el-form-item__error {
    font-size: 11px;
    padding-top: 2px;
}

/* =========================================
   媒体查询 (响应式适配)
   ========================================= */

/* 1. 中等屏幕 / 笔记本 (1440px - 1680px) */
@media screen and (max-width: 1680px) {
    .form-container {
        margin-right: 120px;
    }
}

/* 2. 小笔记本 / 横屏平板 (1024px - 1440px) -> 高度变为 52px */
@media screen and (max-width: 1440px) {
    .form-container {
        margin-right: 60px;
        width: 440px;
        padding: 25px 35px;
        height: auto;
        min-height: 580px;
    }

    .custom-input.custom-height-60 .el-input__wrapper {
        height: 52px !important;
        min-height: 52px !important;
    }

    .custom-input.custom-height-60 .el-input__inner {
        line-height: 52px !important;
    }

    .custom-icon {
        width: 18px;
        height: 18px;
    }

    .custom-input.custom-height-60 .el-input__inner {
        padding-left: 44px !important;
    }

    .submit-btn.el-button {
        height: 52px;
    }

    .custom-form-item {
        margin-bottom: 20px;
    }
}

/* 3. 平板设备 (768px - 1024px) */
@media screen and (max-width: 1024px) {
    #DemoAndSolution {
        background-size: cover;
        background-position: right center;
    }

    .form-container {
        margin-right: 0;
        width: 420px;
        height: auto;
        min-height: 560px;
        padding: 30px;
    }

    .form-header {
        margin-bottom: 30px;
    }
}

/* 4. 移动端设备 (768px 以下) -> 高度变为 46px */
@media screen and (max-width: 768px) {
    #DemoAndSolution {
        justify-content: center;
        background-position: center center;
    }

    .form-container {
        width: 90%;
        max-width: 400px;
        height: auto;
        min-height: 520px;
        padding: 25px 20px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        margin-right: 0;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .form-title {
        font-size: 18px;
    }

    .form-subtitle {
        margin-top: 10px;
        font-size: 12px;
    }

    .custom-form-item {
        margin-bottom: 16px;
    }

    .custom-input.custom-height-60 .el-input__wrapper {
        height: 46px !important;
        min-height: 46px !important;
        padding-left: 10px;
    }

    .custom-input.custom-height-60 .el-input__inner {
        line-height: 46px !important;
        font-size: 14px;
    }

    .custom-icon {
        width: 16px;
        height: 16px;
    }

    .custom-input.custom-height-60 .el-input__inner {
        padding-left: 44px !important;
    }

    .submit-btn.el-button {
        height: 46px;
        font-size: 15px;
    }

    .agreement-item {
        margin-top: 15px;
    }

    .custom-checkbox .el-checkbox__label {
        font-size: 11px;
    }
}

/* 5. 极窄屏幕 (375px 以下) */
@media screen and (max-width: 375px) {
    .form-container {
        width: 95%;
        padding: 20px 15px;
    }

    .form-title {
        font-size: 16px;
    }

    .custom-checkbox .el-checkbox__label {
        font-size: 10px;
    }
}
