/* ================= 简历设计器样式 ================= */
html, body.ed-body { height: 100%; }
body.ed-body {
  margin: 0; background: #eceff3; overflow: hidden;
  display: flex; flex-direction: column;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 顶栏 ---------- */
.ed-topbar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-bottom: 1px solid #e3e7ee;
  padding: 8px 12px; flex-shrink: 0;
}
.ed-back {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #556; font-size: 20px; flex-shrink: 0;
}
.ed-back:hover { background: #f0f3f8; color: #1a76d2; }
.ed-title-input {
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  padding: 6px 8px; font-size: 15px; font-weight: 600; color: #263; min-width: 60px;
  flex: 0 1 260px; outline: none;
}
.ed-title-input:hover, .ed-title-input:focus { border-color: #d7dee8; background: #fff; }
.ed-status { font-size: 12px; color: #8a94a6; white-space: nowrap; margin-left: 4px; }
.ed-status.dirty { color: #d9822b; }
.ed-status.saving { color: #1a76d2; }
.ed-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.ed-btn {
  border: 1px solid #d7dee8; background: #fff; color: #455; border-radius: 8px;
  height: 36px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; white-space: nowrap;
}
.ed-btn:hover { border-color: #1a76d2; color: #1a76d2; }
.ed-btn i { font-size: 17px; }
.ed-btn-primary { background: #1a76d2; border-color: #1a76d2; color: #fff; }
.ed-btn-primary:hover { background: #1565b7; color: #fff; }
.ed-btn-success { background: #32b67a; border-color: #32b67a; color: #fff; }
.ed-btn-success:hover { background: #28a06a; color: #fff; }
.ed-btn-mode.on { background: #6f42c1; border-color: #6f42c1; color: #fff; }

/* ---------- 工具栏 ---------- */
.ed-toolbar {
  display: flex; align-items: center; gap: 2px; background: #fff;
  border-bottom: 1px solid #e3e7ee; padding: 5px 10px;
  overflow-x: auto; overflow-y: hidden; flex-shrink: 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.ed-toolbar::-webkit-scrollbar { height: 3px; }
.ed-sel {
  border: 1px solid #d7dee8; border-radius: 6px; height: 32px; background: #fff;
  font-size: 12.5px; color: #455; padding: 0 4px; flex-shrink: 0; max-width: 110px;
}
.ed-tb {
  min-width: 34px; height: 32px; border: none; background: transparent; color: #556;
  border-radius: 6px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; position: relative; padding: 0 4px;
}
.ed-tb:hover { background: #eef2f7; }
.ed-tb.on { background: #d9e8fb; color: #1a76d2; }
.ed-tb input[type=color] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: none; padding: 0;
}
.ed-sep { width: 1px; height: 20px; background: #e0e5ec; margin: 0 4px; flex-shrink: 0; }
.ed-tip { font-size: 11.5px; color: #aab3c0; white-space: nowrap; margin-left: 8px; flex-shrink: 0; }

/* ---------- 画布与页面 ---------- */
.ed-canvas {
  flex: 1; overflow: auto; position: relative;
  padding: 26px 0 60px;
}
.ed-canvas.dragover::after {
  content: "松手插入图片"; position: absolute; inset: 10px; z-index: 50;
  border: 3px dashed #1a76d2; border-radius: 12px; background: rgba(26,118,210,.06);
  display: flex; align-items: center; justify-content: center;
  color: #1a76d2; font-size: 18px; font-weight: 600; pointer-events: none;
}
.ed-scaler { margin: 0 auto; width: max-content; transform-origin: top center; }
.ed-page {
  background: #fff; box-shadow: 0 2px 14px rgba(30,50,90,.16);
  outline: none; position: relative;
  font-family: "Times New Roman", "宋体", serif;
}
.ed-page.editable { cursor: text; }
.ed-page img { max-width: 100%; }
.ed-page [contenteditable] :focus { outline: none; }

/* 排版模式下的块视觉 */
body.mode-layout .ed-page { cursor: default; }
body.mode-layout .ed-block-hl { outline: 1.5px dashed rgba(26,118,210,.65); outline-offset: 2px; }
body.mode-layout .ed-block-sel { outline: 2px solid #1a76d2; outline-offset: 2px; background: rgba(26,118,210,.05); }

/* 拖放插入指示 */
.ed-drop-mark { outline: 2.5px solid #ff9800 !important; outline-offset: 0; background: rgba(255,152,0,.08); }

/* 图片选中 */
.ed-img-sel { outline: 2.5px solid #1a76d2; outline-offset: 1px; }
.ed-img-handle {
  position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #1a76d2;
  border-radius: 3px; z-index: 60; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ---------- 浮动菜单 ---------- */
.ed-blockbar, .ed-imgbar {
  position: fixed; z-index: 100; display: none;
  background: #2b323d; border-radius: 8px; padding: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
.ed-blockbar button, .ed-imgbar button {
  border: none; background: transparent; color: #cfd8e3; width: 36px; height: 36px;
  border-radius: 6px; font-size: 19px; display: inline-flex; align-items: center; justify-content: center;
}
.ed-blockbar button:hover, .ed-imgbar button:hover { background: #3a4451; color: #fff; }
.ed-imgbar .ed-sep { background: #4a5462; }

/* ---------- 缩放条 ---------- */
.ed-zoombar {
  position: fixed; right: 14px; bottom: 18px; z-index: 90;
  display: flex; align-items: center; gap: 2px;
  background: #2b323d; border-radius: 22px; padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.ed-zbtn {
  border: none; background: transparent; color: #cfd8e3; min-width: 34px; height: 34px;
  border-radius: 18px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; padding: 0 6px; font-size: 15px;
}
.ed-zbtn:hover { background: #3a4451; color: #fff; }
.ed-zlabel { color: #cfd8e3; font-size: 12.5px; min-width: 44px; text-align: center; }

/* ---------- 遮罩 ---------- */
.ed-mask {
  position: fixed; inset: 0; background: rgba(20,26,36,.45); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.ed-mask.show { display: flex; }
.ed-mask-box {
  background: #fff; border-radius: 10px; padding: 18px 26px; color: #455; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.ed-mask-box i { font-size: 20px; color: #1a76d2; }

/* ---------- 顶部轻提示 ---------- */
.ed-toast {
  position: fixed; top: 14px; left: 50%; transform: translate(-50%, -70px);
  background: rgba(38, 48, 60, .92); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 20px; z-index: 3000;
  opacity: 0; transition: all .28s ease; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 82vw; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ed-toast.show { transform: translate(-50%, 0); opacity: 1; }
.ed-toast.ok::before { content: '✓ '; color: #7be38b; }
.ed-toast.err { background: rgba(190, 44, 44, .94); }
.ed-toast.err::before { content: '✕ '; }

/* ---------- 手机端适配 ---------- */
@media (max-width: 767.98px) {
  .ed-topbar { padding: 6px 8px; gap: 6px; flex-wrap: nowrap; }
  .ed-back { width: 34px; height: 34px; }
  .ed-title-input { font-size: 14px; flex: 1 1 80px; min-width: 50px; }
  .ed-status { display: none; }
  .ed-btn { height: 34px; padding: 0 9px; font-size: 12.5px; }
  .ed-btn span { display: none; }       /* 按钮只留图标 */
  .ed-actions .dropdown-toggle span:not(.caret) { display: none; }
  .ed-btn-mode span { display: none; }
  .ed-toolbar { padding: 4px 6px; }
  .ed-tb { min-width: 38px; height: 36px; }   /* 更大触控区 */
  .ed-tip { display: none; }
  .ed-canvas { padding: 14px 0 80px; }
  .ed-zoombar { right: 10px; bottom: 14px; }
  .ed-blockbar, .ed-imgbar { padding: 5px; }
  .ed-blockbar button, .ed-imgbar button { width: 42px; height: 42px; font-size: 22px; }
}
