/* Download gate modal — PC 对齐 Figma 1920；1rem = 100px */

.sam-download-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sam-download-gate[hidden] {
    display: none !important;
}

.sam-download-gate__mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.sam-download-gate__dialog {
    position: relative;
    z-index: 1;
    width: 4.47rem;
    max-width: calc(100% - 0.32rem);
    display: flex;
    flex-direction: column;
    border-radius: 0.04rem;
    overflow: hidden;
    box-shadow: 0 0.02rem 0.04rem rgba(0, 0, 0, 0.25);
}

.sam-download-gate__header {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    height: 0.71rem;
    padding: 0.2rem 0.4rem;
    background: #fff;
    border-bottom: 1px dashed #e5e7eb;
    box-sizing: border-box;
}

.sam-download-gate__title {
    flex: 1;
    margin: 0;
    color: #333;
    font-size: 0.22rem;
    font-weight: 700;
    line-height: 0.308rem;
}

.sam-download-gate__close {
    flex-shrink: 0;
    width: 0.24rem;
    height: 0.24rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sam-download-gate__close svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sam-download-gate__body {
    background: #f5f7fa;
    padding: 0.2rem;
}

.sam-download-gate__card {
    background: #fff;
    border-radius: 0.04rem;
    padding: 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.sam-download-gate__hint {
    margin: 0;
    width: 100%;
    text-align: center;
    color: #333;
    font-size: 0.18rem;
    font-weight: 400;
    line-height: 0.27rem;
}

.sam-download-gate__form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.24rem;
}

.sam-download-gate__field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
}

.sam-download-gate__label {
    color: #1d2633;
    font-size: 0.16rem;
    font-weight: 700;
    line-height: 0.16rem;
}

.sam-download-gate__required {
    color: #ff5858;
}

.sam-download-gate__input {
    width: 100%;
    height: 0.4rem;
    box-sizing: border-box;
    padding: 0 0.16rem;
    border: 1px solid #c1cbd6;
    border-radius: 0.04rem;
    background: #fff;
    color: #1d2633;
    font-size: 0.16rem;
    line-height: 0.224rem;
    outline: none;
}

.sam-download-gate__input::placeholder {
    color: #808899;
}

.sam-download-gate__input:focus {
    border-color: #2f67b3;
}

.sam-download-gate__error {
    width: 100%;
    margin: 0;
    color: #ff5858;
    font-size: 0.14rem;
    line-height: 0.2rem;
    text-align: left;
}

.sam-download-gate__error[hidden] {
    display: none !important;
}

.sam-download-gate__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.16rem 0 0;
    padding: 0.16rem 0.32rem;
    border: 0;
    border-radius: 0.04rem;
    background: #2f67b3;
    color: #fff;
    font-size: 0.16rem;
    font-weight: 700;
    line-height: 0.16rem;
    cursor: pointer;
}

.sam-download-gate__submit:hover {
    opacity: 0.92;
}

.sam-download-gate__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 中间档：>1024 且 ≤1400；整页 rem × (1920/1400) */
@media screen and (max-width: 1400px) {
    .sam-download-gate__dialog {
        width: 6.13rem; /* 4.47 × 1920/1400 */
    }

    .sam-download-gate__header {
        height: 0.97rem;
        gap: 0.27rem;
        padding: 0.27rem 0.55rem;
    }

    .sam-download-gate__title {
        font-size: 0.3rem;
        line-height: 0.42rem;
    }

    .sam-download-gate__close {
        width: 0.33rem;
        height: 0.33rem;
    }

    .sam-download-gate__body {
        padding: 0.27rem;
    }

    .sam-download-gate__card {
        padding: 0.27rem;
        gap: 0.55rem;
        border-radius: 0.05rem;
    }

    .sam-download-gate__hint {
        font-size: 0.25rem;
        line-height: 0.37rem;
    }

    .sam-download-gate__form {
        gap: 0.33rem;
    }

    .sam-download-gate__field {
        gap: 0.08rem;
    }

    .sam-download-gate__label {
        font-size: 0.22rem;
        line-height: 0.22rem;
    }

    .sam-download-gate__input {
        height: 0.55rem;
        padding: 0 0.22rem;
        border-radius: 0.05rem;
        font-size: 0.22rem;
        line-height: 0.31rem;
    }

    .sam-download-gate__error {
        font-size: 0.19rem;
        line-height: 0.27rem;
    }

    .sam-download-gate__submit {
        margin-top: 0.22rem;
        padding: 0.22rem 0.44rem;
        border-radius: 0.05rem;
        font-size: 0.22rem;
        line-height: 0.22rem;
    }
}

/* 移动端 ≤1025：对齐 Figma 375，尺寸 max(rem, px) */
@media screen and (max-width: 1025px) {
    .sam-download-gate {
        padding: max(0.16rem, 16px);
        align-items: flex-start;
        padding-top: max(1.32rem, 132px);
        box-sizing: border-box;
    }

    .sam-download-gate__dialog {
        width: 100%;
        max-width: max(3.43rem, 343px);
        border-radius: max(0.04rem, 4px);
    }

    .sam-download-gate__header {
        height: auto;
        gap: max(0.2rem, 20px);
        padding: max(0.16rem, 16px);
        border-radius: max(0.04rem, 4px) max(0.04rem, 4px) 0 0;
    }

    .sam-download-gate__title {
        font-size: max(0.16rem, 16px);
        line-height: max(0.16rem, 16px);
    }

    .sam-download-gate__close {
        width: max(0.16rem, 16px);
        height: max(0.16rem, 16px);
    }

    .sam-download-gate__body {
        padding: max(0.16rem, 16px);
        border-radius: 0 0 max(0.04rem, 4px) max(0.04rem, 4px);
    }

    .sam-download-gate__card {
        padding: max(0.2rem, 20px);
        gap: max(0.2rem, 20px);
        border-radius: max(0.04rem, 4px);
    }

    .sam-download-gate__hint {
        font-size: max(0.16rem, 16px);
        line-height: max(0.24rem, 24px);
    }

    .sam-download-gate__form {
        gap: max(0.24rem, 24px);
    }

    .sam-download-gate__field {
        gap: max(0.06rem, 6px);
    }

    .sam-download-gate__label {
        font-size: max(0.16rem, 16px);
        line-height: max(0.16rem, 16px);
    }

    .sam-download-gate__input {
        height: max(0.4rem, 40px);
        padding: 0 max(0.16rem, 16px);
        border-radius: max(0.04rem, 4px);
        font-size: max(0.16rem, 16px);
        line-height: max(0.24rem, 24px);
    }

    .sam-download-gate__error {
        font-size: max(0.14rem, 14px);
        line-height: max(0.2rem, 20px);
    }

    .sam-download-gate__submit {
        margin-top: 0;
        height: max(0.48rem, 48px);
        padding: max(0.16rem, 16px) max(0.24rem, 24px);
        border-radius: max(0.04rem, 4px);
        font-size: max(0.16rem, 16px);
        line-height: max(0.16rem, 16px);
        box-sizing: border-box;
    }
}
