/*!
 * 龙辉官网 · 前台导航/底部信息就地编辑样式  css/nav-inline-edit.css
 * 只在登录且非只读时由 JS 注入按钮；未登录页面没有任何痕迹。
 */

/* ---------- 区域锚点 ---------- */
.top-bar, .sub-nav, .footer-navbar, .footer-simple { position: relative; }

.lh-navedit-slot {
  position: absolute;
  display: flex;
  align-items: center;
  z-index: 30;
}
.lh-navedit-slot[data-region="top"]   { right: 12px; top: 0; height: 34px; }
.lh-navedit-slot[data-region="main"]  { right: 10px; top: 0; height: 44px; z-index: 120; }
.lh-navedit-slot[data-region="sub"]   { right: 12px; top: 0; height: 36px; }
.lh-navedit-slot[data-region="footer"]{ right: 12px; top: -2px; }
.lh-navedit-slot[data-region="finfo"] { right: 0; top: -4px; }

/* 登录后给右侧内容让位，避免按钮压住“分享/联系我们” */
body.lh-has-navedit .top-bar-right { padding-right: 66px; }
body.lh-has-navedit .main-nav .nav-right-group { padding-right: 62px; }
body.lh-has-navedit .sub-nav-right { padding-right: 64px; }
body.lh-has-navedit .footer-nav-links { padding-right: 64px; }

/* ---------- 编辑按钮 ---------- */
.lh-navedit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid #F37021;
  border-radius: 12px;
  background: #fff;
  color: #F37021;
  font: 12px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
  transition: background .18s, color .18s, border-color .18s;
}
.lh-navedit-btn:hover { background: #F37021; color: #fff; }
.lh-navedit-btn svg { flex: 0 0 auto; }

/* 深色区域：默认浅描边，hover 变橘 */
.lh-navedit-slot[data-region="main"] .lh-navedit-btn,
.lh-navedit-slot[data-region="footer"] .lh-navedit-btn,
.lh-navedit-slot[data-region="finfo"] .lh-navedit-btn {
  background: rgba(255,255,255,.10);
  color: #ffe3d2;
  border-color: rgba(255,255,255,.45);
  box-shadow: none;
}
.lh-navedit-slot[data-region="main"] .lh-navedit-btn:hover,
.lh-navedit-slot[data-region="footer"] .lh-navedit-btn:hover,
.lh-navedit-slot[data-region="finfo"] .lh-navedit-btn:hover {
  background: #F37021; border-color: #F37021; color: #fff;
}

/* 底部导航行 */
.footer-navbar { padding: 0 0 14px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 18px; }
.footer-navbar .wrapper {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0 10px; padding: 0 24px; box-sizing: border-box;
}
.footer-nav-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.footer-nav-links a {
  display: inline-block; margin: 0 8px; font-size: 12px; color: #bbb; text-decoration: none;
  line-height: 1.9; transition: color .18s;
}
.footer-nav-links a:hover { color: #F37021; }

/* ---------- 移动端入口 ---------- */
.lh-navedit-launcher {
  display: none;
  position: fixed; left: 12px; bottom: 78px; z-index: 9998;
  align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 20px;
  border: 1px solid #F37021; background: #fff; color: #F37021;
  font: 12px/1 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer;
}
@media (max-width: 768px) {
  .lh-navedit-launcher { display: inline-flex; }
}

/* ---------- 浮层 ---------- */
.lh-ne-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 100000; opacity: 0; visibility: hidden; transition: opacity .2s;
}
.lh-ne-mask.open { opacity: 1; visibility: visible; }

.lh-ne-panel {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.97);
  width: 720px; max-width: calc(100vw - 40px);
  max-height: 86vh;
  background: #fff; color: #333;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
  z-index: 100001;
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s;
  font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.lh-ne-panel.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.lh-ne-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 10px; border-bottom: 1px solid #f0f0f0;
}
.lh-ne-title { font-size: 15px; font-weight: 600; color: #222; }
.lh-ne-close {
  border: 0; background: none; font-size: 26px; line-height: 1; color: #999;
  cursor: pointer; padding: 0 2px;
}
.lh-ne-close:hover { color: #333; }

.lh-ne-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 9px 14px; border-bottom: 1px solid #f4f4f4; background: #fafafa;
}
.lh-ne-tab {
  border: 1px solid #e2e2e2; background: #fff; color: #666;
  padding: 4px 10px; border-radius: 14px; font-size: 12px; cursor: pointer;
}
.lh-ne-tab.on { background: #F37021; border-color: #F37021; color: #fff; }

.lh-ne-body {
  padding: 14px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 120px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.lh-ne-loading { padding: 28px 0; text-align: center; color: #999; font-size: 13px; }

.lh-ne-group { margin-bottom: 16px; }
.lh-ne-gtitle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #444; margin: 4px 0 8px;
}
.lh-ne-count { font-weight: 400; color: #aaa; font-size: 11px; }
.lh-ne-empty { color: #bbb; font-size: 12px; padding: 6px 0 8px; }

.lh-ne-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.45fr) auto;
  gap: 6px; align-items: center; margin-bottom: 6px;
}
.lh-ne-no { font-size: 11px; color: #bbb; text-align: right; }
.lh-ne-name, .lh-ne-url, .lh-ne-kid-name, .lh-ne-kid-url, .lh-ne-input {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 6px 8px; border: 1px solid #dcdcdc; border-radius: 6px;
  font: 13px/1.4 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #222; background: #fff; outline: none;
}
.lh-ne-name:focus, .lh-ne-url:focus, .lh-ne-kid-name:focus, .lh-ne-kid-url:focus,
.lh-ne-input:focus { border-color: #F37021; box-shadow: 0 0 0 2px rgba(243,112,33,.14); }

.lh-ne-tools { display: inline-flex; gap: 2px; }
.lh-ne-tools button {
  width: 24px; height: 24px; border: 1px solid #e2e2e2; background: #fff;
  border-radius: 5px; color: #666; font-size: 13px; line-height: 1; cursor: pointer;
  padding: 0;
}
.lh-ne-tools button:hover { border-color: #F37021; color: #F37021; }

.lh-ne-add, .lh-ne-addkid {
  margin-top: 6px; padding: 5px 12px; border: 1px dashed #d8d8d8; background: #fff;
  border-radius: 6px; color: #888; font-size: 12px; cursor: pointer;
}
.lh-ne-add:hover, .lh-ne-addkid:hover { border-color: #F37021; color: #F37021; }

.lh-ne-mainrow {
  display: block; border: 1px solid #f0f0f0; background: #fbfbfb;
  border-radius: 8px; padding: 8px; margin-bottom: 8px;
}
.lh-ne-mainline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.lh-ne-mainopts {
  display: flex; align-items: center; gap: 14px; margin-top: 7px;
  font-size: 12px; color: #666;
}
.lh-ne-mainopts label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.lh-ne-mainopts .lh-ne-tools { margin-left: auto; }
.lh-ne-kids { margin: 8px 0 0 20px; }
.lh-ne-kid {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) minmax(0, 1.45fr) 24px;
  gap: 6px; align-items: center; margin-bottom: 4px;
}
.lh-ne-kid button {
  width: 24px; height: 24px; border: 1px solid #e2e2e2; background: #fff;
  border-radius: 5px; color: #999; cursor: pointer; padding: 0;
}
.lh-ne-kid button:hover { border-color: #F37021; color: #F37021; }
.lh-ne-dot { color: #ccc; font-size: 12px; text-align: right; }

.lh-ne-fieldgroup { margin-bottom: 16px; }
.lh-ne-field {
  display: grid; grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px; align-items: center; margin-bottom: 8px;
}
.lh-ne-field label { font-size: 12px; color: #666; text-align: right; }
.lh-ne-field textarea { resize: vertical; font-family: inherit; }
.lh-ne-note { font-size: 11px; color: #a0a0a0; line-height: 1.7; padding: 4px 0 12px; }

.lh-ne-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid #f0f0f0; background: #fcfcfc;
}
.lh-ne-hist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: #999; }
.lh-ne-histitem { display: inline-flex; align-items: center; gap: 4px; }
.lh-ne-undo {
  border: 1px solid #e2e2e2; background: #fff; color: #888; border-radius: 10px;
  padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.lh-ne-undo:hover { border-color: #F37021; color: #F37021; }
.lh-ne-status { font-size: 12px; color: #F37021; margin-left: auto; }
.lh-ne-cancel {
  border: 1px solid #ddd; background: #fff; color: #666; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.lh-ne-cancel:hover { border-color: #bbb; color: #333; }
.lh-ne-save {
  border: 1px solid #F37021; background: #F37021; color: #fff; border-radius: 6px;
  padding: 7px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lh-ne-save:hover { background: #e55f10; border-color: #e55f10; }
.lh-ne-save:disabled { opacity: .6; cursor: default; }

.lh-ne-toast {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%) translateY(6px);
  background: rgba(30,30,30,.9); color: #fff; font-size: 12px; line-height: 1.5;
  padding: 8px 14px; border-radius: 8px; max-width: 86%; text-align: center;
  opacity: 0; visibility: hidden; transition: all .2s; pointer-events: none; z-index: 5;
}
.lh-ne-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.lh-ne-toast.err { background: rgba(190,40,30,.94); }

body.lh-ne-lock { overflow: hidden; }

/* ---------- 手机端：底部上滑面板 ---------- */
@media (max-width: 640px) {
  .lh-ne-panel {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: translateY(8px);
    width: 100%; max-width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .lh-ne-panel.open { transform: translateY(0); }
  .lh-ne-head { padding: 10px 12px 8px; }
  .lh-ne-tabs { padding: 7px 10px; gap: 5px; }
  .lh-ne-body { padding: 10px 12px; }
  .lh-ne-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px; padding: 8px; margin-bottom: 8px;
    border: 1px solid #f0f0f0; border-radius: 8px;
  }
  .lh-ne-row .lh-ne-no { display: none; }
  .lh-ne-row .lh-ne-tools { justify-content: flex-end; }
  .lh-ne-mainline { grid-template-columns: minmax(0, 1fr); }
  .lh-ne-mainopts { gap: 10px; flex-wrap: wrap; }
  .lh-ne-kids { margin-left: 8px; }
  .lh-ne-kid { grid-template-columns: minmax(0, 1fr) 34px; grid-template-rows: auto auto; gap: 4px; padding: 6px 0; }
  .lh-ne-kid .lh-ne-dot { display: none; }
  .lh-ne-kid .lh-ne-kid-name { grid-column: 1; grid-row: 1; }
  .lh-ne-kid .lh-ne-kid-url { grid-column: 1; grid-row: 2; }
  .lh-ne-kid button { grid-column: 2; grid-row: 1 / span 2; width: 34px; height: 100%; min-height: 34px; }
  .lh-ne-field { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .lh-ne-field label { text-align: left; }
  .lh-ne-foot { padding: 8px 10px; gap: 6px; }
  .lh-ne-status { order: 3; width: 100%; margin-left: 0; }
  .lh-ne-cancel, .lh-ne-save { flex: 1 1 auto; }
  .lh-ne-save { order: 2; }
  .lh-ne-cancel { order: 1; }
  .lh-ne-toast { bottom: 70px; }
}
