/* ===== Request a Sample 弹窗（英文站，首页轮播与产品页共用结构） ===== */
.sample-popup {
    display: none;
    position: fixed;
    /* 跟随 visual viewport：软键盘弹出时 --vvh 收缩，避免被键盘盖住 */
    top: var(--vv-top, 0px);
    left: var(--vv-left, 0px);
    width: var(--vv-w, 100vw);
    height: var(--vvh, 100vh);
    z-index: 1200;
    justify-content: center;
    align-items: center;
}
.sample-popup.show-form {
    display: flex !important;
}
.sample-popup-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.sample-popup-box {
    position: relative;
    width: 540px;
    max-width: calc(100vw - 40px);
    max-height: calc(var(--vvh, 100vh) - 60px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: samplePopupIn .25s ease-out;
}
@keyframes samplePopupIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.sample-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.sample-popup-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #333;
}
.sample-popup-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease-in-out;
    flex-shrink: 0;
}
.sample-popup-close:hover {
    background: #e5e5e5;
    color: #333;
}
.sample-popup-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* ===== 弹窗内：说明区 / 领取方式 / 地址块 ===== */
.sample-intro {
    background: #f4f9fc;
    border: 1px solid #d9ecf6;
    border-left: 3px solid #00a8e8;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.sample-intro-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #16323f;
    margin-bottom: 6px;
}
.sample-intro-list {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}
.sample-intro-list li {
    font-size: 12px;
    line-height: 1.55;
    color: #4c5d67;
    margin-bottom: 3px;
}
.sample-intro-list li strong {
    color: #16323f;
    font-weight: 600;
}
.sample-intro-steps {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #cfe4ef;
    font-size: 12px;
    line-height: 1.55;
    color: #4c5d67;
}
.sample-intro-steps > span {
    display: block;
    font-weight: 600;
    color: #16323f;
    margin-bottom: 4px;
}
.sample-intro-steps ol {
    margin: 0;
    padding-left: 16px;
}
.sample-intro-steps li {
    margin-bottom: 2px;
}
.sample-intro-note {
    margin-top: 6px;
    font-size: 11.5px;
    color: #7b8a93;
}
.sample-intro-note .required {
    color: #e63946;
    font-weight: 700;
}

/* 领取方式：自提 / 邮寄 */
.sample-fulfil {
    display: flex;
    gap: 12px;
}
.sample-fulfil-opt {
    flex: 1;
    position: relative;
    display: block;
    padding: 10px 12px 10px 40px;
    border: 1px solid #d5dbe0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
/* layui 默认会隐藏 radio，这里强制显示 */
.sample-popup .sample-fulfil-opt input[type="radio"] {
    position: absolute;
    left: 14px;
    top: 15px;
    width: 16px;
    height: 16px;
    margin: 0;
    display: block !important;
    opacity: 1;
    -webkit-appearance: radio;
    appearance: auto;
    accent-color: #00a8e8;
}
.sample-fulfil-opt strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #16323f;
}
.sample-fulfil-opt > span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.45;
    color: #6b7a83;
}
.sample-fulfil-opt.is-active {
    border-color: #00a8e8;
    background: #f2fafd;
    box-shadow: 0 0 0 2px rgba(0, 168, 232, .12);
}
.sample-block-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8794a0;
    margin: 2px 0 10px;
}
.sample-pickup-note {
    background: #f7fafb;
    border: 1px dashed #cfd9df;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #4c5d67;
}
.sample-pickup-note strong {
    color: #16323f;
}

.sample-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.sample-form-row:last-child {
    margin-bottom: 0;
}
.sample-form-grp {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.sample-form-grp label {
    font-size: 13px;
    font-weight: 600;
    color: #1f2a30;
}
.sample-form-grp label .required {
    color: #e63946;
    font-weight: 700;
    margin-left: 2px;
}
.sample-form-grp .field-hint {
    font-size: 12px;
    color: #8b979f;
    line-height: 1.4;
}
.sample-form-grp input,
.sample-form-grp select,
.sample-form-grp textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .2s ease-in-out, box-shadow .2s ease-in-out;
}
.sample-form-grp select {
    height: 38px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.sample-form-grp input:focus,
.sample-form-grp select:focus,
.sample-form-grp textarea:focus {
    border-color: #00a8e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, .15);
}
.sample-form-grp input::placeholder,
.sample-form-grp textarea::placeholder {
    color: #999;
}
.sample-form-grp textarea {
    resize: vertical;
    min-height: 80px;
}
.sample-form-grp.has-error label {
    color: #d62828;
}
.sample-form-grp.has-error input,
.sample-form-grp.has-error select,
.sample-form-grp.has-error textarea {
    border-color: #d62828;
    background: #fff7f7;
}
.sample-form-grp .field-error {
    font-size: 12px;
    font-weight: 600;
    color: #d62828;
    margin-top: 2px;
}
.sample-popup-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.sample-submit-btn {
    min-width: 150px;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    background: #00638f;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 99, 143, .25);
    transition: background .2s ease-in-out, transform .2s ease-in-out;
}
.sample-submit-btn:hover {
    background: #004e72;
}
.sample-submit-btn:disabled {
    background: #9bb4c1;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}
body.sample-popup-open {
    overflow: hidden;
}

@media only screen and (max-width: 769px) {
    /* 键盘弹出时容器高度已由 --vvh 收缩；空间不足时从顶部对齐，避免上下同时溢出 */
    .sample-popup {
        align-items: flex-start;
        box-sizing: border-box;
        padding: 8px;
        padding-top: max(8px, env(safe-area-inset-top));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sample-popup-box {
        width: 100%;
        max-width: 100%;
        max-height: calc(var(--vvh, 100vh) - 16px);
        border-radius: 10px;
        /* 空间充足时仍垂直居中，空间不足时贴顶 */
        margin: auto 0;
    }
    /* 16px 可避免 iOS 聚焦输入框时自动放大页面导致错位 */
    .sample-form-grp input,
    .sample-form-grp select,
    .sample-form-grp textarea {
        font-size: 16px;
    }
    .sample-popup-head {
        padding: 14px 16px 12px;
    }
    .sample-popup-head h3 {
        font-size: 18px;
    }
    .sample-popup-body {
        padding: 14px 16px;
    }
    .sample-form-row {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    .sample-popup-foot {
        padding: 12px 16px 16px;
        flex-direction: column;
    }
    .sample-submit-btn {
        width: 100%;
    }
    .sample-intro {
        padding: 12px 14px;
        margin-bottom: 14px;
    }
    .sample-intro-list li,
    .sample-intro-steps {
        font-size: 12px;
    }
    .sample-fulfil {
        flex-direction: column;
        gap: 10px;
    }
    .sample-fulfil-opt {
        padding: 10px 12px 10px 38px;
    }
    .sample-popup .sample-fulfil-opt input[type="radio"] {
        top: 13px;
    }
}
