@import url("fonts/fonts.css");

/* ============================================================
   徕卡三维激光扫描产品中文培训站
   视觉基调复刻 rcdocs.leica-geosystems.com（Hexagon / Leica 品牌体系）
   ============================================================ */
:root {
  --primary: #005198;
  --primary-dark: #00284C;
  --primary-light: #0065b3;
  --border: #DBDEE0;
  --text: #70737A;
  --text-strong: #1c1c1c;
  --smoke: #F2F6FA;
  --fog: #F6F7F8;
  --white: #fff;
  --dark: #000;

  --ok: #12805c;
  --warn: #b45309;
  --danger: #c0392b;
  --tip: #0e7490;

  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 62px;
  --sidebar-w: 306px;
  --toc-w: 226px;

  --font: "Hanken Grotesk", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-strong);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

img { display: block; max-width: 100%; height: auto; border-radius: 6px; }

code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--smoke); padding: .12em .38em; border-radius: 4px; color: #b03060; }
pre {
  background: #0f172a; color: #e5e7eb; padding: 16px 18px; border-radius: var(--radius);
  overflow-x: auto; line-height: 1.55;
}
pre code { background: none; color: inherit; padding: 0; }
kbd {
  background: var(--white); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; font-size: .8em; color: var(--text-strong);
}

/* ------------------------------------------------------------ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  height: var(--topbar-h); padding: 0 22px; max-width: 1680px; margin: 0 auto;
}
.topbar__menu {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 17px; line-height: 1; padding: 7px 11px; cursor: pointer;
  color: var(--primary);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.topbar__brand:hover { text-decoration: none; }
.topbar__logo { height: 30px; width: auto; border-radius: 0; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.15; }
.topbar__title b { font-size: 15.5px; font-weight: 600; color: var(--primary-dark); letter-spacing: .2px; }
.topbar__title i {
  font-style: normal; font-size: 11.5px; color: var(--text);
  letter-spacing: 1.6px; text-transform: uppercase;
}

.topbar__search { position: relative; flex: 0 1 340px; margin-left: 8px; }
.topbar__search input {
  width: 100%; height: 38px; padding: 0 14px 0 36px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--fog) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2370737A' stroke-width='2.2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 13px center;
  font-family: inherit; font-size: 14px; color: var(--text-strong); outline: none;
  transition: border-color .15s, background-color .15s;
}
.topbar__search input:focus { border-color: var(--primary-light); background-color: var(--white); }
.topbar__search input::placeholder { color: #9aa0a6; }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  max-height: 62vh; overflow-y: auto; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 80;
}
.sr-item { display: block; padding: 9px 12px; border-radius: var(--radius); color: var(--text-strong); }
.sr-item:hover, .sr-item.on { background: var(--smoke); text-decoration: none; }
.sr-item b { display: block; font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.sr-item span { display: block; font-size: 12.5px; color: var(--text); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item em { font-style: normal; font-size: 11px; color: var(--primary-light); }
.sr-empty { padding: 14px; font-size: 13.5px; color: var(--text); text-align: center; }

.topbar__links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.topbar__links a {
  font-size: 13px; color: var(--text); padding: 5px 10px; border-radius: var(--radius);
  white-space: nowrap;
}
.topbar__links a:hover { background: var(--smoke); color: var(--primary); text-decoration: none; }
.topbar__links a.on { color: var(--primary); font-weight: 600; background: var(--smoke); }

/* ------------------------------------------------------------ 布局 */
.layout {
  display: flex; align-items: flex-start; gap: 0;
  max-width: 1680px; margin: 0 auto;
}

.sidebar {
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  border-right: 1px solid var(--border);
  background: var(--white);
}
.sidebar__inner { height: 100%; overflow-y: auto; padding: 16px 10px 60px; }
.sidebar__inner::-webkit-scrollbar { width: 9px; }
.sidebar__inner::-webkit-scrollbar-thumb { background: #d8dce0; border-radius: 5px; }
.sidebar__inner::-webkit-scrollbar-thumb:hover { background: #c2c8cd; }

.nav-prod { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 12px; }
.nav-prod__label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text); padding: 0 10px 8px; font-weight: 600;
}
.nav-prod__list { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 8px; }
.nav-prod__list a {
  font-size: 11.5px; padding: 3.5px 8px; border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); line-height: 1.5; white-space: nowrap;
}
.nav-prod__list a:hover { border-color: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-prod__list a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.nav-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary-dark); padding: 10px 10px 10px; margin: 0;
}

.nav { list-style: none; margin: 0; padding: 0 0 0 2px; font-size: 13.5px; }
.nav ul { list-style: none; margin: 0; padding-left: 13px; border-left: 1px solid var(--border); }
.nav li { position: relative; }
.nav .row { display: flex; align-items: flex-start; gap: 2px; border-radius: 6px; }
.nav .row:hover { background: var(--smoke); }
.nav .row.on { background: #e6f0f8; }
.nav .tw {
  flex: 0 0 20px; width: 20px; height: 27px; border: none; background: none; cursor: pointer;
  color: #98a1a8; font-size: 10px; line-height: 27px; padding: 0; text-align: center;
  transition: transform .15s;
}
.nav .tw:hover { color: var(--primary); }
.nav li.open > .row > .tw { transform: rotate(90deg); }
.nav .tw.leaf { visibility: hidden; }
.nav .lk {
  flex: 1 1 auto; display: block; padding: 4.5px 8px 4.5px 0; line-height: 1.45;
  color: #3f4750; word-break: break-word;
}
.nav .lk:hover { color: var(--primary); text-decoration: none; }
.nav .row.on > .lk { color: var(--primary); font-weight: 600; }
.nav li > ul { display: none; }
.nav li.open > ul { display: block; }
.nav .grp > .row > .lk { color: var(--text); font-style: italic; }

/* ------------------------------------------------------------ 内容区 */
.content { flex: 1 1 auto; min-width: 0; padding: 26px 40px 90px; }
.content > * { max-width: 900px; }

.breadcrumb {
  font-size: 12.5px; color: var(--text); margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; max-width: 900px;
}
.breadcrumb i { font-style: normal; color: #c3c8cd; }
.breadcrumb a { color: var(--text); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .cur { color: var(--text-strong); font-weight: 600; }

.pagemeta { margin-bottom: 22px; }
.pagemeta h1 {
  font-size: 30px; line-height: 1.28; font-weight: 600; color: var(--primary-dark);
  margin: 0 0 6px; letter-spacing: -.2px;
}
.pagemeta__sub { font-size: 13.5px; color: var(--text); margin: 0 0 12px; }
.pagemeta__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 10px 0 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text);
}
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2.5px 9px;
  border-radius: 20px; letter-spacing: .3px;
}
.badge--zh { background: #e3f4ec; color: var(--ok); }
.badge--en { background: #fdf0e3; color: var(--warn); }
.pagemeta__src { margin-left: auto; font-size: 12.5px; }

.article { font-size: 15.5px; line-height: 1.72; color: #2f3439; }
.article > *:first-child { margin-top: 0; }
.article h2 {
  font-size: 22px; font-weight: 600; color: var(--primary-dark);
  margin: 38px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.article h3 { font-size: 18px; font-weight: 600; color: var(--primary-dark); margin: 28px 0 10px; }
.article h4 { font-size: 16px; font-weight: 600; color: var(--primary-dark); margin: 22px 0 8px; }
.article h5, .article h6 { font-size: 15px; font-weight: 600; color: var(--primary-dark); margin: 18px 0 6px; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 24px; }
.article li { margin-bottom: 5px; }
.article li > ul, .article li > ol { margin-top: 5px; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
.article blockquote {
  margin: 0 0 16px; padding: 2px 0 2px 16px; border-left: 3px solid var(--border); color: var(--text);
}
.article img {
  margin: 16px 0; border: 1px solid var(--border);
  /* 限制单张图片的最大高度，避免极端长图/宽高比截图在正文中纵向失控 */
  max-width: 100%; max-height: 640px; width: auto; height: auto; object-fit: contain;
}
/* 标题内的内联图标（如"对比 / 检查"命令图标）：原站为~24px 内联小图标，
   镜像转为 <img> 后丢失尺寸，会被 display:block+max-width:100% 撑满整列。
   还原为小尺寸内联图标排布。 */
.article h1 img, .article h2 img, .article h3 img, .article h4 img,
.article h5 img, .article h6 img {
  display: inline-block; vertical-align: middle;
  width: 28px; height: 28px; margin: 0 6px 0 0; padding: 0;
  border: 0; border-radius: 4px; object-fit: contain;
}
/* 内联小图标（≤64px 的命令/工具/按钮图标）：原站为随文小图标，
   镜像转为 <img> 后丢失尺寸，会被 display:block 撑满整列。
   还原为与文字同行的小图标。 */
img.inline-icon {
  display: inline-block; vertical-align: -0.25em;
  width: auto; height: 1.15em; max-width: none; max-height: 1.15em;
  margin: 0 .18em; padding: 0; border: 0; border-radius: 3px; object-fit: contain;
}
.article img + em, .article p:has(> img) + p > em:only-child {
  display: block; text-align: center; font-size: 12.5px; color: var(--text); margin: -8px 0 18px;
}
.article table {
  width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px;
  display: block; overflow-x: auto;
}
.article th, .article td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; vertical-align: top; }
.article th { background: var(--smoke); font-weight: 600; color: var(--primary-dark); }
.article tbody tr:nth-child(even) { background: #fafbfc; }

/* 提示框 */
.callout {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius);
  padding: 13px 16px; margin: 18px 0; background: var(--fog);
}
.callout__title { font-weight: 700; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 5px; }
.callout__body > :last-child { margin-bottom: 0; }
.callout__body p { margin-bottom: 8px; }
.callout--note { background: #eef4fb; border-color: #c8dcf0; border-left-color: var(--primary-light); }
.callout--note .callout__title { color: var(--primary); }
.callout--tip { background: #e9f6f4; border-color: #c2e5e0; border-left-color: var(--tip); }
.callout--tip .callout__title { color: var(--tip); }
.callout--warning { background: #fdf6e9; border-color: #f0dcb4; border-left-color: var(--warn); }
.callout--warning .callout__title { color: var(--warn); }
.callout--danger { background: #fdeeec; border-color: #f4cdc7; border-left-color: var(--danger); }
.callout--danger .callout__title { color: var(--danger); }

/* 上一页/下一页 */
.pager {
  display: flex; gap: 14px; margin-top: 46px; padding-top: 22px;
  border-top: 1px solid var(--border); max-width: 900px;
}
.pager a {
  flex: 1 1 0; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 15px; background: var(--white); transition: box-shadow .15s, border-color .15s;
}
.pager a:hover { box-shadow: var(--shadow-md); border-color: #c3d3e0; text-decoration: none; }
.pager i { display: block; font-style: normal; font-size: 11.5px; color: var(--text); letter-spacing: .6px; }
.pager b { display: block; font-size: 14px; font-weight: 600; color: var(--primary-dark); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager__next { text-align: right; }

/* 页内目录 */
.pagetoc {
  flex: 0 0 var(--toc-w); width: var(--toc-w);
  position: sticky; top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 30px 22px 40px 0; font-size: 13px;
}
.pagetoc__title {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text); font-weight: 700; margin-bottom: 10px;
}
.pagetoc a {
  display: block; padding: 3.5px 0 3.5px 11px; color: var(--text);
  border-left: 2px solid var(--border); line-height: 1.45;
}
.pagetoc a:hover { color: var(--primary); border-left-color: var(--primary-light); text-decoration: none; }
.pagetoc a.lv3 { padding-left: 22px; font-size: 12.5px; }
.pagetoc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* ------------------------------------------------------------ 首页 */
/* 注意：首页各区块位于 <article class="article"> 内部，而 .article h2/h3/h4/p/img/ol/li
   等基础排版规则的选择器权重为 (0,1,1)，高于首页区块的类选择器 (0,1,0)，
   会反向覆盖首页版式（标题字号被压小、副标题居中失效、列表被加左缩进、
   卡片图标被加上外边距与边框）。因此首页规则统一加 body.is-home 前缀提升权重，
   并对 .article 已声明的属性做显式重置，彻底隔离样式泄漏。 */
body.is-home .sidebar, body.is-home .pagetoc, body.is-home .topbar__menu { display: none; }
body.is-home .content { padding: 0 0 0; max-width: none; }
body.is-home .content > * { max-width: none; }
body.is-home .layout { display: block; }
body.is-home .container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

body.is-home .hero { background: var(--fog); border-bottom: 1px solid var(--border); padding: 66px 28px 60px; text-align: center; }
body.is-home .hero h1 { font-size: 38px; line-height: 1.24; font-weight: 600; color: var(--primary-dark); margin: 0 0 12px; letter-spacing: -.4px; }
/* max-width + auto 外边距使副标题与主标题同轴居中 */
body.is-home .hero__sub { font-size: 16px; line-height: 1.65; color: var(--text); margin: 0 auto 26px; max-width: 640px; }
body.is-home .hero__search {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 380px; padding: 13px 20px; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--white); border: 1px solid var(--border); border-radius: 26px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow .18s, border-color .18s;
}
body.is-home .hero__search:hover { box-shadow: var(--shadow-md); border-color: #c3d3e0; }
body.is-home .hero__search span {
  margin-left: auto; font-size: 11px; letter-spacing: 1px; color: #9aa0a6;
  border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px;
}

body.is-home .products { background: var(--fog); padding: 56px 0 68px; }
body.is-home .cap { font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--primary); margin: 0 0 6px; }
body.is-home .sec {
  font-size: 30px; font-weight: 600; color: var(--dark); margin: 0 0 34px; letter-spacing: -.3px;
  padding-bottom: 0; border-bottom: none;
}
body.is-home .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
body.is-home .card {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
body.is-home .card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #c3d3e0; text-decoration: none; }
/* 重置 .article img 泄漏进来的 margin / border，使图标与标题首行对齐 */
body.is-home .card img { flex: 0 0 52px; width: 52px; height: 52px; margin: 0; border: 0; object-fit: contain; border-radius: 0; }
body.is-home .card__body { flex: 1 1 auto; width: auto; min-width: 0; }
body.is-home .card h3 { font-size: 17px; font-weight: 600; color: var(--primary-dark); margin: 0 0 6px; line-height: 1.35; }
body.is-home .card p { font-size: 13.5px; color: var(--text); margin: 0 0 9px; line-height: 1.55; text-wrap: pretty; }
body.is-home .card__count { font-size: 11.5px; color: var(--primary); background: var(--smoke); border-radius: 20px; padding: 2px 9px; }

body.is-home .quickstart { padding: 56px 0 76px; }
/* 培训路径固定 5 步，宽屏一行排满，避免第 5 张卡片落单 */
body.is-home .steps {
  counter-reset: st; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
}
body.is-home .steps li {
  counter-increment: st; position: relative; margin: 0; padding: 20px 18px 18px 18px;
  background: var(--white); border: 1px solid var(--border); border-top: 3px solid var(--primary);
  border-radius: var(--radius);
}
body.is-home .steps li::before {
  content: counter(st, decimal-leading-zero); font-size: 12px; font-weight: 700; color: var(--primary-light);
  letter-spacing: 1px;
}
body.is-home .steps b { display: block; font-size: 16px; color: var(--primary-dark); margin: 6px 0 6px; }
body.is-home .steps span { font-size: 13.5px; color: var(--text); line-height: 1.6; text-wrap: pretty; }

/* ------------------------------------------------------------ 页脚 */
.footer { background: var(--primary-dark); color: #cfd8e2; margin-top: 0; }
.footer__inner { max-width: 1240px; margin: 0 auto; padding: 32px 28px 36px; }
.footer__logo { height: 42px; width: auto; margin-bottom: 16px; border-radius: 0; }
.footer__note { font-size: 13px; line-height: 1.75; color: #a9b8c9; margin: 0; }
.footer__note a { color: #e8eef5; }

/* ------------------------------------------------------------ 响应式 */
/* 顶栏：链接条在中等宽度会被挤成两行、竖向溢出 62px 顶栏。
   改为按宽度分级收敛：先收窄搜索框，再逐步隐藏低优先级产品入口，
   保证 981px 以上始终单行显示（≤980px 由下方规则整条隐藏）。 */
@media (max-width: 1320px) {
  .topbar__search { flex: 0 1 250px; }
}
@media (max-width: 1240px) {
  .topbar__links a:nth-child(5), .topbar__links a:nth-child(6) { display: none; }
}
@media (max-width: 1120px) {
  .topbar__links a:nth-child(3), .topbar__links a:nth-child(4) { display: none; }
}

@media (max-width: 1200px) {
  .pagetoc { display: none; }
  .content { padding: 24px 28px 80px; }
  /* 培训路径：宽屏一行 5 张，中等宽度改为 3 列，避免出现落单卡片 */
  body.is-home .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .topbar__menu { display: block; }
  .topbar__links { display: none; }
  .topbar__search { flex: 1 1 auto; }
  .topbar__title i { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 55;
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg); width: 320px; flex-basis: 320px;
  }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 20px 18px 70px; }
  body.is-home .hero h1 { font-size: 28px; }
  body.is-home .hero__search { min-width: 0; width: 100%; }
  body.is-home .hero { padding: 44px 18px 40px; }
  body.is-home .sec { font-size: 24px; }
  body.is-home .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body.is-home .steps { grid-template-columns: 1fr; }
  body.is-home .grid { grid-template-columns: 1fr; }
}
@media (min-width: 981px) { #sidebar { transform: none !important; } }

/* 官方站点已失效的原图占位（由 build_site.py 的 apply_img_policy 注入） */
.img-dead {
  display: inline-block; padding: 6px 12px; margin: 6px 0;
  font-size: 12.5px; color: var(--muted, #5b6b7c);
  background: var(--surface-2, #f1f4f7);
  border: 1px dashed var(--border, #d5dde5); border-radius: 6px;
}
