/* =========================================================
 * shell.css —— hydra-ui-demo 共享布局样式
 * 与 shell.js 配合使用，向页面注入统一的顶栏 + 侧边栏 + 主区域
 * =======================================================*/

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
               sans-serif;
  margin: 0;
  background: #f5f6f8;
  color: #1f2937;
}

/* 挂载完成前隐藏，避免先看到无侧栏的裸 #page-content 再闪出布局 */
html.shell-pending body {
  visibility: hidden;
}

/* shell.js 完成挂载后，会给 body 加 .shell-body，并把整体改为 flex 列布局 */
body.shell-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: visible;
}

/* 同端软切换时主区域过渡 */
.shell-main {
  transition: opacity 0.12s ease;
}
.shell-main.is-navigating {
  opacity: 0.55;
  pointer-events: none;
}

/* CSP ↔ WS、普通用户 ↔ 运维管理：整壳切换时的过渡 */
.shell-layout.is-app-switching,
.shell-header.is-app-switching {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

/* 顶栏 -------------------------------------------------- */
.shell-header {
  height: 56px;
  background: #343a40;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}
.shell-header .shell-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.shell-header .shell-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.shell-header .shell-brand-path {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
  font-size: 12px;
  margin-left: 12px;
}
.shell-header .shell-brand-path i { font-size: 10px; }

.shell-header .shell-right {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #d1d5db;
}
.shell-header .shell-right i { cursor: pointer; }
.shell-header .shell-right i:hover { color: #fff; }
.shell-header .shell-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.shell-header .shell-user:hover { color: #fff; }
.shell-header .shell-user-name { font-size: 13px; }

/* 顶栏 CSP / Workspace 切换 */
.shell-mode-tabs {
  background: #2b3035;
  border-radius: 6px;
  padding: 3px;
  display: flex;
  gap: 2px;
  font-size: 12px;
}
.shell-mode-tab {
  padding: 4px 12px;
  border-radius: 4px;
  background: transparent;
  color: #cbd5e1;
  border: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.shell-mode-tab:hover { color: #fff; }
.shell-mode-tab.active {
  background: #2563eb;
  color: #fff;
}

/* 主布局 ------------------------------------------------ */
.shell-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* 侧栏 -------------------------------------------------- */
.shell-aside {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.shell-aside-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}
.shell-aside-brand i { font-size: 20px; color: #4b5563; }
.shell-aside-brand-title { font-weight: 700; color: #1f2937; font-size: 14px; }
.shell-aside-brand-sub   { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* 工作空间切换占位 */
.shell-workspace-switch {
  margin: 0 16px 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.shell-workspace-switch i.fa-chevron-down { color: #9ca3af; font-size: 10px; }
.shell-aside-divider {
  border-top: 1px solid #f3f4f6;
  margin: 4px 16px 8px;
}

/* 菜单项 */
.shell-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  flex: 1;
}
.shell-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
  position: relative;
  text-decoration: none;
  border-right: 3px solid transparent;
}
.shell-menu-item i.shell-menu-icon { width: 20px; text-align: center; font-size: 14px; }
.shell-menu-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}
.shell-menu-item.active {
  color: #2563eb;
  background: #eff6ff;
  border-right-color: #2563eb;
}

/* 已上线占位：外观与普通菜单一致，仅禁止点击 */
.shell-menu-item.disabled {
  cursor: default;
}
.shell-menu-item.disabled:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* 菜单 "新" 角标 */
.shell-menu-badge {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.shell-menu-badge.draft {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.shell-menu-item.disabled .shell-menu-badge { display: none; }

/* 已上线 tooltip（hover 时浮出） */
.shell-menu-item.disabled[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% - 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.15);
}

/* 父菜单的展开/收起 */
.shell-menu-parent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #1f2937;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.shell-menu-parent i.shell-menu-icon { width: 20px; text-align: center; font-size: 14px; color: #6b7280; }
.shell-menu-parent .shell-menu-caret {
  margin-left: auto;
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.18s ease;
}
.shell-menu-parent.collapsed .shell-menu-caret { transform: rotate(-90deg); }

.shell-submenu {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  background: #f9fafb;
  overflow: hidden;
}
.shell-submenu.collapsed { display: none; }
.shell-submenu .shell-menu-item {
  padding-left: 40px;
  padding-top: 9px;
  padding-bottom: 9px;
  border-left: 2px solid transparent;
  border-right: 0;
  font-size: 13.5px;
}
.shell-submenu .shell-menu-item.active {
  border-left-color: #2563eb;
  background: #eff6ff;
}

/* 侧栏底部模式切换 */
.shell-aside-footer {
  border-top: 1px solid #f3f4f6;
  padding: 8px 0 14px;
  flex-shrink: 0;
}
.shell-aside-footer-title {
  padding: 6px 24px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.06em;
}
.shell-aside-footer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  color: #4b5563;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}
.shell-aside-footer-link i { width: 20px; text-align: center; color: #6b7280; }
.shell-aside-footer-link:hover { background: #f3f4f6; color: #1f2937; }

/* 主区域 ------------------------------------------------ */
.shell-main {
  flex: 1;
  overflow-y: auto;
  background: #f5f6f8;
  position: relative;
  min-width: 0;
}
.shell-main > .page-content { display: block; }

/* 默认占位内容容器 */
.shell-main::-webkit-scrollbar,
.shell-aside::-webkit-scrollbar { width: 6px; height: 6px; }
.shell-main::-webkit-scrollbar-thumb,
.shell-aside::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.shell-main::-webkit-scrollbar-thumb:hover,
.shell-aside::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 占位"已上线"页通用块 */
.shell-placeholder {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 24px;
}
.shell-placeholder .shell-placeholder-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.shell-placeholder h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.shell-placeholder h1 .shell-placeholder-tag {
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 0.02em;
}
.shell-placeholder p { color: #6b7280; line-height: 1.6; font-size: 14px; }
.shell-placeholder .shell-placeholder-hint {
  margin-top: 18px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 12px 16px;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.55;
}
.shell-placeholder .shell-placeholder-demo-list {
  margin-top: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.shell-placeholder .shell-placeholder-demo-list h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.shell-placeholder .shell-placeholder-demo-list ul { list-style: none; margin: 0; padding: 4px 0; }
.shell-placeholder .shell-placeholder-demo-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #2563eb;
  text-decoration: none;
  font-size: 13px;
}
.shell-placeholder .shell-placeholder-demo-list li a:hover { background: #eff6ff; }
.shell-placeholder .shell-placeholder-demo-list li a i { font-size: 11px; color: #9ca3af; }
