/* ============================================================
   ui-toast.css — 轻提示（toast / message）与模态对话框
   ------------------------------------------------------------
   目标：取代浏览器原生 alert/confirm，以及整页提交后的白屏弹框。
   风格：与 admin-ui.css 的 antd 保持一致（#1677ff 主色、8px 圆角）。
   前缀：wbui- ，避免与 bootstrap 2 / admin-ui 的类名冲突。
   ============================================================ */

/* ---------------- 轻提示（顶部居中，不遮罩、不打断操作） ---------------- */
#wbui-toast-root {
    position: fixed;
    top: 20px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 2147483000;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: -webkit-max-content;
    width: -moz-max-content;
    width: max-content;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.wbui-toast {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 10px 16px;
    max-width: 480px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08),
                0 3px 6px -4px rgba(0, 0, 0, .12),
                0 9px 28px 8px rgba(0, 0, 0, .05);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, .85);
    pointer-events: auto;
    -webkit-animation: wbui-toast-in .24s cubic-bezier(.21, 1.02, .73, 1) both;
    animation: wbui-toast-in .24s cubic-bezier(.21, 1.02, .73, 1) both;
}

.wbui-toast.is-out {
    -webkit-animation: wbui-toast-out .2s ease-in forwards;
    animation: wbui-toast-out .2s ease-in forwards;
}

.wbui-toast-icon {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 16px;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    margin-right: 9px;
}

.wbui-toast-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.wbui-toast-text {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.wbui-toast-success .wbui-toast-icon svg { fill: #52c41a; }
.wbui-toast-error   .wbui-toast-icon svg { fill: #ff4d4f; }
.wbui-toast-warning .wbui-toast-icon svg { fill: #faad14; }
.wbui-toast-info    .wbui-toast-icon svg { fill: #1677ff; }
.wbui-toast-loading .wbui-toast-icon svg { fill: #1677ff; }

@-webkit-keyframes wbui-toast-in {
    from { opacity: 0; -webkit-transform: translateY(-14px); }
    to   { opacity: 1; -webkit-transform: translateY(0); }
}
@keyframes wbui-toast-in {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@-webkit-keyframes wbui-toast-out {
    to { opacity: 0; -webkit-transform: translateY(-10px); }
}
@keyframes wbui-toast-out {
    to { opacity: 0; transform: translateY(-10px); }
}

/* ---------------- 模态对话框（替代 alert / confirm） ---------------- */
.wbui-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483001;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .45);
    -webkit-animation: wbui-fade .2s ease both;
    animation: wbui-fade .2s ease both;
}

.wbui-dialog {
    width: 100%;
    max-width: 400px;
    padding: 24px 24px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .16);
    -webkit-animation: wbui-pop .22s cubic-bezier(.21, 1.02, .73, 1) both;
    animation: wbui-pop .22s cubic-bezier(.21, 1.02, .73, 1) both;
}

.wbui-dialog-head {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 12px;
}

.wbui-dialog-icon {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 22px;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-right: 10px;
}

.wbui-dialog-icon svg { display: block; width: 22px; height: 22px; }
.wbui-dialog-success .wbui-dialog-icon svg { fill: #52c41a; }
.wbui-dialog-error   .wbui-dialog-icon svg { fill: #ff4d4f; }
.wbui-dialog-warning .wbui-dialog-icon svg { fill: #faad14; }
.wbui-dialog-info    .wbui-dialog-icon svg { fill: #1677ff; }

.wbui-dialog-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: rgba(0, 0, 0, .88);
}

.wbui-dialog-body {
    font-size: 14px;
    line-height: 1.7;
    color: #595959;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60vh;
    overflow-y: auto;
}

.wbui-dialog-foot {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    margin-top: 22px;
}

.wbui-btn {
    display: inline-block;
    height: 32px;
    margin-left: 8px;
    padding: 0 15px;
    font-family: inherit;
    font-size: 14px;
    line-height: 30px;
    color: rgba(0, 0, 0, .88);
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    -webkit-transition: all .18s;
    transition: all .18s;
}

.wbui-btn:hover { color: #1677ff; border-color: #1677ff; }

.wbui-btn-primary {
    color: #fff;
    background: #1677ff;
    border-color: #1677ff;
}
.wbui-btn-primary:hover { color: #fff; background: #4096ff; border-color: #4096ff; }

.wbui-btn-danger {
    color: #fff;
    background: #ff4d4f;
    border-color: #ff4d4f;
}
.wbui-btn-danger:hover { color: #fff; background: #ff7875; border-color: #ff7875; }

/* ---------------- 提交中的 loading 小圈 ---------------- */
.wbui-spin {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    -webkit-animation: wbui-spin .7s linear infinite;
    animation: wbui-spin .7s linear infinite;
}

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

@-webkit-keyframes wbui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wbui-fade { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes wbui-pop {
    from { opacity: 0; -webkit-transform: translateY(12px) scale(.97); }
    to   { opacity: 1; -webkit-transform: none; }
}
@keyframes wbui-pop {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* 禁用按钮的通用外观，提交期间使用 */
.wbui-disabled,
button[disabled].wbui-disabled {
    cursor: not-allowed;
    opacity: .7;
}
