/* ========= Visual Editor Overlay ========= */
.ve-root, .ve-root * { box-sizing: border-box; }

/* 悬浮触发按钮（类似 DevTools 箭头） */
.ve-trigger {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483600;
  transition: all 0.15s ease;
  user-select: none;
}
.ve-trigger:hover { border-color: #3b82f6; box-shadow: 0 6px 20px rgba(59,130,246,0.2); }
.ve-trigger.active {
  background: #3b82f6;
  border-color: #3b82f6;
}
.ve-trigger.active svg { color: #fff; }
.ve-trigger svg { color: #374151; width: 22px; height: 22px; }

/* 选择模式下，除编辑器自身外的鼠标样式 */
.ve-selecting { cursor: crosshair !important; }

/* 悬停高亮框 */
.ve-hover-box {
  position: fixed;
  pointer-events: none;
  background: rgba(59,130,246,0.12);
  border: 2px solid #3b82f6;
  border-radius: 4px;
  z-index: 2147483601;
  transition: all 0.08s ease;
}

/* 选中高亮框 */
.ve-selected-box {
  position: fixed;
  pointer-events: none;
  background: rgba(16,185,129,0.10);
  border: 2px dashed #10b981;
  border-radius: 4px;
  z-index: 2147483602;
}

/* 悬停 tooltip（显示元素标签信息） */
.ve-hover-tip {
  position: fixed;
  pointer-events: none;
  background: #1f2937;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: -apple-system, sans-serif;
  z-index: 2147483603;
  white-space: nowrap;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= 编辑面板 ========= */
.ve-panel {
  position: fixed;
  top: 76px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 92px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 2147483600;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
.ve-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}
.ve-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ve-panel-title .ve-tag {
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.ve-panel-close {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280;
}
.ve-panel-close:hover { background: #f3f4f6; color: #111827; }

.ve-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.ve-field {
  margin-bottom: 14px;
}
.ve-field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 6px;
}
.ve-field input[type="text"],
.ve-field input[type="number"],
.ve-field input[type="color"],
.ve-field select,
.ve-field textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.ve-field input[type="text"]:focus,
.ve-field input[type="number"]:focus,
.ve-field select:focus,
.ve-field textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.ve-field textarea { min-height: 60px; resize: vertical; }
.ve-field-row { display: flex; gap: 8px; }
.ve-field-row > * { flex: 1; }
.ve-field input[type="color"] { height: 32px; padding: 2px; cursor: pointer; }

.ve-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.ve-btn-primary { background: #3b82f6; color: #fff; }
.ve-btn-primary:hover { background: #2563eb; }
.ve-btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.ve-btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }
.ve-btn-danger { background: #fff; color: #ef4444; border-color: #fecaca; }
.ve-btn-danger:hover { background: #fef2f2; }

.ve-actions {
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 8px;
  background: #fafbfc;
}
.ve-actions .ve-btn { flex: 1; }

/* Toast */
.ve-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 2147483610;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.ve-toast.show { opacity: 1; }

/* 选择器展示区 */
.ve-selector-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: "SF Mono", Menlo, monospace;
  color: #6b7280;
  word-break: break-all;
  margin-bottom: 12px;
  max-height: 40px;
  overflow-y: auto;
}
