/* Contact 页（移动 + PC 共用）：安全区、卡片投影、窄屏表单与 Figma 对齐
 * 尺寸单位：rem，基准 1rem = 16px */

/* 避免 main.min.css 中 .page-inner { overflow: hidden } 裁剪自定义下拉层 */
.template-contact .page-inner {
    overflow: visible;
    padding-top: var(--site-header-offset, 3.75rem);
    padding-bottom: 0;
    box-sizing: border-box;
}

.contact-form-container {
    background-size: cover;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(3rem, calc(2rem + env(safe-area-inset-bottom)));
}

/* PC / 平板：白卡片投影（与移动端 Figma 一致） */
@media (min-width: 48rem) {
    .contact-form-container .dialog-container {
        box-shadow: 0.625rem 0.625rem 5rem rgba(45, 6, 116, 0.11);
    }
}

@media (max-width: 47.9375rem) {

    /* Figma: 白卡片 w335、圆角 8px、投影 */
    .contact-form-container .dialog-container {
        border-radius: 0.5rem;
        box-shadow: 0.625rem 0.625rem 5rem rgba(45, 6, 116, 0.11);
        padding: 1.5rem 1.5rem 2rem;
    }

    /* 标题左对齐 24px Ubuntu Bold */
    .contact-form-heading {
        text-align: left;
        font-size: 1.5rem;
        line-height: normal;
        margin-bottom: 1.5rem;
    }

    /* 字段组间距 24px */
    .contact-form-grid {
        gap: 1.5rem;
    }

    .contact-form-row {
        gap: 1.5rem;
    }

    /* Label 与输入区间距 8px */
    .contact-form-container .form-container-item__label {
        margin-bottom: 0.5rem;
    }

    /* 帮助说明：最小高度 80px */
    .contact-form-container textarea.app-input {
        min-height: 5rem;
    }

    /* 全宽提交 48px 高、圆角 8px、Ubuntu 16px */
    .contact-form-footer {
        margin-top: 1.5rem;
        width: 100%;
    }

    .contact-form-submit {
        width: 100%;
        max-width: none;
        min-width: 0;
        height: 3rem;
        padding: 0.8125rem 1rem;
        border-radius: 0.5rem;
        font-family: Ubuntu, "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 1rem;
        font-weight: 400;
        line-height: normal;
    }

    .contact-form-row--captcha {
        flex-direction: column;
    }

    /* 移动端：下拉选项限高可滚动，避免撑满屏幕 */
    .contact-form-container .jump-content__select-dropdown {
        max-height: min(40vh, 12.5rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Region 下拉：与移动端 blog「jump-content__select-custom」一致（PC / 移动共用 contact 页） */
/* 勿用 .jump-content__select-container：main.min 在 ≥992px 对其 display:none */
.contact-form-container .contact-region-select-wrap {
    position: relative;
}

.contact-form-container .jump-content__select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    min-height: 2.75rem;
    border: none;
    border-radius: 0.5rem;
    background-color: #f4f4fe;
    background-image: url("../images/mobile/select-icon.png");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    font-family: Ubuntu, "DIN OT", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
    color: #445268;
}

.contact-form-container .jump-content__select:hover,
.contact-form-container .jump-content__select:focus {
    background-color: #f4f4fe;
}

.contact-form-container .jump-content__select.jump-content__select--native-hidden {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.contact-form-container .jump-content__select-custom {
    position: relative;
}

.contact-form-container .jump-content__select-trigger {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #f4f4fe;
    color: #445268;
    font-family: Ubuntu, "DIN OT", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.contact-form-container .jump-content__select-trigger:focus-visible {
    outline: 0.125rem solid #625df7;
    outline-offset: 0.0625rem;
}

.contact-form-container .jump-content__select-trigger-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    background: url("../images/mobile/select-icon.png") no-repeat center;
    background-size: 1rem 1rem;
    transition: transform 0.2s ease;
}

.contact-form-container .jump-content__select-custom.is-open .jump-content__select-trigger-icon {
    transform: rotate(180deg);
}

.contact-form-container .jump-content__select-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    padding: 0.5rem;
    margin: 0;
    list-style: none;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0.625rem 0.625rem 2.5rem rgba(45, 6, 116, 0.11);
    display: none;
    z-index: 30;
}

.contact-form-container .jump-content__select-custom.is-open .jump-content__select-dropdown {
    display: block;
}

.contact-form-container .jump-content__select-item {
    width: 100%;
    min-height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: #fff;
    color: #445268;
    font-family: Ubuntu, "DIN OT", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
    text-align: left;
    padding: 0.625rem 1rem;
    cursor: pointer;
}

.contact-form-container .jump-content__select-item.is-selected {
    background: #f1f0fc;
    color: #625df7;
}

.contact-form-container .jump-content__select-item:hover {
    background: #f8f8ff;
}

.contact-form-container .jump-content__select option {
    min-height: 2.5rem;
    padding: 0.625rem 1rem;
    background: #fff;
    color: #445268;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.25rem;
}

.contact-form-container .jump-content__select option:checked,
.contact-form-container .jump-content__select option[selected] {
    background: #f1f0fc;
    color: #625df7;
}

/* PC：与其它表单控件（白底 + 描边 + Inter）对齐
 * 使用 .template-contact 提高优先级，并用 inset 描边避免 button 全局样式吃掉 border */
@media (min-width: 48rem) {
    .template-contact .contact-form-container .jump-content__select {
        padding: 0.625rem 2.5rem 0.625rem 1rem !important;
        min-height: 2.5rem;
        border: 0.0625rem solid #dfe2e8 !important;
        border-radius: 0.25rem !important;
        background-color: #ffffff !important;
        color: #354052;
        font-family: Inter, system-ui, sans-serif;
        box-shadow: inset 0 0 0 0.0625rem #dfe2e8 !important;
    }

    .template-contact .contact-form-container .jump-content__select:hover,
    .template-contact .contact-form-container .jump-content__select:focus {
        background-color: #ffffff !important;
    }

    .template-contact .contact-form-container .jump-content__select-trigger {
        min-height: 2.5rem;
        padding: 0.625rem 1.2rem 0.625rem 1rem !important;
        border: none !important;
        border-radius: 0.25rem !important;
        background: #ffffff !important;
        color: #354052;
        font-family: Inter, system-ui, sans-serif;
        box-shadow: inset 0 0 0 0.0625rem #dfe2e8 !important;
        -webkit-appearance: none;
        appearance: none;
    }

    .template-contact .contact-form-container .jump-content__select-trigger:focus-visible {
        outline: none;
        box-shadow: inset 0 0 0 0.0625rem #625df7 !important;
    }

    /* PC：选项列表限高可滚动（区域较多时避免撑出视口） */
    .template-contact .contact-form-container .jump-content__select-dropdown {
        max-height: min(45vh, 18rem);
        overflow-y: auto;
    }

    /* 校验错误：与 .app-input 错误态一致 */
    .template-contact .contact-form-container .form-container-item:has(.form-container-item__rule.is-show) .jump-content__select-custom .jump-content__select-trigger {
        box-shadow: inset 0 0 0 0.0625rem #fb4f57 !important;
    }
}