/* zsens 原生弹窗 / 提示组件 */
.zsens-ui-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    z-index: 10080;
    animation: zsensUiFadeIn 0.2s ease;
}

.zsens-ui-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    background: var(--card, #0d0d0d);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius, 12px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    z-index: 10081;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zsensUiPopIn 0.24s ease;
}

.zsens-ui-dialog.is-wide {
    width: min(620px, calc(100vw - 32px));
}

.zsens-ui-dialog.is-iframe {
    width: min(620px, calc(100vw - 32px));
    height: min(500px, calc(100vh - 32px));
}

.zsens-ui-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(255, 45, 85, 0.08), transparent);
}

.zsens-ui-dialog__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #fff);
    line-height: 1.4;
}

.zsens-ui-dialog__close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--name, #8f8f8f);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    font-size: 22px;
    line-height: 1;
}

.zsens-ui-dialog__close:hover {
    background: rgba(255, 45, 85, 0.18);
    color: var(--title, #ff2d55);
}

.zsens-ui-dialog__body {
    padding: 18px;
    color: var(--text, #fff);
    font-size: 14px;
    line-height: 1.7;
    overflow: auto;
}

.zsens-ui-dialog__body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.zsens-ui-dialog__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.zsens-ui-btn {
    min-width: 88px;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.zsens-ui-btn:active {
    transform: scale(0.98);
}

.zsens-ui-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text, #fff);
    border-color: rgba(255, 255, 255, 0.08);
}

.zsens-ui-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zsens-ui-btn--primary {
    background: linear-gradient(135deg, #ff2d55, #ff5f7a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.28);
}

.zsens-ui-btn--primary:hover {
    opacity: 0.92;
}

.zsens-ui-toast-wrap {
    position: fixed;
    inset: 0;
    z-index: 10090;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.zsens-ui-toast {
    pointer-events: auto;
    max-width: min(420px, calc(100vw - 40px));
    min-width: 180px;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(19, 21, 24, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text, #fff);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    animation: zsensUiPopIn 0.22s ease;
}

.zsens-ui-toast.has-icon {
    text-align: left;
}

.zsens-ui-toast--success {
    border-color: rgba(82, 196, 26, 0.35);
    background: rgba(24, 40, 28, 0.96);
}

.zsens-ui-toast--error {
    border-color: rgba(255, 45, 85, 0.35);
    background: rgba(40, 18, 24, 0.96);
}

.zsens-ui-toast--warning {
    border-color: rgba(255, 193, 7, 0.35);
    background: rgba(40, 34, 18, 0.96);
}

.zsens-ui-toast--info {
    border-color: rgba(73, 145, 255, 0.35);
    background: rgba(18, 28, 40, 0.96);
}

.zsens-ui-toast__inner {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
}

.zsens-ui-toast__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    color: var(--title, #ff2d55);
}

.zsens-ui-toast__text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    word-break: break-word;
}

.zsens-ui-toast--success .zsens-ui-toast__icon { color: #52c41a; }
.zsens-ui-toast--error .zsens-ui-toast__icon { color: #ff2d55; }
.zsens-ui-toast--warning .zsens-ui-toast__icon { color: #faad14; }
.zsens-ui-toast--info .zsens-ui-toast__icon { color: #4991ff; }

.zsens-ui-loading {
    position: fixed;
    inset: 0;
    z-index: 10085;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.zsens-ui-loading__box {
    pointer-events: auto;
    min-width: 110px;
    padding: 18px 22px;
    border-radius: 12px;
    background: rgba(19, 21, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text, #fff);
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.zsens-ui-loading__spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    border: 3px solid rgba(255, 45, 85, 0.2);
    border-top-color: var(--title, #ff2d55);
    border-radius: 50%;
    animation: zsensUiSpin 0.8s linear infinite;
}

.zsens-ui-tips {
    position: absolute;
    z-index: 10095;
    max-width: 320px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(19, 21, 24, 0.96);
    border: 1px solid rgba(255, 45, 85, 0.35);
    color: var(--text, #fff);
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    animation: zsensUiFadeIn 0.15s ease;
}

.zsens-ui-tips::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(19, 21, 24, 0.96);
    border-left: 1px solid rgba(255, 45, 85, 0.35);
    border-top: 1px solid rgba(255, 45, 85, 0.35);
    transform: rotate(45deg);
}

.zsens-ui-tips[data-placement="top"]::before {
    bottom: -5px;
    left: 16px;
}

.zsens-ui-tips[data-placement="bottom"]::before {
    top: -5px;
    left: 16px;
}

@keyframes zsensUiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zsensUiPopIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zsensUiSpin {
    to { transform: rotate(360deg); }
}

html.light .zsens-ui-dialog,
#htmlRoot.light .zsens-ui-dialog {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 18px 48px rgba(55, 99, 170, 0.12);
}

html.light .zsens-ui-dialog__head,
#htmlRoot.light .zsens-ui-dialog__head {
    background: linear-gradient(180deg, rgba(255, 45, 85, 0.06), transparent);
}

html.light .zsens-ui-toast,
#htmlRoot.light .zsens-ui-toast {
    background: rgba(255, 255, 255, 0.98);
    color: #1d2129;
}
