/* 应用内 alert / confirm / prompt（layout、管理后台等未加载 easyclick-shell 的页面） */

.app-confirm-mask,
.app-prompt-mask {
    position: fixed;
    inset: 0;
    z-index: 2147483050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-sizing: border-box;
}

.app-confirm-mask.is-open,
.app-prompt-mask.is-open,
.app-confirm-mask[style*='display: flex'],
.app-prompt-mask[style*='display: flex'] {
    display: flex !important;
}

.app-confirm-panel,
.app-prompt-panel {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 20px 18px 16px;
    background: var(--color-bg-elevated, #fff);
    border-radius: 14px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 0 0 0.5px rgba(60, 60, 67, 0.12);
    color: var(--color-label, #1c1c1e);
    animation: app-dialog-in 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes app-dialog-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.app-confirm-title,
.app-prompt-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: var(--color-label, #1c1c1e);
}

.app-confirm-message,
.app-prompt-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: var(--color-label-secondary, #3a3a3c);
    white-space: pre-wrap;
    word-break: break-word;
}

.app-prompt-panel {
    max-width: 340px;
    text-align: left;
}

.app-prompt-title {
    text-align: center;
}

.app-prompt-message {
    text-align: center;
}

.app-prompt-body {
    margin-bottom: 16px;
}

.app-prompt-field + .app-prompt-field {
    margin-top: 12px;
}

.app-prompt-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-label-secondary, #636366);
}

.app-prompt-input,
.app-prompt-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.2);
    border-radius: 10px;
    font-size: 16px;
    color: var(--color-label, #1c1c1e);
    background: var(--color-bg-grouped, #f2f2f7);
    outline: none;
}

.app-prompt-input:focus,
.app-prompt-textarea:focus {
    border-color: var(--color-tint, #007aff);
    background: var(--color-bg-elevated, #fff);
}

.app-prompt-textarea {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}

.app-confirm-actions {
    display: flex;
    gap: 10px;
}

.app-confirm-btn {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app-confirm-btn:active {
    opacity: 0.85;
}

.app-confirm-cancel {
    background: var(--color-fill-secondary, rgba(118, 118, 128, 0.14));
    color: var(--color-label, #1c1c1e);
}

.app-confirm-ok {
    background: var(--color-tint, #007aff);
    color: #fff;
    font-weight: 600;
}

.app-confirm-ok.is-danger {
    background: #ff3b30;
}

.app-dialog-toast-fallback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 2147483100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.app-dialog-toast-fallback.show {
    opacity: 1;
}

@media (prefers-color-scheme: dark) {
    .app-confirm-panel,
    .app-prompt-panel {
        background: #2c2c2e;
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.45),
            0 0 0 0.5px rgba(255, 255, 255, 0.08);
    }

    .app-confirm-cancel {
        background: rgba(118, 118, 128, 0.24);
    }

    .app-prompt-input,
    .app-prompt-textarea {
        background: #1c1c1e;
        border-color: rgba(255, 255, 255, 0.12);
    }
}
