/* LeavePopup lead modal — z-index must stay above site header/footer */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../fonts/plus-jakarta-sans-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../../fonts/plus-jakarta-sans-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../fonts/plus-jakarta-sans-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../fonts/plus-jakarta-sans-700.ttf') format('truetype');
}

:root {
    --leavepopup-modal-z: 2147483647;
    --leavepopup-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.leavepopup-modal-mask,
.leavepopup-el-message-wrap,
.leavepopup-float-btn {
    font-family: var(--leavepopup-font);
}

.leavepopup-modal-mask {
    position: fixed;
    inset: 0;
    z-index: var(--leavepopup-modal-z) !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    box-sizing: border-box;
}

.leavepopup-modal-mask.is-open {
    display: flex;
}

.leavepopup-modal {
    position: relative;
    z-index: calc(var(--leavepopup-modal-z) + 1) !important;
    width: 480px;
    max-width: 480px;
    flex-shrink: 0;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    box-sizing: border-box;
}

.leavepopup-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    padding: 0;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}

.leavepopup-modal-close svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    pointer-events: none;
}

.leavepopup-modal-close:hover:not(:disabled) {
    color: #334155;
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.leavepopup-modal-close:disabled,
.leavepopup-modal-close.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* 关闭按钮 - 暂时隐藏 */
.leavepopup-modal-close {
    display: none !important;
}

.leavepopup-modal-inner {
    padding: 36px 32px 32px;
    text-align: center;
}

.leavepopup-modal-title {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.leavepopup-modal-desc {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.65;
    color: #64748b;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.leavepopup-modal-fields {
    text-align: left;
    margin-bottom: 20px;
}

.leavepopup-modal-fields .ds-field {
    margin-bottom: 14px;
}

.leavepopup-modal-fields .ds-field:last-child {
    margin-bottom: 0;
}

.leavepopup-modal-fields .ds-field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.leavepopup-modal-fields .ds-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    flex-shrink: 0;
}

.leavepopup-modal-fields .ds-field-icon svg {
    display: block;
}

.leavepopup-modal-fields input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    font-family: inherit;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.leavepopup-modal-fields input::placeholder {
    color: #94a3b8;
}

.leavepopup-modal-fields input:focus {
    border-color: #69b1ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
}

.leavepopup-modal-fields input.ds-input-error {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.12);
}

.leavepopup-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 24px;
    border: none;
    border-radius: 999px;
    background: #0b1f3f;
    color: #fff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    letter-spacing: 0.02em;
}

.leavepopup-btn-submit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leavepopup-btn-submit-icon svg {
    display: block;
}

.leavepopup-btn-submit:hover:not(:disabled) {
    background: #152a4a;
    transform: translateY(-1px);
}

.leavepopup-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.leavepopup-btn-skip {
    display: block;
    width: auto;
    height: auto;
    margin: 16px auto 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #94a3b8 !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.2s, opacity 0.2s;
    letter-spacing: normal;
}

.leavepopup-btn-skip:hover:not(:disabled) {
    background: transparent;
    transform: none;
    color: #64748b !important;
}

.leavepopup-btn-skip:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

html.leavepopup-modal-open .leavepopup-modal-mask.is-open {
    z-index: 2147483647 !important;
}

/* < 700px锛氬乏鍙冲悇鐣?15px锛屾€诲 calc(100% - 30px) 灞呬腑 */
@media (max-width: 699px) {
    .leavepopup-modal-mask {
        padding: 0 15px;
    }

    .leavepopup-modal {
        width: 100%;
        max-width: none;
    }

    .leavepopup-modal-inner {
        padding: 32px 24px 28px;
    }

    .leavepopup-modal-title {
        font-size: 20px;
    }
}

.leavepopup-modal-mask--forced {
    cursor: default;
}

.leavepopup-modal-mask--forced .leavepopup-modal {
    pointer-events: auto;
}

/* 页面右下角浮动触发按钮 */
.leavepopup-float-btn {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 2147483646;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #096dd9 0%, #1890ff 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.45);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.leavepopup-float-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.5);
}

/* Element Plus 风格：提交加载 */
.leavepopup-modal {
    position: relative;
}

.leavepopup-modal.is-loading .leavepopup-modal-inner {
    pointer-events: none;
    user-select: none;
}

.leavepopup-modal-loading {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
}

.leavepopup-modal-loading.is-active {
    display: flex;
}

.leavepopup-loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid #e4e7ed;
    border-top-color: #409eff;
    border-radius: 50%;
    animation: leavepopup-spin 0.8s linear infinite;
}

.leavepopup-loading-text {
    font-size: 14px;
    color: #606266;
    line-height: 1.4;
}

@keyframes leavepopup-spin {
    to { transform: rotate(360deg); }
}

/* Element Plus 风格：居中消息提示 */
.leavepopup-el-message-wrap {
    position: fixed;
    inset: 0;
    z-index: calc(var(--leavepopup-modal-z) + 2);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 24px;
    box-sizing: border-box;
}

.leavepopup-el-message {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: min(420px, 92vw);
    padding: 15px 19px;
    background: #fff;
    border: 1px solid #ebeef5;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    color: #606266;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.leavepopup-el-message.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.leavepopup-el-message__text {
    flex: 1;
    word-break: break-word;
}

.leavepopup-el-message--rich {
    align-items: flex-start;
    min-width: 320px;
    max-width: min(480px, 92vw);
    padding: 16px 20px;
}

.leavepopup-el-message__body {
    flex: 1;
    min-width: 0;
}

.leavepopup-el-message__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
}

.leavepopup-el-message__desc {
    font-size: 13px;
    line-height: 1.5;
    color: #909399;
    word-break: break-word;
}

.leavepopup-el-message--success.leavepopup-el-message--rich .leavepopup-el-message__title {
    color: #67c23a;
}

.leavepopup-el-message--rich .leavepopup-el-message__icon {
    margin-top: 2px;
}

.leavepopup-el-message__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
}

.leavepopup-el-message__icon--success {
    background: #67c23a;
}

.leavepopup-el-message__icon--success::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.leavepopup-el-message__icon--error {
    background: #f56c6c;
}

.leavepopup-el-message__icon--error::before,
.leavepopup-el-message__icon--error::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 4px;
    width: 2px;
    height: 12px;
    background: #fff;
    border-radius: 1px;
}

.leavepopup-el-message__icon--error::before {
    transform: rotate(45deg);
}

.leavepopup-el-message__icon--error::after {
    transform: rotate(-45deg);
}

.leavepopup-el-message--success .leavepopup-el-message__text {
    color: #67c23a;
}

.leavepopup-el-message--error .leavepopup-el-message__text {
    color: #f56c6c;
}

