/* inline-edit.css — DINGGU 页面内编辑态样式（仅管理员 ?edit=1 时生效） */
.dg-editing [data-i18n],
.dg-editing [data-i18n-html],
.dg-editing [data-edit-id] {
  outline: 1px dashed #2F6F8F;
  outline-offset: 2px;
  cursor: text;
}
.dg-editing [data-i18n]:hover,
.dg-editing [data-i18n-html]:hover,
.dg-editing [data-edit-id]:hover {
  outline-color: #14253A;
  background: rgba(157, 180, 196, 0.15);
}
.dg-editbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: #14253A;
  color: #F5F3EE;
  padding: 6px 14px;
  border-radius: 0 0 8px 8px;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.dg-editbar a {
  color: #9DB4C4;
  margin-left: 10px;
  text-decoration: underline;
}
.dg-editbar-btn {
  margin-left: 10px;
  background: #2F6F8F;
  color: #F5F3EE;
  border: 0;
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
}
.dg-editbar-btn:hover {
  background: #9DB4C4;
  color: #14253A;
}

/* 编辑态：现有图片可点击替换 */
.dg-editing img {
  outline: 2px dashed #2F6F8F;
  outline-offset: 2px;
  cursor: pointer;
}
.dg-editing img:hover {
  outline-color: #14253A;
  background: rgba(157, 180, 196, 0.15);
}
/* 插入的图片：用不可编辑块级 <div> 包裹，防 contenteditable 内嵌 <img> 光标抖动 */
.dg-upimg {
  display: block;
  max-width: 100%;
  margin: 0.5rem 0;
  outline: 2px dashed #2F6F8F;
  outline-offset: 2px;
}
.dg-upimg img {
  display: block;
  max-width: 100%;
  height: auto;
}
/* 图片对齐：靠左/靠右（文字环绕）/ 居中（默认） */
.dg-upimg--left{float:left;max-width:46%;margin:0.4rem 1rem 0.8rem 0;}
.dg-upimg--right{float:right;max-width:46%;margin:0.4rem 0 0.8rem 1rem;}
.dg-upimg--center{margin:0.6rem auto;max-width:100%;}
.dg-upimg--center img{margin:0 auto;}
@media (max-width:640px){.dg-upimg--left,.dg-upimg--right{max-width:100%;float:none;margin:0.6rem 0;}}

/* 编辑态：产品页 SVG 示意图（<figure class="pdp-figure">）可点击替换 */
.dg-editing .pdp-figure {
  position: relative;
  outline: 2px dashed #2F6F8F;
  outline-offset: 4px;
  cursor: pointer;
}
.dg-editing .pdp-figure::after {
  content: '点击替换图片';
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  background: #14253A;
  color: #F5F3EE;
  padding: 4px 10px;
  border-radius: 4px;
  font: 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.dg-editing .pdp-figure:hover::after {
  opacity: 1;
}
.dg-editing .pdp-figure:hover {
  outline-color: #14253A;
  background: rgba(157, 180, 196, 0.08);
}
/* 已被替换为 <img> 的 figure：避免 img hover 与 figure hover 双重提示 */
.dg-editing .pdp-figure img {
  outline: none;
}
.dg-editing .pdp-figure img:hover {
  outline: none;
  background: transparent;
}
