/* WebMap 补充样式:在原 Xenon/WebStack 主题之上增量修改 */

html { scroll-behavior: smooth; }

/* 弹窗搜索 */
.wm-search-dialog { max-width: 560px; }
.wm-search-dialog .wm-modal-body { display: flex; flex-direction: column; gap: 10px; }
.wm-search-dialog #search {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e4ecf3;
  border-radius: 4px;
  outline: none;
  font-size: 14px;
  color: #333;
  background: #fff;
}
.wm-search-dialog #search:focus { border-color: #31b0d5; }
.nav-search-hint { font-size: 12px; color: #8b9cad; white-space: nowrap; }

/* 卡片图标占位 */
.logo-fallback {
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  padding: 0;
  background: #eef2f7;
  color: #5a7fa6;
  font-size: 16px;
  font-weight: 600;
}

/* 说明页标记 */
.detail-flag {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 11px;
  line-height: 17px;
  padding: 0 6px;
  border-radius: 3px;
  color: #31708f;
  background: #d9edf7;
}

.box2 { position: relative; }
.empty-result { padding: 60px 0; text-align: center; color: #99a6b3; font-size: 14px; }
.site-card[hidden], .category-row[hidden], .category-title[hidden] { display: none !important; }

/* 说明页 */
.detail-wrapper { padding: 10px 5px 40px; }
.detail-wrapper .panel { border: 1px solid #e4ecf3; box-shadow: none; border-radius: 4px; }
.detail-wrapper .panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e4ecf3;
}
.detail-wrapper .panel-title h3 { margin: 0 0 6px; font-size: 20px; }
.detail-logo { width: 40px; height: 40px; border-radius: 50%; vertical-align: middle; margin-right: 10px; }
.detail-desc { margin: 0 0 6px; font-size: 13px; color: #7b8794; }
.detail-meta { margin: 0; font-size: 12px; color: #99a6b3; }
.detail-meta span { margin-right: 16px; }
.detail-meta i { margin-right: 4px; }
.visit-btn { flex: none; }

/* Markdown 排版 */
.markdown-body { font-size: 14px; line-height: 1.75; color: #333; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { font-weight: 600; line-height: 1.35; }
.markdown-body h1 { font-size: 24px; margin: 24px 0 14px; }
.markdown-body h2 { font-size: 20px; margin: 22px 0 12px; }
.markdown-body h3 { font-size: 17px; margin: 18px 0 10px; }
.markdown-body p { margin: 12px 0; }
.markdown-body a { color: #31708f; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }
.markdown-body blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 3px solid #31b0d5;
  background: #f5f9fc;
  color: #667;
}
.markdown-body code { background: #f4f6f8; padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.markdown-body pre { background: #f6f8fa; padding: 14px; border-radius: 4px; overflow-x: auto; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 4px; display: block; margin: 14px 0; }
.markdown-body video { display: block; max-width: 100%; margin: 14px 0; }
.markdown-body iframe { max-width: 100%; border: 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.markdown-body th, .markdown-body td { border: 1px solid #e4ecf3; padding: 8px 12px; }
.markdown-body hr { border: 0; border-top: 1px solid #e4ecf3; margin: 24px 0; }
.no-content { color: #99a6b3; }

@media (max-width: 767px) {
  .wm-search-dialog { max-width: 92vw; }
}

/* ---------------------------------------------------------------- 多用户与编辑器补充样式 */

.header-register { color: #f0ad4e !important; }

/* 用户导航提示条 */
.nav-owner-bar {
  margin: 18px 20px 0;
  padding: 10px 16px;
  border-radius: 4px;
  background: #f5f9fc;
  border: 1px solid #e4ecf3;
  color: #5b7186;
  font-size: 13px;
}
.nav-owner-bar strong { color: #2a3f54; margin: 0 4px; }
.nav-owner-bar a { float: right; }
.nav-owner-desc { display: inline-block; margin-left: 8px; color: #93a1b0; }
.private-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 3px;
  background: #fcf8e3;
  color: #8a6d3b;
  font-size: 11px;
}

/* 网站卡片：点击 logo/标题直达，右侧小眼睛查看介绍 */
.site-card .xe-widget { position: relative; }
.site-card .xe-user-img, .site-card .xe-user-name { cursor: pointer; }
.site-detail-eye {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  color: #9aa8b6;
  background: rgba(255, 255, 255, .92);
  font-size: 13px;
  z-index: 2;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.site-card:hover .site-detail-eye,
.site-detail-eye:focus { opacity: 1; }
.site-detail-eye:hover { color: #31708f; background: #d9edf7; text-decoration: none; }

/* 登录 / 注册页 */
.wm-auth-body {
  min-height: 100vh;
  background: #f4f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 15px;
}
.wm-auth-box {
  width: 100%;
  max-width: 400px;
  padding: 30px 32px;
  background: #fff;
  border: 1px solid #e4ecf3;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(30, 50, 70, .06);
}
.wm-auth-logo { display: block; width: 120px; margin: 0 auto 18px; }
.wm-auth-box h2 { margin: 0 0 6px; text-align: center; font-size: 21px; color: #2a3f54; }
.wm-auth-sub { margin: 0 0 20px; text-align: center; font-size: 12px; color: #93a1b0; }
.wm-auth-tabs { margin-bottom: 20px; }
.wm-auth-error { padding: 8px 12px; margin-bottom: 12px; border-radius: 3px; background: #f2dede; color: #a94442; font-size: 13px; }
.wm-auth-foot { margin: 18px 0 0; text-align: center; font-size: 13px; }
.wm-auth-foot a { color: #7b8794; }

/* 管理页 */
.wm-manage-body { background: #f4f7fa; min-height: 100vh; }
.wm-manage-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.wm-manage-wrap h3 { margin: 4px 0 4px; color: #2a3f54; }
.wm-manage-tip { color: #93a1b0; font-size: 13px; margin-bottom: 20px; }
.wm-panel { border: 1px solid #e4ecf3; box-shadow: none; border-radius: 4px; margin-bottom: 20px; }
.wm-panel .panel-heading { background: #fbfcfd; border-bottom: 1px solid #e4ecf3; padding: 12px 16px; }
.wm-panel .panel-title { font-size: 15px; color: #2a3f54; margin: 0; }
.wm-panel .panel-body { padding: 18px 16px; }
.wm-form-row { margin-bottom: 14px; align-items: end; }
.wm-form-row label, .wm-panel label { display: block; font-size: 12px; color: #66788a; margin-bottom: 5px; font-weight: 500; }
.wm-form-row .help-block, .wm-panel .help-block { font-size: 11px; color: #9aa8b6; margin: 4px 0 0; }
.wm-switch-line { display: flex !important; align-items: center; gap: 6px; height: 34px; margin: 0 !important; }
.wm-nav-link { margin-left: 12px; font-size: 13px; color: #7b8794; }
.wm-table { margin: 0; font-size: 13px; }
.wm-table th { color: #66788a; font-weight: 500; border-top: 0; }
.wm-table td { vertical-align: middle; }
.wm-auto-logo { font-size: 11px; color: #9aa8b6; }

/* 说明编辑器 */
.wm-editor-body { background: #f4f7fa; min-height: 100vh; }
.wm-editor-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.wm-editor-wrap h3 { color: #2a3f54; margin: 4px 0; }
.wm-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e4ecf3;
  border-radius: 4px;
  margin-bottom: 10px;
}
.wm-mode-switch { display: flex; gap: 4px; margin-right: 8px; padding-right: 14px; border-right: 1px solid #e4ecf3; }
.wm-rich-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.wm-editor-panel { background: #fff; border: 1px solid #e4ecf3; border-radius: 4px; }
.wm-rich-editor {
  min-height: 420px;
  padding: 20px 24px;
  outline: none;
  font-size: 14px;
  line-height: 1.75;
}
.wm-rich-editor:empty:before { content: attr(data-placeholder); color: #a7b3c0; }
.wm-rich-editor img { max-width: 100%; border-radius: 4px; }
.wm-rich-editor video { max-width: 100%; border-radius: 4px; }
.wm-md-editor {
  width: 50%;
  min-height: 420px;
  padding: 18px 20px;
  border: 0;
  border-right: 1px solid #e4ecf3;
  outline: none;
  resize: vertical;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.7;
  float: left;
}
.wm-md-preview { min-height: 420px; padding: 18px 24px; overflow: hidden; }
.wm-editor-panel:after { content: ''; display: block; clear: both; }
.wm-editor-status { margin-top: 10px; min-height: 20px; font-size: 13px; color: #5b9bd5; }

/* 卡片布局：移除底部按钮后收紧高度，避免下方留白过多 */
.site-card .box2 { height: 68px; padding: 10px 12px; margin: 8px 0 0; }
.site-card .xe-comment-entry { position: relative; height: 100%; }
.site-card .xe-comment {
  position: static;
  transform: none;
  margin-left: 50px;
  padding-top: 2px;
}
.site-card .xe-comment-entry img { margin-top: 0; }
#image-file, #video-file { display: none !important; }

/* 导航页弹窗补充样式 */
.wm-nav-modal-error { color: #a94442; font-size: 13px; margin-top: 10px; }
.wm-nav-modal-tip { color: #7b8794; font-size: 12px; margin: 10px 0 0; }
.wm-nav-modal-tip a { color: #31708f; }
.wm-nav-modal-divider { border-top: 1px solid #e4ecf3; margin: 18px 0 14px; }
.wm-logo-row { display: flex; align-items: flex-start; gap: 12px; }
.wm-logo-preview {
  width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain;
  border: 1px solid #e4ecf3; border-radius: 6px; background: #fff; padding: 3px;
}
.wm-logo-inputs { flex: 1; min-width: 0; }
.wm-logo-inputs .form-control { margin-bottom: 6px; }
.wm-logo-inputs .wm-logo-file { padding: 5px 8px; font-size: 12px; }
.wm-nav-modal-footer[hidden] { display: none; }
.wm-site-detail-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.wm-site-detail-head a { font-size: 17px; color: #2a3f54; }
.wm-site-detail-head span { font-size: 12px; color: #9aa8b6; word-break: break-all; }
.wm-site-detail-desc { color: #66788a; font-size: 13px; margin: 0 0 14px; }
.wm-site-detail-content { border-top: 1px solid #eef2f6; padding-top: 14px; }
#wm-modal .wm-rich-editor, #wm-modal .wm-md-editor, #wm-modal .wm-md-preview { min-height: 220px; }
#wm-modal .wm-md-editor { width: 100%; float: none; border-right: 0; border-bottom: 1px solid #e4ecf3; }
#wm-modal .wm-md-preview { overflow: auto; }

/* ---------------------------------------------------------------- 编辑模式（拖拽排序） */
.wm-edit-body { background: #f4f7fa; min-height: 100vh; }
.wm-editor-wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px 90px; }
.wm-editor-wrap h3 { color: #2a3f54; margin: 4px 0; }
.wm-panel-action { float: right; display: flex; align-items: center; gap: 8px; }
.wm-inline-select { width: 160px; display: inline-block; }
.wm-drag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e4ecf3;
  border-radius: 4px;
}
.wm-drag-row.dragging { opacity: .4; border-style: dashed; }
.wm-drag-handle { flex: none; width: 20px; color: #a7b3c0; cursor: move; text-align: center; }
.wm-drag-row .form-control { height: 32px; padding: 4px 8px; font-size: 13px; }
.wm-drag-row.cat-row .cat-name { flex: 0 0 200px; }
.wm-drag-row.cat-row .cat-icon { flex: 0 0 150px; }
.wm-drag-row.cat-row .cat-parent { flex: 0 0 180px; }
.wm-drag-row.cat-row .cat-active { flex: 0 0 62px; white-space: nowrap; }
.wm-drag-row.site-row .site-name { flex: 0 0 150px; }
.wm-drag-row.site-row .site-url { flex: 1 1 200px; }
.wm-drag-row.site-row .site-cat { flex: 0 0 140px; }
.wm-drag-row.site-row .site-desc { flex: 1 1 180px; }
.wm-drag-row.site-row .site-logo-file { flex: 0 0 140px; font-size: 11px; }
.wm-site-group { margin-bottom: 18px; }
.wm-site-group-title {
  padding: 7px 10px;
  margin-bottom: 6px;
  background: #fbfcfd;
  border-left: 3px solid #5b9bd5;
  color: #2a3f54;
  font-size: 13px;
  font-weight: 600;
}
.wm-group-count { color: #93a1b0; font-weight: 400; margin-left: 6px; }
.wm-site-list { min-height: 34px; }
.wm-save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 20px;
  margin-top: 0;
  background: #fff;
  border-top: 1px solid #e4ecf3;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
  text-align: center;
  z-index: 9999;
}
.wm-save-bar .btn { min-width: 110px; margin: 0 6px; }
.wm-save-bar #wm-save-status { margin-left: 14px; color: #5b9bd5; font-size: 13px; }
body.wm-inline-edit .main-content { padding-bottom: 70px; }

/* 右侧悬浮工具：快捷搜索 / 回到顶部 */
.wm-floating-tools {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wm-floating-tools button {
  width: 40px;
  height: 40px;
  border: 1px solid #dfe7ee;
  border-radius: 50%;
  background: #fff;
  color: #5b7187;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  cursor: pointer;
  transition: all .15s ease;
}
.wm-floating-tools button:hover { background: #31708f; border-color: #31708f; color: #fff; }
body.wm-inline-edit .wm-floating-tools { bottom: 140px; }

/* 个人设置页 */
.wm-settings-body { background: #f4f7fa; min-height: 100vh; }
.wm-settings-wrap { max-width: 820px; margin: 0 auto; padding: 24px 20px 60px; }
.wm-settings-wrap h3 { margin: 4px 0 4px; color: #2a3f54; }
.wm-settings-url {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 9px;
  background: #f5f9fc;
  border: 1px solid #e4ecf3;
  border-radius: 3px;
  color: #31708f;
  font-size: 13px;
  word-break: break-all;
}
.wm-settings-status { margin-left: 12px; font-size: 13px; color: #5b9bd5; }
.wm-settings-note { color: #93a1b0; font-size: 12px; margin: 6px 0 0; }

/* 导航首页页内编辑模式 */
.wm-inline-toolbar {
  margin: 14px 20px 0;
  padding: 10px 14px;
  background: #fbfcfd;
  border: 1px solid #e4ecf3;
  border-radius: 4px;
  color: #93a1b0;
  font-size: 13px;
}
.wm-inline-toolbar button { margin-right: 12px; }
.wm-inline-actions { float: right; margin-left: 10px; }
.wm-inline-btn {
  display: none;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  margin-left: 4px;
  border-radius: 3px;
  color: #5b9bd5;
}
.wm-inline-btn:hover { background: #d9edf7; color: #31708f; text-decoration: none; }
body.wm-inline-edit .wm-inline-btn { display: inline-block; }
body.wm-inline-edit .category-title { cursor: move; }
.category-row { display: flex; flex-wrap: wrap; }
.wm-dynamic-col { padding: 0 10px; margin-bottom: 10px; }
body.wm-inline-edit .category-row { min-height: 52px; }
body.wm-inline-edit .wm-site-card { cursor: move; position: relative; }
body.wm-inline-edit .wm-site-card.wm-drag-over,
body.wm-inline-edit .category-block.wm-drag-over { outline: 2px dashed #5b9bd5; outline-offset: 2px; }
.wm-site-edit { position: absolute; top: 4px; right: 6px; z-index: 3; }
.wm-site-delete { position: absolute; top: 4px; left: 6px; z-index: 3; }
.wm-direct-delete:hover { background: #f2dede !important; color: #a94442 !important; }
.wm-edit-savebar {
  position: fixed;
  left: 220px;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #e4ecf3;
  box-shadow: 0 -2px 10px rgba(30, 50, 70, .06);
  text-align: center;
}
.wm-edit-savebar #wm-save-status { margin-left: 12px; font-size: 13px; color: #5b9bd5; }
.wm-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.wm-modal[hidden] { display: none; }
.wm-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 35, 50, .45); }
.wm-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 8px 36px rgba(20, 35, 50, .2);
}
.wm-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e4ecf3;
  background: #fbfcfd;
}
.wm-modal-header h4 { margin: 0; font-size: 16px; color: #2a3f54; }
.wm-modal-close { float: right; color: #93a1b0; }
.wm-modal-body { padding: 18px; max-height: 62vh; overflow: auto; }
.wm-modal-body label { display: block; margin-bottom: 5px; font-size: 12px; color: #66788a; font-weight: 500; }
.wm-modal-body .form-group { margin-bottom: 14px; }
.wm-modal-body textarea { min-height: 130px; resize: vertical; }
.wm-modal-footer { padding: 12px 18px; border-top: 1px solid #e4ecf3; text-align: right; }
.wm-modal-footer .btn { margin-left: 8px; }
.wm-modal-footer #wm-modal-delete { float: left; margin-left: 0; }
.wm-modal-wide { max-width: 960px; }
.wm-modal-wide .wm-modal-body { max-height: 68vh; }
.wm-modal-wide textarea { min-height: 260px; }
/* 网站介绍弹窗：避开左侧菜单栏（宽度由 JS 设置 --wm-sidebar-w 变量） */
.wm-modal-fullscreen { width: calc(96vw - var(--wm-sidebar-w, 280px)); height: 92vh; max-width: none; max-height: none; display: flex; flex-direction: column; }
.wm-modal-fullscreen .wm-modal-body { flex: 1; max-height: none; overflow: auto; }
.wm-modal-fullscreen .wm-site-detail-content { font-size: 15px; line-height: 1.8; }
.wm-modal-fullscreen img, .wm-modal-fullscreen video { max-width: 100%; height: auto; }
/* 遮罩层同样避开左侧菜单，让菜单保持可点击 */
.wm-modal.wm-modal-with-sidebar { padding-left: var(--wm-sidebar-w, 280px); }
.wm-modal.wm-modal-with-sidebar .wm-modal-backdrop { left: var(--wm-sidebar-w, 280px); }
@media (max-width: 991px) {
  .wm-modal-fullscreen { width: 96vw; }
  .wm-modal.wm-modal-with-sidebar { padding-left: 0; }
  .wm-modal.wm-modal-with-sidebar .wm-modal-backdrop { left: 0; }
}

/* 左侧菜单编辑模式 */
.sidebar-menu .main-menu li { position: relative; }
.wm-side-add {
  margin: 12px 0 0;
  padding: 7px 10px;
  color: #9aa8b6;
  font-size: 12px;
  cursor: pointer;
  border: 1px dashed #4b5055;
  border-radius: 3px;
  text-align: center;
}
.wm-side-add:hover { color: #fff; border-color: #7b8794; }
.wm-side-actions {
  display: none;
  position: absolute;
  top: 0;
  right: 6px;
  height: 44px;
  line-height: 44px;
  z-index: 4;
}
body.wm-inline-edit .wm-side-actions { display: block; }
.wm-side-actions a {
  display: inline-block;
  padding: 0 5px;
  color: #7b8794;
  border-bottom: 0;
}
.wm-side-actions a:hover { color: #fff; }

/* 编辑模式：展开全部子级，便于拖拽与新增 */
body.wm-inline-edit .sidebar-menu .main-menu ul { display: block; }
body.wm-inline-edit .sidebar-menu .main-menu li[data-cat-id] { cursor: move; }

/* 每级菜单末尾的新增入口 */
.wm-side-add-item { display: none; }
body.wm-inline-edit .wm-side-add-item { display: block; }
.wm-side-add-item > a {
  color: #93a1b0 !important;
  border-bottom: 1px dashed #313437 !important;
  font-size: 12px;
}
.wm-side-add-item > a i { margin-right: 10px; }
.wm-side-add-item > a:hover { color: #5b9bd5 !important; }

/* 侧栏拖拽反馈 */
body.wm-inline-edit .main-menu li[data-cat-id].wm-drop-before { box-shadow: inset 0 2px 0 #5b9bd5; }
body.wm-inline-edit .main-menu li[data-cat-id].wm-drop-after { box-shadow: inset 0 -2px 0 #5b9bd5; }
body.wm-inline-edit .main-menu li[data-cat-id].wm-drop-into { outline: 1px dashed #5b9bd5; background: rgba(91,155,213,.12); }
body.wm-inline-edit .main-menu ul.wm-drop-area { outline: 1px dashed #5b9bd5; }

/* 分类末尾的新增收录卡片：仅编辑模式显示 */
.wm-add-site-card { display: none; cursor: pointer; }
body.wm-inline-edit .wm-add-site-card { display: block; }
.wm-add-site {
  height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c8d4df;
  border-radius: 4px;
  color: #93a1b0;
  background: #fbfcfd;
}
.wm-add-site i { font-size: 24px; margin-bottom: 6px; }
.wm-add-site span { font-size: 12px; }
.wm-add-site:hover { border-color: #5b9bd5; color: #31708f; background: #f5f9fc; }
