/* ============================================================
   lab-bar.css —— 材料结构分析知识站 V2 · 工具子站外壳
   作用：
     1) 隐藏原站注入的顶栏 / 页脚 / 面包屑 / 目录 / 「下一步」区块；
     2) 提供固定返回条（lab-bar）、课程锚点条（lab-anchor）、
        使用边界面板（lab-guard）。
   子站页面位于 /lab/<学科>/<page>.html，资源在 /lab/assets/。
   ============================================================ */

/* ---------- 1. 隐藏原站全站外壳 ---------- */
header.uax-site,
footer.uax-foot,
nav.ua-crumbs,
aside.ua-next,
nav.ua-toc,
a.ua-skip {
  display: none !important;
}

/* 原站顶栏被隐藏后，给固定返回条让出空间 */
html body {
  padding-top: 42px !important;
}

/* ---------- 2. 固定返回条 ---------- */
.lab-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid #d8dee9;
  box-shadow: 0 1px 4px rgba(20, 35, 60, 0.06);
  font: 400 13px/1.4 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #2b3142;
  box-sizing: border-box;
}

.lab-bar__back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2c4a96;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.lab-bar__back:hover { text-decoration: underline; }

.lab-bar__sep {
  color: #c3cad8;
  user-select: none;
}

.lab-bar__anchor {
  color: #5a6478;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-bar__unit {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid #cfd8e8;
  border-radius: 999px;
  color: #2c4a96;
  background: #f3f6fc;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- 3. 课程锚点条 ---------- */
.lab-anchor {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-left: 3px solid #2c4a96;
  background: #f4f6fb;
  border-radius: 0 4px 4px 0;
  font: 400 0.86rem/1.55 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #3a4256;
}
.lab-anchor strong {
  color: #1f3557;
  font-weight: 600;
}
.lab-anchor em {
  font-style: normal;
  color: #2c4a96;
  font-weight: 600;
}

/* ---------- 4. 使用边界 / 验证路径面板 ---------- */
.lab-guard {
  margin: 40px 0 12px;
  border: 1px solid #dde3ef;
  border-radius: 6px;
  background: #fbfcfe;
  font: 400 0.9rem/1.65 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #333b4d;
}
.lab-guard > summary {
  cursor: pointer;
  padding: 11px 15px;
  font-weight: 600;
  color: #1f3557;
  list-style: none;
  user-select: none;
}
.lab-guard > summary::-webkit-details-marker { display: none; }
.lab-guard > summary::before {
  content: "▸ ";
  color: #2c4a96;
}
.lab-guard[open] > summary::before { content: "▾ "; }

.lab-guard__body {
  padding: 0 15px 14px;
  border-top: 1px solid #e6ebf4;
  margin-top: 2px;
  padding-top: 12px;
}
.lab-guard__body h3 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
  color: #1f3557;
  font-weight: 600;
}
.lab-guard__body h3:first-child { margin-top: 0; }
.lab-guard__body p { margin: 0 0 8px; }
.lab-guard__body ul { margin: 0 0 10px; padding-left: 1.35em; }
.lab-guard__body li { margin: 0 0 5px; }
.lab-guard__body code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #eef2f9;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
}

/* ---------- 5. 窄屏 ---------- */
@media (max-width: 720px) {
  .lab-bar { gap: 8px; padding: 0 10px; font-size: 12px; }
  .lab-bar__anchor { display: none; }
  .lab-bar__sep { display: none; }
  html body { padding-top: 40px !important; }
  .lab-bar { height: 40px; }
  .lab-bar__unit { font-size: 11px; padding: 2px 7px; }
}
