/* 前台可视化编辑：仅在后台「可视化编辑」页内打开时启用 */
.ce-hover {
    outline: 1px dashed rgba(9, 68, 121, .38) !important;
    outline-offset: 3px;
    cursor: text;
    border-radius: 2px;
    transition: background .15s;
}
.ce-hover:hover { background: rgba(9, 68, 121, .06); }
/* 首屏飘字/滚动大字在正常态是 pointer-events:none，编辑态要放行 */
.ce-hover, .ce-hover * { pointer-events: auto !important; }
.ce-hover { z-index: 60 !important; }
/* 飘动/滚动这类带动画的元素，编辑时暂停动画，否则拖动会被动画拽回去 */
.ce-hover, .ce-hover * { animation-play-state: paused !important; }
/* 飘动小字本体很细，编辑态给点内边距方便抓住 */
.float.ce-hover { padding: 6px 10px !important; background: rgba(9, 68, 121, .06); }
.ce-tag {
    position: absolute;
    opacity: 0;
    top: -20px;
    left: 0;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    background: #094479;
    color: #fff;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    font-family: -apple-system, "PingFang SC", sans-serif;
    z-index: 9;
}
.ce-hover:hover .ce-tag { opacity: 1; }

/* 顶部工具条 */
#ce-bar {
    white-space: nowrap;
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #094479;
    color: #fff;
    font: 13px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 14px 34px -14px rgba(9, 68, 121, .7);
}
#ce-bar b { font-weight: 600; font-size: 13px; }
/* 说明文字不要用半透明白，深蓝底上会糊成灰色 */
#ce-bar span { opacity: 1; color: rgba(255, 255, 255, .92); font-size: 12.5px; }
#ce-bar a {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 4px;
    height: 30px;
    line-height: 28px;
    padding: 0 12px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
}
#ce-bar a:hover { background: rgba(255, 255, 255, .14); }
/* 保存 = 深蓝条上的主按钮，用白底反白，绿底太跳 */
#ce-bar a.ce-saveall {
    background: #fff;
    border-color: #fff;
    color: #094479;
    font-weight: 600;
}
#ce-bar a.ce-saveall:hover { background: #e9f1f9; border-color: #e9f1f9; color: #094479; }
#ce-bar .ce-state { opacity: 1; }
#ce-bar .ce-state.saved { color: #8ff0b8; }
#ce-bar .ce-state.saving { color: #ffd479; }
#ce-bar .ce-state.error { color: #ff9d9d; }

/* 就地编辑时跟在文字旁边的小按钮 */
#ce-inline-actions {
    position: absolute;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid rgba(9, 68, 121, .18);
    border-radius: 8px;
    padding: 5px 7px;
    box-shadow: 0 10px 26px -10px rgba(9, 68, 121, .45);
    font: 12px/1.4 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #6b7783;
}
#ce-inline-actions button {
    font: 12px/1 inherit;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #d6dee6;
    background: #fff;
    color: #3b4650;
    cursor: pointer;
}
#ce-inline-actions button.ok { background: #2f7d4f; border-color: #2f7d4f; color: #fff; }
#ce-inline-actions em { font-style: normal; color: #9aa5b1; }

.ce-saved-flash { outline: 2px solid #35c06b !important; outline-offset: 2px; transition: outline-color .2s; }


/* 编辑弹层 */
#ce-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(12, 30, 48, .42);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
}
#ce-modal.on { display: flex; }
#ce-box {
    width: min(560px, 92vw);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 30px 70px -30px rgba(9, 68, 121, .6);
    overflow: hidden;
    font: 13px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #3b4650;
}
#ce-box header {
    padding: 14px 18px;
    border-bottom: 1px solid #e6eaee;
    font-weight: 600;
    color: #262626;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#ce-box header em { font-style: normal; font-weight: 400; color: #8a939c; font-size: 12px; }
#ce-box .ce-body { padding: 16px 18px; }
#ce-box textarea {
    width: 100%;
    min-height: 92px;
    border: 1px solid #dfe4e8;
    border-radius: 4px;
    padding: 10px 12px;
    font: inherit;
    color: #262626;
    resize: vertical;
    outline: none;
}
#ce-box textarea:focus { border-color: #094479; box-shadow: 0 0 0 3px rgba(9, 68, 121, .08); }
#ce-box .ce-tip { color: #8a939c; font-size: 12px; margin-top: 8px; }
#ce-box footer {
    padding: 12px 18px;
    border-top: 1px solid #e6eaee;
    background: #fcfdfe;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
#ce-box button {
    border: 1px solid #dfe4e8;
    background: #fff;
    color: #3b4650;
    border-radius: 4px;
    padding: 7px 16px;
    font: inherit;
    cursor: pointer;
}
#ce-box button.primary { background: #094479; border-color: #094479; color: #fff; }
#ce-box button.primary:hover { background: #0b5a9c; }
#ce-box .ce-msg { min-height: 18px; font-size: 12px; color: #b8422f; margin-top: 6px; }
#ce-box .ce-msg.ok { color: #2c8a63; }

/* 产品分类浏览：新增按钮 */
.ce-drawer-tools { display: flex; gap: 6px; padding: 8px 12px 4px; flex-wrap: wrap; }
.ce-drawer-btn {
    font: 12px/1 -apple-system, "PingFang SC", sans-serif;
    padding: 7px 10px; border: 1px solid #dbe8f4; background: #fff; color: #094479;
    border-radius: 6px; cursor: pointer;
}
.ce-drawer-btn:hover { background: #f2f7fc; border-color: #b9d3e9; }
.ce-drawer-btn.primary { background: #094479; border-color: #094479; color: #fff; }
.ce-drawer-btn.primary:hover { background: #0b5a9c; }
.ce-drawer-btn.mini { padding: 4px 8px; font-size: 11px; margin: 0 0 6px 34px; }

/* 抽屉品牌列底部的新增品牌按钮 */
.ce-add-brand {
    display: block;
    width: calc(100% - 24px);
    margin: 10px 12px 12px;
    padding: 9px 6px;
    font: 12.5px/1.2 -apple-system, "PingFang SC", sans-serif;
    color: #094479;
    background: #fff;
    border: 1px dashed #b9d3e9;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}
.ce-add-brand:hover { background: #f2f7fc; border-color: #094479; }

/* 品牌列拖拽排序 */
.ce-drag-brand { cursor: grab; }
.ce-drag-brand.ce-dragging { opacity: .45; outline: 1px dashed #094479; }
.ce-drag-tip { padding: 2px 12px 10px; font-size: 11.5px; color: #93a1ae; line-height: 1.4; }

/* 拖拽品牌期间：竖条不响应，避免抽屉被自动弹出 */
body.ce-drag-on #catStrip { pointer-events: none !important; }
body.ce-drag-on .ce-drag-brand { cursor: grabbing; }

/* 品牌行内的「隐藏」按钮 */
.cp-block[data-brand] { position: relative; }
.ce-brand-hide {
    display: none;
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: 11px; line-height: 1; color: #93a1ae; cursor: pointer;
    padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.85);
}
.cp-block[data-brand]:hover .ce-brand-hide { display: block; }
.ce-brand-hide:hover { color: #c0392b; background: #fff; }

/* 已隐藏品牌恢复区 */
.ce-hidden-restore { padding: 0 12px 10px; font-size: 11.5px; color: #93a1ae; line-height: 1.7; }
.ce-hidden-restore .t { display: block; margin-bottom: 2px; }
.ce-restore-btn {
    display: inline-block; margin: 2px 4px 2px 0; padding: 3px 7px;
    font-size: 11.5px; color: #094479; background: #fff;
    border: 1px solid #dbe8f4; border-radius: 4px; cursor: pointer;
}
.ce-restore-btn:hover { background: #f2f7fc; }

/* 已隐藏品牌：留在品牌栏，右侧红色小胶囊（不遮名字） */
.ce-brand-hidden {
    color: #b03a2e !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-right: 8px;
}
.ce-brand-hidden .cp-name {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ce-brand-hidden .cp-name { color: #b03a2e; opacity: .9; }
.ce-brand-hidden .pill {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    flex: 0 0 auto;
    position: static !important; transform: none !important; top: auto !important; right: auto !important;
    padding: 1px 5px; border-radius: 8px; font-size: 10px; line-height: 1.5; white-space: nowrap;
    color: #b03a2e; background: #fdecea; border: 1px solid #f3c4bd; cursor: pointer;
}
.ce-brand-hidden .pill:hover { background: #f9dcd7; }

/* 已隐藏品牌整行可点，恢复显示 */
.ce-brand-hidden { cursor: pointer; }
.ce-brand-hidden:hover { background: rgba(176, 58, 46, .06); }


/* 已隐藏的行不再显示悬停「隐藏」按钮 */
.ce-brand-hidden .ce-brand-hide { display: none !important; }

/* 品牌行右侧：隐藏 / 删除 两个小按钮 */
.cp-block[data-brand]:hover .ce-brand-hide,
.cp-block[data-brand]:hover .ce-brand-del { display: block; }
.ce-brand-del {
    display: none;
    position: absolute; right: 44px; top: 50%; transform: translateY(-50%);
    font-size: 11px; line-height: 1; color: #b03a2e; cursor: pointer;
    padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,.85);
}
.ce-brand-del:hover { background: #fdecea; }
.ce-brand-hidden .ce-brand-del { display: none !important; }

/* 品牌行小工具条：改 / 隐 / 删 */
.ce-brand-tools {
    display: none;
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    gap: 3px; align-items: center;
}
.cp-block[data-brand]:hover .ce-brand-tools { display: flex; }
.ce-brand-btn {
    min-width: 18px; text-align: center;
    font-size: 11px; line-height: 1; color: #6b7c8c; cursor: pointer;
    padding: 3px 4px; border-radius: 4px; background: rgba(255,255,255,.92);
    border: 1px solid #e3eaf1;
}
.ce-brand-btn:hover { color: #094479; border-color: #b9d3e9; }
.ce-brand-btn.danger { color: #b03a2e; border-color: #f0d2cd; }
.ce-brand-btn.danger:hover { background: #fdecea; }
.ce-brand-hidden .ce-brand-tools { display: none !important; }

.ce-drawer-btn.mini.danger { color: #b03a2e; border-color: #f0d2cd; }
.ce-drawer-btn.mini.danger:hover { background: #fdecea; }
.ce-del-group { margin-left: 4px; }

/* 右键菜单 */
.ce-ctx {
    position: fixed; z-index: 99999;
    min-width: 132px; padding: 5px;
    background: #fff; border: 1px solid #e3eaf1; border-radius: 8px;
    box-shadow: 0 16px 40px -20px rgba(9, 68, 121, .38);
}
.ce-ctx-item {
    padding: 8px 12px; font-size: 13px; color: #3b4650; cursor: pointer; border-radius: 5px;
    white-space: nowrap;
}
.ce-ctx-item:hover { background: #f2f7fc; color: #094479; }
.ce-ctx-item.danger { color: #b03a2e; }
.ce-ctx-item.danger:hover { background: #fdecea; color: #b03a2e; }

/* 站内确认框 */
.ce-dlg {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(15, 32, 48, .38);
    display: flex; align-items: center; justify-content: center;
}
.ce-dlg-box {
    width: 380px; max-width: calc(100vw - 40px);
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 30px 70px -30px rgba(9, 68, 121, .55);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ce-dlg-title { padding: 16px 20px 6px; font-size: 15px; font-weight: 600; color: #094479; }
.ce-dlg-text { padding: 0 20px 16px; font-size: 13px; line-height: 1.7; color: #4a5866; }
.ce-dlg-input {
    display: block; width: calc(100% - 40px); margin: 0 20px 16px;
    height: 36px; padding: 4px 10px; font-size: 14px;
    border: 1px solid #dfe6ec; border-radius: 8px; outline: none;
}
.ce-dlg-input:focus { border-color: #094479; box-shadow: 0 0 0 3px rgba(9, 68, 121, .08); }
.ce-dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px; background: #fafcfd; border-top: 1px solid #eef2f6; }
.ce-dlg-btn {
    min-width: 84px; height: 34px; padding: 0 14px; font-size: 13.5px;
    border-radius: 8px; cursor: pointer; border: 1px solid #dfe6ec; background: #fff; color: #3b4650;
}
.ce-dlg-btn:hover { background: #f5f8fb; }
.ce-dlg-btn.ok { background: #094479; border-color: #094479; color: #fff; }
.ce-dlg-btn.ok:hover { background: #0b5a9c; }
.ce-dlg-btn.ok.danger { background: #b03a2e; border-color: #b03a2e; }
.ce-dlg-btn.ok.danger:hover { background: #c0392b; }

/* 轻提示（撤销） */
.ce-toast {
    position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
    z-index: 100002; display: flex; align-items: center; gap: 12px;
    padding: 10px 14px 10px 18px; border-radius: 999px;
    background: rgba(20, 36, 52, .94); color: #fff; font-size: 13px;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5);
}
.ce-toast-act { color: #ffd479; cursor: pointer; text-decoration: underline; }
.ce-toast-x { cursor: pointer; color: #9fb0bf; padding: 0 2px; }

/* 最近删除面板 */
.ce-dlg-box.wide { width: 460px; }
.ce-trash-list { max-height: 320px; overflow: auto; padding: 0 20px 12px; }
.ce-trash-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed #eef2f6;
}
.ce-trash-main b { font-size: 13px; color: #2f3b46; font-weight: 500; }
.ce-trash-main em { display: block; font-style: normal; font-size: 11.5px; color: #93a2b0; margin-top: 2px; }
.ce-dlg-btn.small { min-width: 62px; height: 28px; font-size: 12.5px; }
.ce-trash-link {
    margin-top: 8px; font-size: 12px; color: #7d8d9c; cursor: pointer; text-align: center;
    text-decoration: underline dotted;
}
.ce-trash-link:hover { color: #094479; }

/* 可点的角标（同时支持改文字 + 进后台的块） */
.ce-hover .ce-tag-btn { pointer-events: auto !important; cursor: pointer; }
.ce-hover .ce-tag-btn:hover { background: #0b5a9c !important; }
.ce-tag-btn { pointer-events: auto; }

/* 就地编辑高亮 */
.ce-editing{background:#fffbe6 !important;outline:2px solid #ffd479 !important;outline-offset:2px;border-radius:3px;
  box-shadow:0 0 0 6px rgba(255,212,121,.18);cursor:text !important}

/* 可视化编辑：字号/颜色/显示 */
#ce-box .ce-style{border-top:1px solid #eceff2;margin-top:12px;padding-top:8px}
#ce-box .ce-row{display:flex;align-items:center;gap:10px;margin:8px 0;font-size:12px;color:#4a5764}
#ce-box .ce-row>label{min-width:30px;color:#8a97a4;font-size:12px}
#ce-box .ce-fs{flex:1;height:2px;accent-color:#0e82d1}
#ce-box .ce-fs-v{min-width:22px;text-align:right;color:#262626;font-weight:600}
#ce-box .ce-color{width:34px;height:24px;padding:0;border:1px solid #dfe3e8;border-radius:4px;background:#fff}
#ce-box .ce-swatches{display:flex;gap:6px;margin-left:4px}
#ce-box .ce-swatches i{width:16px;height:16px;border-radius:3px;cursor:pointer;border:1px solid rgba(0,0,0,.1)}
#ce-box .ce-swatches i:hover{outline:2px solid #cfe3f5}
#ce-box .ce-vis{display:flex;align-items:center;gap:6px;color:#4a5764;min-width:0}
#ce-box .ce-fs-reset{margin-left:auto;border:0;background:none;color:#0e82d1;font-size:12px;cursor:pointer}
#ce-box .ce-fs-reset:hover{text-decoration:underline}
#ce-box.ce-style-only .ce-body{min-height:0;padding:6px 0 12px}
#ce-box.ce-style-only .ce-body textarea{display:none}
