/* ============================================================
   编辑模式样式（只在 ?edit=密钥 打开时生效，客户看不到）
   ============================================================ */

body.is-editing {
  padding-bottom: 0;
}

/* 图片上的操作按钮：默认隐藏 */
.ed-tool { display: none; }
body.is-editing .ed-tool {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(224, 195, 145, 0.65);
  border-radius: 2px;
  background: rgba(18, 14, 10, 0.88);
  color: #f0dcb6;
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.9);
  transition: background 0.25s, transform 0.25s;
}
body.is-editing .ed-tool:hover {
  background: rgba(176, 141, 87, 0.9);
  color: #221a0f;
  transform: translateY(-1px);
}
body.is-editing .project-card .ed-tool {
  top: 12px;
  left: 12px;
  right: auto;
  bottom: auto;
}
body.is-editing .plan-img-wrap .ed-tool {
  right: 18px;
  bottom: 18px;
}

/* 删除按钮 */
.ed-del { display: none; }
body.is-editing .ed-del {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(224, 195, 145, 0.55);
  border-radius: 50%;
  background: rgba(18, 14, 10, 0.85);
  color: #f0d2c0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: background 0.25s, opacity 0.25s;
}
body.is-editing .ed-del:hover { background: #8a3b3b; opacity: 1; }

/* 可编辑文字 */
body.is-editing [data-ed] {
  outline: 1px dashed rgba(224, 195, 145, 0.4);
  outline-offset: 2px;
  border-radius: 2px;
  cursor: text;
  transition: background 0.2s, outline-color 0.2s;
  min-width: 1em;
}
body.is-editing [data-ed]:hover { background: rgba(176, 141, 87, 0.1); }
body.is-editing [data-ed].is-editing-field {
  outline: 1px solid var(--gold-lt);
  background: rgba(176, 141, 87, 0.14);
}
body.is-editing [data-ed]:empty::before {
  content: '点击输入';
  opacity: 0.45;
  font-size: 0.85em;
  letter-spacing: 0.1em;
}
/* 弹性布局里的可编辑项：贴着文字走，不要拉满整行 */
body.is-editing .nav-brand-txt b,
body.is-editing .card-brand b,
body.is-editing .feature-title,
body.is-editing .contact-item b,
body.is-editing .card-contacts b,
body.is-editing .card-tagline { align-self: flex-start; }
body.is-editing .nav-brand-txt b { margin-bottom: 4px; }
body.is-editing .card-contacts li b[data-ed] { display: block; }

/* 编辑模式下别让图片和遮罩挡住点选 */
body.is-editing .feature-caption { pointer-events: auto; }
body.is-editing .work-zoom { display: none; }
body.is-editing .feature-zoom { display: none; }
body.is-editing .project-desc { max-height: none; opacity: 1; margin-top: 6px; }

/* 项目筛选下拉 */
.ed-select { display: none; }
body.is-editing .ed-select {
  display: block;
  width: 100%;
  max-width: 200px;
  margin-top: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(176, 141, 87, 0.45);
  border-radius: 2px;
  background: #14110e;
  color: #cbb489;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

/* 添加效果图 */
.ed-add { display: none; }
body.is-editing .ed-add {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px dashed rgba(176, 141, 87, 0.6);
  border-radius: 2px;
  background: rgba(176, 141, 87, 0.1);
  color: #e6cd9d;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.25s;
}
body.is-editing .ed-add:hover { background: rgba(176, 141, 87, 0.25); }
.ed-add-hint { display: none; }

/* 底部工具条 */
.ed-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 94vw;
  padding: 10px 14px;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 4px;
  background: rgba(14, 12, 10, 0.95);
  box-shadow: 0 24px 60px -24px #000;
  backdrop-filter: blur(14px);
  color: #d8cbb4;
  font-family: var(--font-sans);
  font-size: 12px;
}
.ed-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgba(176, 141, 87, 0.5);
  color: var(--gold-lt);
  font-size: 10px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.ed-tip { color: #8b8173; font-size: 11px; letter-spacing: 0.05em; white-space: nowrap; }
.ed-state { flex: 0 0 auto; color: #9c8a6c; font-size: 10px; letter-spacing: 0.12em; }
.ed-bar.is-dirty .ed-state { color: #e6a860; }
.ed-btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 2px;
  background: none;
  color: #d8cbb4;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.25s;
  font-family: var(--font-sans);
}
.ed-btn:hover { background: rgba(176, 141, 87, 0.16); }
.ed-btn:disabled { opacity: 0.6; cursor: default; }
.ed-btn-main {
  border-color: transparent;
  background: linear-gradient(118deg, #caa974, #ecd6a9 46%, #b08d57);
  color: #241a0d;
  font-weight: 600;
}
.ed-btn-main:hover { filter: brightness(1.06); background: linear-gradient(118deg, #caa974, #ecd6a9 46%, #b08d57); }

/* 提示条 */
.ed-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 301;
  max-width: 90vw;
  padding: 10px 18px;
  border: 1px solid rgba(176, 141, 87, 0.45);
  border-radius: 3px;
  background: rgba(20, 16, 12, 0.96);
  color: #efe4cc;
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
  transition: 0.3s var(--ease);
}
.ed-toast.is-shown { opacity: 1; visibility: visible; transform: translateX(-50%); }
.ed-toast.is-error { border-color: #a85454; color: #f0c8c8; }

@media (max-width: 900px) {
  .ed-tip { display: none; }
  .ed-bar { gap: 8px; padding: 8px 10px; flex-wrap: wrap; justify-content: center; }
  .ed-btn { padding: 6px 10px; font-size: 11px; }
}

@media (max-width: 640px) {
  .ed-bar {
    gap: 6px;
    padding: 7px 9px;
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: none;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .ed-badge { font-size: 9px; padding: 2px 6px; letter-spacing: 0.12em; }
  .ed-state { display: none; }
  #edReset { display: none; }
  .ed-btn { padding: 6px 10px; font-size: 10.5px; letter-spacing: 0.06em; }
  .ed-toast { top: 84px; bottom: auto; font-size: 11px; padding: 8px 14px; max-width: 88vw; }
}
