/* =========================================================
   site-edit.css —— 编辑模式 + 弹窗 + 字母图标兜底
   ========================================================= */

/* ---------- 字母图标 ---------- */
.x-card .url-img img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.x-letter-ch {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #04121c;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0;
}
.url-img.x-letter::after {
  content: attr(data-ch);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #04121c;
  font-weight: 800;
  font-size: 18px;
}

/* ---------- 右下角工具条 ---------- */
.x-toolbar {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(17, 24, 33, .92);
  border: 1px solid #223040;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
}
.x-toolbar [data-act="export"],
.x-toolbar [data-act="import"],
.x-toolbar [data-act="reset"] { opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.x-toolbar.on [data-act="export"],
.x-toolbar.on [data-act="import"],
.x-toolbar.on [data-act="reset"] { opacity: 1; pointer-events: auto; }
.x-toolbar [data-act="toggle"] {
  background: #38bdf8;
  color: #04121c;
  font-weight: 700;
}
.x-toolbar.on [data-act="toggle"] { background: #22c55e; }

/* ---------- 小按钮 ---------- */
.x-mini {
  appearance: none;
  border: 1px solid #2a3a4d;
  background: #16202b;
  color: #cfe0f0;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.x-mini:hover { border-color: #38bdf8; color: #38bdf8; }
.x-mini.x-danger:hover { border-color: #ef4444; color: #ef4444; }

/* ---------- 编辑态的装饰 ---------- */
.xnav-root { position: relative; }

.x-editing .x-card {
  outline: 1px dashed rgba(56, 189, 248, .16);
  outline-offset: 3px;
  cursor: grab;
}
.x-editing .x-card:hover { outline-color: rgba(56, 189, 248, .72); }
.x-editing .x-card a { pointer-events: none; }
.x-editing .x-card.x-dragging { opacity: .4; }
.x-editing .row.sortable.x-drop { background: rgba(56, 189, 248, .07); border-radius: 12px; }

.x-del {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #3a4a5f;
  background: #1b2532;
  color: #9fb3c8;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.x-editing .x-card:hover .x-del { opacity: 1; pointer-events: auto; }
.x-del:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
.x-card { position: relative; }

/* 分类标题右边的「⋯」 */
.x-more {
  width: 28px;
  height: 28px;
  margin-left: 10px;
  border-radius: 9px;
  border: 1px solid #2a3a4d;
  background: #16202b;
  color: #9fb3c8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 2px;
}
.x-more:hover { border-color: #38bdf8; color: #38bdf8; }

/* 标签上的小按钮：悬停才出现，不占位置 */
.x-editing .nav-pills li { position: relative; }
.x-editing .nav-pills .nav-link { transition: padding-right .12s ease; }
.x-editing .nav-pills li:hover .nav-link { padding-right: 34px; }
.x-tab-ops {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  z-index: 6;
}
.x-editing .nav-pills li:hover .x-tab-ops { display: inline-flex; }
.x-tab-ops .x-mini {
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1;
  border-radius: 7px;
}

/* 分类操作的浮层菜单 */
.x-menu {
  position: fixed;
  z-index: 9500;
  min-width: 160px;
  padding: 6px;
  border-radius: 12px;
  background: #121a24;
  border: 1px solid #223040;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  display: grid;
  gap: 2px;
}
.x-menu button {
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cfe0f0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.x-menu button:hover { background: #1b2634; }
.x-menu button.x-danger { color: #fca5a5; }
.x-menu button.x-danger:hover { background: #3a1d1f; }
.x-menu .x-sep { height: 1px; background: #1d2836; margin: 4px 2px; }

/* ---------- 弹窗 ---------- */
.x-dlg-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 15, .68);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.x-dlg-mask.on { display: flex; }
.x-dlg {
  width: min(460px, 100%);
  border-radius: 16px;
  background: #121a24;
  border: 1px solid #223040;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  overflow: hidden;
  font-family: inherit;
}
.x-dlg-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1d2836;
}
.x-dlg-title { font-weight: 700; color: #e6edf5; font-size: 15px; }
.x-dlg-x {
  border: 0;
  background: transparent;
  color: #7d92a8;
  font-size: 16px;
  cursor: pointer;
}
.x-dlg-x:hover { color: #e6edf5; }
.x-dlg-bd { padding: 16px 18px; display: grid; gap: 12px; }
.x-dlg-bd label { display: grid; gap: 6px; color: #93a4b8; font-size: 12px; }
.x-dlg-bd textarea.x-in { resize: vertical; min-height: 62px; line-height: 1.5; }
.x-in {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #263447;
  background: #0d141c;
  color: #e6edf5;
  font-size: 13px;
  font-family: inherit;
}
.x-in:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .16); }
.x-dlg-ft {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
}
.x-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #2a3a4d;
  background: #16202b;
  color: #cfe0f0;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.x-btn:hover { border-color: #38bdf8; color: #38bdf8; }
.x-btn-main { background: #38bdf8; border-color: #38bdf8; color: #04121c; font-weight: 700; }
.x-btn-main:hover { background: #7dd3fc; color: #04121c; }

/* ---------- 间距 ---------- */
.x-group { margin-bottom: 38px; }
.x-group > .d-flex.flex-fill:first-child { margin-bottom: 4px; }
.x-group .tab-content { margin-top: 14px !important; }
.x-card .card { transition: border-color .16s ease, transform .16s ease; }
.x-card .card:hover { border-color: rgba(56,189,248,.55); transform: translateY(-2px); }

/* 页面底部留白：不这样的话最后一个分类点不过去（滚到底就停了） */
#xnav { padding-bottom: 55vh; }

/* 往下滚的时候把顶上那条灰边收起来（主题有两条：.navbar 和 .page-header） */
.navbar, .page-header { transition: transform .28s ease; will-change: transform; }
.navbar.x-nav-hidden, .page-header.x-nav-hidden { transform: translateY(-100%); }
