/**
 * 第三方外链离开提示弹窗（PC/M 共用）
 * https://www.miaoshoucdn.com/net/common/third-party-leave-prompt/third-party-leave-prompt.css
 */
.tp-leave-mask,
.tp-leave-mask * {
    box-sizing: border-box;
}
.tp-leave-mask {
    /* 避免页面全局 white-space / word-break 继承导致弹层内文字撑出 */
    white-space: normal;
    word-break: normal;
    word-wrap: normal;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    /* 动态视口，避免滚到底部后 100vh/fixed 与可见区域不一致 */
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2147483000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    isolation: isolate;
    /* 手势交给遮罩，避免底层页面在弹窗打开时仍抢触控 */
    touch-action: none;
}
.tp-leave-mask.tp-leave-show {
    display: flex !important;
}
.tp-leave-dialog {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
    background: #fff;
    border-radius: 8px;
    padding: 20px 16px;
    width: 100%;
    max-width: min(400px, calc(100vw - 32px));
    min-width: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: min(85vh, 100%);
    max-height: min(85dvh, 100%);
    flex-shrink: 0;
    margin: auto;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.tp-leave-dialog.tp-leave-layout-mobile {
    max-width: min(320px, calc(100vw - 32px));
}
.tp-leave-title {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px;
    padding: 0;
    color: #333;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}
.tp-leave-msg {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 8px;
    padding: 0;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}
.tp-leave-url-wrap {
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.tp-leave-url-line {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    overflow: hidden;
}
.tp-leave-url {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: #999;
    white-space: normal;
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.tp-leave-url-toggle {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #1a8cff;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.tp-leave-url-toggle:hover {
    text-decoration: underline;
}
.tp-leave-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}
.tp-leave-btn {
    padding: 10px 22px;
    min-height: 44px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}
.tp-leave-btn.tp-leave-agree {
    background: #1a8cff;
    border-color: #1a8cff;
    color: #fff;
}
/* 广告 iframe 遮罩：只盖住广告位，层级仅高于 iframe */
.tp-leave-ad-cover {
    z-index: 1;
}
