/**
 * EmToast —— 公共浮动提示 / 加载遮罩（深色通知卡片）
 *
 * 样式来自安装向导页（install/index.php），抽出来供全站复用。
 * JS 侧见 content/static/js/em-toast.js。
 *
 * 依赖：layui 的 layer 组件，本文件必须排在 layui.css 之后引入
 *       （.layui-layer / .layui-layer-msg 的白底默认值靠后置 + !important 覆盖）。
 *
 * 用法：
 *   EmToast.ok('保存成功');
 *   EmToast.err('目录不可写');
 *   var t = EmToast.loading();  EmToast.close(t);
 */

/* ---------- 卡片外壳：layui 默认是白底方块，统一改成深色通知卡 ---------- */
.em-toast,
.em-loading {
    background: #131a2e !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    box-shadow: 0 20px 44px -20px rgba(15, 23, 41, 0.5);
}

/* 宽度交回给内容自己定。
   layer.msg 会把默认皮肤拼在自定义皮肤前面（skin = "layui-layer-msg em-toast em-toast--ok"），
   于是 .layui-layer-msg 的 min-width:180px 一直挂在我们卡上：短文案（如「订单号已复制」，约 145px）
   右侧会被硬撑出 30 多 px 空白。同优先级 + 后置 + !important 覆盖掉 */
.em-toast {
    min-width: 0 !important;
}

/* ---------- 加载转圈 ---------- */
/* type 1：layui 用图标字体画，颜色直接吃 color */
.em-loading .layui-layer-loading-icon { color: #c7d2fe; }

/* type 2：圈是 .layui-layer-loading-2 的 :before（整圈）/ :after（只留左边一条弧）画的。
   layui 默认 38px 大圈 + 3px #d2d2d2 灰白环 + #1e9fff 蓝弧，压在深色卡片上又重又挤，
   这里收细到 2px、缩到 30px、四周留出边距，颜色换成跟卡片同一调性的浅靛蓝。
   选择器用 .layui-layer-loading.em-loading 压过 layui 的同名规则（提高一级优先级，
   免得本文件被引在 layui.css 之前时被盖掉） */
.layui-layer-loading.em-loading .layui-layer-content { width: 42px; height: 42px; line-height: 42px; }
.layui-layer-loading.em-loading .layui-layer-loading-2 { height: 42px; }

.layui-layer-loading.em-loading .layui-layer-loading-2::before,
.layui-layer-loading.em-loading .layui-layer-loading-2::after {
    width: 30px; height: 30px; margin: -15px 0 0 -15px; border-width: 2px;
}

.layui-layer-loading.em-loading .layui-layer-loading-2::before { border-color: rgba(199, 210, 254, 0.2); }

.layui-layer-loading.em-loading .layui-layer-loading-2::after {
    border-color: transparent;
    border-left-color: #c7d2fe;
}

/* ---------- 提示文字 + 左侧状态图标 ---------- */
/* 默认 info：灰色信息图标；--ok / --err / --warn 只换图标和颜色 */
.em-toast {
    --em-toast-ico-color: #94a3b8;
    --em-toast-ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-5M12 8h.01"/></svg>');
}

.em-toast .layui-layer-content {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 20px 13px 16px !important;
    font-size: 13.5px; line-height: 1.5; text-align: left; color: #fff;
}

/* 图标用 mask 上色，所以 SVG 本身画成黑色即可，颜色交给 --em-toast-ico-color */
.em-toast .layui-layer-content::before {
    content: ""; flex: none; width: 18px; height: 18px;
    background: var(--em-toast-ico-color, #94a3b8);
    -webkit-mask: var(--em-toast-ico) center / contain no-repeat;
    mask: var(--em-toast-ico) center / contain no-repeat;
}

.em-toast--ok {
    --em-toast-ico-color: #34d399;
    --em-toast-ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M21.8 10A10 10 0 1 1 17 3.3"/><path d="m9 11 3 3L22 4"/></svg>');
}

.em-toast--err {
    --em-toast-ico-color: #f87171;
    --em-toast-ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 8v5M12 16.5h.01"/></svg>');
}

.em-toast--warn {
    --em-toast-ico-color: #fbbf24;
    --em-toast-ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"/><path d="M12 9v4M12 17h.01"/></svg>');
}
