/* =====================================================
   Dialog & Toast 组件样式
   ===================================================== */

/* 遮罩层 */
.z-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.z-overlay.is-open {
    opacity: 1;
}

/* 弹窗卡片 */
.z-dialog {
    background: #fff;
    border-radius: var(--admin-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
    width: 360px;
    max-width: calc(100vw - 40px);
    padding: 28px 28px 22px;
    transform: scale(0.9) translateY(8px);
    transition: transform 0.22s cubic-bezier(.34,1.4,.64,1), opacity 0.22s ease;
    opacity: 0;
    position: relative;
}
.z-overlay.is-open .z-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 图标区 */
.z-dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
}
.z-dialog-icon.icon-confirm { background: #fff1f0; color: #ef4444; }
.z-dialog-icon.icon-info    { background: #eff6ff; color: #3b82f6; }
.z-dialog-icon.icon-success { background: #f0fdf4; color: #22c55e; }
.z-dialog-icon.icon-warning { background: #fffbeb; color: #f59e0b; }

/* 标题 & 消息 */
.z-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.4;
}
.z-dialog-msg {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* 按钮区 */
.z-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.z-btn {
    flex: 1;
    max-width: 140px;
    height: 38px;
    border: none;
    border-radius: var(--admin-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    letter-spacing: .3px;
}
.z-btn:active { transform: scale(.97); }
.z-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}
.z-btn-cancel:hover { background: #e2e8f0; }
.z-btn-ok {
    background: var(--admin-brand);
    color: #fff;
}
.z-btn-ok:hover { background: var(--admin-brand-strong); }
.z-btn-danger {
    background: #ef4444;
    color: #fff;
}
.z-btn-danger:hover { background: #dc2626; }

/* =====================================================
   Toast 轻提示
   ===================================================== */
.z-toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.z-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 420px;
    padding: 12px 18px;
    border-radius: var(--admin-radius);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-12px) scale(.96);
    transition: opacity .2s ease, transform .2s cubic-bezier(.34,1.4,.64,1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.z-toast.is-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.z-toast.is-hide {
    opacity: 0;
    transform: translateY(-8px) scale(.96);
    transition: opacity .2s ease, transform .2s ease;
}

/* Toast 类型颜色 */
.z-toast-success {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(236, 253, 245, 0.92));
    border-color: rgba(34, 197, 94, 0.18);
    color: #166534;
    box-shadow: 0 16px 34px rgba(34, 197, 94, 0.12);
}
.z-toast-error {
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(254, 226, 226, 0.92));
    border-color: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
    box-shadow: 0 16px 34px rgba(239, 68, 68, 0.1);
}
.z-toast-warning {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.92));
    border-color: rgba(245, 158, 11, 0.18);
    color: #b45309;
    box-shadow: 0 16px 34px rgba(245, 158, 11, 0.1);
}
.z-toast-info {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(224, 242, 254, 0.92));
    border-color: rgba(59, 130, 246, 0.16);
    color: var(--admin-brand);
    box-shadow: 0 16px 34px rgba(59, 130, 246, 0.1);
}

/* Toast 图标 */
.z-toast-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
    background: rgba(255, 255, 255, 0.72);
}

/* 底部进度条 */
.z-toast-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(148, 163, 184, 0.28);
    animation: z-toast-countdown linear forwards;
}
.z-toast-success .z-toast-bar { background: rgba(34, 197, 94, 0.24); }
.z-toast-error .z-toast-bar { background: rgba(239, 68, 68, 0.22); }
.z-toast-warning .z-toast-bar { background: rgba(245, 158, 11, 0.24); }
.z-toast-info .z-toast-bar { background: rgba(59, 130, 246, 0.22); }
@keyframes z-toast-countdown {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ── Dialog prompt textarea ── */
.z-dialog-textarea {
    width: 100%;
    min-height: 80px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--admin-radius);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}
.z-dialog-textarea:focus {
    outline: none;
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
