/* 可视化文字编辑 — 类似 PPT 点选改字 */

.vedit-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.55rem var(--page-pad-x, 24px);
  background: linear-gradient(135deg, #0c4a6e, #0369a1);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  font-size: 15px;
}

.vedit-topbar-title {
  font-weight: 600;
}

.vedit-topbar-hint {
  opacity: 0.9;
  font-size: 14px;
}

.vedit-topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vedit-topbar .vedit-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
}

.vedit-topbar .vedit-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.vedit-topbar .vedit-btn-primary {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #1e293b;
  font-weight: 600;
}

.vedit-topbar .vedit-btn-primary:hover {
  background: #fbbf24;
}

body.vedit-mode {
  padding-top: 56px;
}

body.vedit-mode .portal-content,
body.vedit-mode .home-page,
body.vedit-mode .dashboard-wide {
  position: relative;
  z-index: 1;
}

body.vedit-mode [data-vedit],
body.vedit-mode .vedit-block {
  outline: 2px dashed rgba(14, 165, 233, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color 0.15s, background 0.15s;
  position: relative;
  z-index: 2;
}

body.vedit-mode [data-vedit]:hover,
body.vedit-mode .vedit-block:hover {
  outline-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
}

body.vedit-mode [data-vedit].vedit-active,
body.vedit-mode .vedit-block.vedit-active {
  outline: 2px solid #0284c7;
  background: rgba(14, 165, 233, 0.12);
}

body.vedit-mode [data-vedit]:empty::before {
  content: '点击输入文字…';
  color: #94a3b8;
}

.vedit-float-toolbar {
  position: fixed;
  z-index: 10001;
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.5rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.vedit-float-toolbar.visible {
  display: flex;
}

.vedit-float-toolbar select,
.vedit-float-toolbar input[type="color"] {
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  padding: 0 0.35rem;
}

.vedit-float-toolbar input[type="color"] {
  width: 36px;
  padding: 2px;
  cursor: pointer;
}

.vedit-tb-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.vedit-tb-btn:hover,
.vedit-tb-btn.active {
  background: #e0f2fe;
  border-color: #0ea5e9;
  color: #0369a1;
}

.vedit-tb-sep {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 0.15rem;
}

.vedit-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.vedit-fab .vedit-btn {
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
  text-decoration: none;
}

.vedit-fab .vedit-btn:hover {
  filter: brightness(1.05);
}

.vedit-toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 10002;
  padding: 0.65rem 1rem;
  background: #166534;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.vedit-toast.show {
  opacity: 1;
  transform: translateY(0);
}
