/* ============ 可视化编辑器样式（前端/后台共用） ============ */

/* 浮动工具条 */
.ed-toolbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(90deg, #1f2937, #374151);
  color: #fff; font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transform: translateY(-100%); transition: transform .25s ease;
}
body.editor-on .ed-toolbar { transform: translateY(0); }
.ed-brand { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.ed-hint { margin-left: auto; opacity: .7; font-size: 12px; white-space: nowrap; }
.ed-btn {
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
  transition: background .15s;
}
.ed-btn:hover { background: rgba(255,255,255,.2); }
.ed-primary { background: #2563eb; border-color: #2563eb; }
.ed-primary:hover { background: #1d4ed8; }
.ed-active { background: #f59e0b !important; border-color: #f59e0b !important; }
.ed-warn { background: #b91c1c; border-color: #b91c1c; }

/* 属性面板 */
.ed-panel {
  position: fixed; top: 60px; right: 0; width: 240px; z-index: 9998;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px 0 0 10px;
  box-shadow: -4px 4px 16px rgba(0,0,0,.12);
  padding: 14px; font-size: 13px; color: #111827;
  transform: translateX(110%); transition: transform .25s ease;
}
.ed-panel.ed-show { transform: translateX(0); }
.ed-panel-title { font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.ed-panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ed-panel input[type="color"] { width: 38px; height: 26px; border: none; background: none; cursor: pointer; }
.ed-panel input[type="number"], .ed-panel select { width: 90px; padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 6px; }
.ed-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ed-panel-actions .ed-btn { color: #111827; background: #f3f4f6; border-color: #d1d5db; }
.ed-panel-actions .ed-btn:hover { background: #e5e7eb; }
.ed-path { margin-top: 12px; font-size: 11px; color: #6b7280; word-break: break-all; background: #f9fafb; padding: 6px; border-radius: 6px; }

/* 编辑态高亮 */
body.editor-on [data-ed] { cursor: pointer; outline: 1px dashed transparent; transition: outline-color .15s; }
body.editor-on [data-ed]:hover { outline-color: #93c5fd; }
.ed-selected { outline: 2px solid #2563eb !important; outline-offset: 1px; position: relative; }
.ed-selected::after {
  content: '✎'; position: absolute; top: -10px; right: -10px;
  background: #2563eb; color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 8px;
}
body.editor-on [contenteditable="true"] { outline: 2px solid #f59e0b !important; }

/* 提示 toast */
.ed-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 10000;
}
.ed-toast.ed-show { opacity: 1; transform: translateX(-50%) translateY(0); }
