/* 德罗宝 可视化编辑器 - 样式（仅 html[data-editor=on] 编辑态生效，公网无影响） */
html[data-editor="on"] [data-ed],
html[data-editor="on"] [data-ed-img],
html[data-editor="on"] [data-ed-raw] img {
  position: relative;
  transition: box-shadow .15s;
}
html[data-editor="on"] [data-ed]:hover,
html[data-editor="on"] [data-ed-img]:hover,
html[data-editor="on"] [data-ed-raw] img:hover {
  outline: 2px dashed #2f9bff;
  outline-offset: 2px;
  cursor: text;
  box-shadow: 0 0 0 4px rgba(47,155,255,.15);
}
html[data-editor="on"] [data-ed-img]:hover,
html[data-editor="on"] [data-ed-raw] img:hover { cursor: pointer; }

/* 编辑中的元素 */
html[data-editor="on"] [data-ed].cms-edit {
  outline: 2px solid #2f9bff;
  background: rgba(47,155,255,.06);
  cursor: text;
  white-space: pre-wrap;
}

/* 铅笔小标（悬停浮现） */
.cms-pen {
  position: absolute;
  top: -14px; left: -4px;
  font-size: 11px;
  line-height: 1;
  background: #1d5bd0; color: #fff;
  padding: 3px 7px; border-radius: 6px;
  z-index: 99999; white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  display: none;
}
html[data-editor="on"] [data-ed]:hover .cms-pen,
html[data-editor="on"] [data-ed-img]:hover .cms-pen,
html[data-editor="on"] [data-ed-raw] img:hover .cms-pen { display: block; }

/* 顶部编辑工具条 */
.cms-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99998;
  background: #141a2e; color: #e8eef7;
  border-bottom: 1px solid #2b3560;
  padding: 7px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.cms-bar b { color: #fff; font-size: 14px; }
.cms-bar .sp { flex: 1; }
.cms-bar button {
  border: 1px solid #3a4a6e; background: #222c44; color: #e8eef7;
  border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.cms-bar button:hover { background: #2c3a5e; }
.cms-bar button.prim { background: #1d5bd0; border-color: #1d5bd0; color: #fff; }
.cms-bar button.ghost { background: transparent; }
.cms-bar select {
  background: #0f1421; color: #e8eef7; border: 1px solid #3a4a6e;
  border-radius: 6px; padding: 4px 8px; font-size: 13px;
}
.cms-status { color: #6f87b3; }
.cms-dirty { color: #ffbe5c; }
.cms-ok { color: #79d08a; }
body { margin-top: 0 }
html[data-editor="on"] body { padding-top: 44px; }

/* 图片替换悬浮按钮 */
.cms-imgbtns {
  position: absolute; z-index: 99999;
  display: flex; gap: 6px;
  background: #000c; border-radius: 8px; padding: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.cms-imgbtns button {
  border: 1px solid #3a4a6e; background: #222c44; color: #fff;
  border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.cms-imgbtns button:hover { background: #2c3a5e; }
.cms-imgbtns button.del { border-color: #a03434; background: #7a2222; }

/* 保存提示 */
.cms-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  background: #122c1f; border: 1px solid #2f6a43; color: #b6e2c2;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}