/* ==========================================================================
   3DsWorks 帮助 — SolidWorks 风格
   ========================================================================== */

:root {
  --sw-navy: #1c4b73;
  --sw-navy-dark: #143a5b;
  --sw-blue: #0b61a4;
  --sw-blue-light: #2a7fbe;
  --sw-red: #c8102e;
  --sw-text: #1f2328;
  --sw-text-soft: #5a6673;
  --sw-border: #d5dde6;
  --sw-border-soft: #e6ebf1;
  --sw-bg: #ffffff;
  --sw-bg-soft: #f6f8fa;
  --sw-nav-bg: #f1f4f8;
  --sw-hover: #e3edf7;
  --sw-active: #d5e6f5;
  --sw-note-bg: #eef5fb;
  --sw-warn-bg: #fff8e6;
  --sw-warn-border: #e0b34a;
  --sw-tip-bg: #f0f8f0;
  --sw-tip-border: #4e9a51;
  --sw-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sw-sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, Helvetica, sans-serif;
  --header-h: 58px;
  --nav-w: 292px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sw-sans);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--sw-text);
  background: var(--sw-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sw-blue); text-decoration: none; }
a:hover { color: var(--sw-red); text-decoration: underline; }

/* ---------- 顶部栏 ---------- */
.sw-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 60;
  background: #fff;
  border-bottom: 1px solid var(--sw-border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(20, 40, 70, .06);
}

.sw-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--sw-navy-dark);
  text-decoration: none;
}
.sw-logo:hover { text-decoration: none; }
.sw-logo svg { width: 32px; height: 32px; display: block; }
.sw-logo .name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.1;
}
.sw-logo .name span { color: var(--sw-red); }
.sw-logo .sub {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--sw-text-soft);
  letter-spacing: .6px;
  text-transform: uppercase;
}

.sw-header .divider {
  width: 1px;
  height: 30px;
  background: var(--sw-border);
  flex: none;
}

.sw-product {
  font-size: 13px;
  color: var(--sw-text-soft);
  white-space: nowrap;
}
.sw-product b { color: var(--sw-navy); font-weight: 600; }

.sw-search {
  margin-left: auto;
  position: relative;
  flex: 0 1 420px;
  min-width: 180px;
}
.sw-search input {
  width: 100%;
  height: 32px;
  padding: 0 34px 0 32px;
  font-family: inherit;
  font-size: 13px;
  color: var(--sw-text);
  background: #fff;
  border: 1px solid #b9c6d4;
  border-radius: 3px;
  outline: none;
}
.sw-search input:focus { border-color: var(--sw-blue); box-shadow: 0 0 0 2px rgba(11, 97, 164, .14); }
.sw-search .ico {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: #7e8b99;
  pointer-events: none;
}
.sw-search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #8b98a5;
  border: 1px solid #d5dde6;
  border-radius: 3px;
  padding: 0 4px;
  background: #f8fafc;
}

.sw-header-links { display: flex; align-items: center; gap: 14px; flex: none; font-size: 12.5px; }
.sw-header-links a { color: var(--sw-text-soft); }
.sw-header-links a:hover { color: var(--sw-blue); text-decoration: none; }

/* ---------- 布局 ---------- */
.sw-layout {
  display: flex;
  align-items: flex-start;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------- 左侧目录 ---------- */
.sw-nav {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--nav-w);
  background: var(--sw-nav-bg);
  border-right: 1px solid var(--sw-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 0 40px;
  z-index: 40;
}

.sw-nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #7b8896;
  padding: 4px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sw-nav-title button {
  border: 0;
  background: none;
  color: #8695a4;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  padding: 2px 4px;
}
.sw-nav-title button:hover { color: var(--sw-blue); }

.sw-nav ul { list-style: none; margin: 0; padding: 0; }
.sw-nav li { position: relative; }

.sw-nav a.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 16px 6px 18px;
  color: #2c3a47;
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid transparent;
}
.sw-nav a.nav-link:hover {
  background: var(--sw-hover);
  color: var(--sw-navy);
  text-decoration: none;
}

.sw-nav .nav-group > a.nav-link { font-weight: 600; color: var(--sw-navy); }

.sw-nav li.active > a.nav-link {
  background: var(--sw-active);
  border-left-color: var(--sw-blue);
  color: var(--sw-navy-dark);
  font-weight: 700;
}

.sw-nav ul ul a.nav-link { padding-left: 40px; font-size: 12.5px; color: #45525f; }
.sw-nav ul ul ul a.nav-link { padding-left: 56px; }

.sw-nav .caret {
  flex: none;
  width: 14px; height: 14px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7b8896;
  transition: transform .15s ease;
}
.sw-nav .caret svg { width: 9px; height: 9px; }
.sw-nav .open > .nav-link .caret { transform: rotate(90deg); }
.sw-nav .nav-group > ul { display: none; }
.sw-nav .nav-group.open > ul { display: block; }
.sw-nav .nav-group > a.nav-link .caret { color: var(--sw-blue); }

.sw-nav .nav-num {
  font-size: 10.5px;
  color: #93a1ae;
  margin-left: auto;
  padding-left: 6px;
  flex: none;
}

.sw-nav-foot {
  margin: 18px 18px 0;
  padding-top: 12px;
  border-top: 1px solid var(--sw-border);
  font-size: 11.5px;
  color: #7b8896;
  line-height: 1.6;
}

/* ---------- 正文 ---------- */
.sw-main {
  margin-left: var(--nav-w);
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 40px 80px;
}

.sw-content {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 22px;
}

.sw-crumbs {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: #fff;
  font-size: 12px;
  color: var(--sw-text-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 8px 0 7px;
  border-bottom: 1px solid #eef2f6;
}
.sw-crumbs a { color: var(--sw-text-soft); }
.sw-crumbs a:hover { color: var(--sw-blue); }
.sw-crumbs .sep { color: #b3bec9; }
.sw-crumbs .here { color: var(--sw-navy); font-weight: 600; }

h1.topic-title {
  font-size: 25px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--sw-navy-dark);
  margin: 2px 0 4px;
  letter-spacing: -.2px;
}

.topic-meta {
  font-size: 12px;
  color: #8a97a4;
  padding: 0 0 12px;
  border-bottom: 3px solid var(--sw-navy);
  margin-bottom: 22px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.topic-meta .tag {
  background: #eaf1f8;
  color: var(--sw-navy);
  border: 1px solid #cfe0ee;
  border-radius: 2px;
  padding: 0 7px;
  font-size: 11.5px;
  line-height: 18px;
}

section { scroll-margin-top: calc(var(--header-h) + 48px); }

h2 {
  font-size: 19px;
  font-weight: 600;
  color: var(--sw-navy);
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--sw-border);
  scroll-margin-top: calc(var(--header-h) + 48px);
}

h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: #1a3f5f;
  margin: 28px 0 8px;
  scroll-margin-top: calc(var(--header-h) + 48px);
}

h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #2c3a47;
  margin: 18px 0 6px;
}

p { margin: 0 0 12px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 3px 0; }
li > ul, li > ol { margin-top: 4px; }

strong { color: #14212e; }
mark {
  background: #fff3c4;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

kbd {
  font-family: var(--sw-mono);
  font-size: 11.5px;
  background: #f4f6f8;
  border: 1px solid #d5dde6;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  color: #33414f;
  white-space: nowrap;
}

code {
  font-family: var(--sw-mono);
  font-size: 12px;
  background: #f2f5f8;
  border: 1px solid var(--sw-border-soft);
  border-radius: 2px;
  padding: 1px 4px;
  color: #0f4c75;
  word-break: break-word;
}

hr {
  border: 0;
  border-top: 1px solid var(--sw-border-soft);
  margin: 26px 0;
}

/* 本主题内容 */
.in-this-topic {
  border: 1px solid var(--sw-border);
  background: var(--sw-bg-soft);
  padding: 12px 18px 6px;
  margin: 0 0 22px;
  display: inline-block;
  min-width: 320px;
  max-width: 100%;
}
.in-this-topic .hd {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #7b8896;
  margin-bottom: 4px;
}
.in-this-topic ul { list-style: none; padding: 0; margin: 0 0 6px; }
.in-this-topic li { margin: 0; font-size: 12.5px; }
.in-this-topic li a::before { content: "› "; color: #9aa8b5; }

/* 提示框 */
.note {
  position: relative;
  border: 1px solid #c9dcec;
  border-left: 4px solid var(--sw-blue);
  background: var(--sw-note-bg);
  padding: 12px 16px 4px;
  margin: 16px 0 18px;
  font-size: 13px;
  color: #24425c;
}
.note::before {
  content: "提示";
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--sw-blue);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.note.warn { background: var(--sw-warn-bg); border-color: #f0dcae; border-left-color: var(--sw-warn-border); color: #5a4518; }
.note.warn::before { content: "注意"; color: #a2761b; }
.note.tip { background: var(--sw-tip-bg); border-color: #cfe4d0; border-left-color: var(--sw-tip-border); color: #2c5230; }
.note.tip::before { content: "技巧"; color: #3d7f40; }
.note p:last-child, .note ul:last-child { margin-bottom: 10px; }
.note ul { padding-left: 20px; }

/* 表格 */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 20px;
  font-size: 12.5px;
  line-height: 1.65;
}

th, td {
  border: 1px solid var(--sw-border);
  padding: 7px 10px;
  vertical-align: top;
  text-align: left;
}

thead th {
  background: #e9f0f7;
  background-image: linear-gradient(#f3f7fb, #e2ebf4);
  color: var(--sw-navy-dark);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-color: #c8d7e5;
}

tbody tr:nth-child(even) td { background: #fbfcfd; }
tbody tr:hover td { background: #f4f9fd; }

td code { font-size: 11.5px; }

/* 组件属性表：左列标签 */
table.props th[scope="row"] {
  width: 128px;
  background: #f5f8fb;
  color: #41586d;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-right: 1px solid var(--sw-border);
}
table.props td { background: #fff; }
table.props tr:hover td { background: #fff; }
table.props ul { margin: 0; padding-left: 18px; }
table.props ul li:last-child { margin-bottom: 0; }

/* 分组小标题 */
.group-label td,
tr.group-label td {
  background: #dfe9f2 !important;
  color: var(--sw-navy-dark);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .3px;
  border-color: #c8d7e5;
}

/* 图片 */
figure {
  margin: 16px 0 22px;
  padding: 0;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--sw-border);
  background: #fff;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(20, 40, 70, .1);
  cursor: zoom-in;
}
figcaption {
  font-size: 12px;
  color: var(--sw-text-soft);
  margin-top: 6px;
  padding-left: 2px;
}
figcaption b { color: var(--sw-navy); font-weight: 600; }

figure.shot-narrow img { max-width: 720px; }
figure.shot-small img { max-width: 300px; }

/* 组件条目卡片 */
.component {
  border-top: 1px solid var(--sw-border-soft);
  padding-top: 6px;
  margin-top: 8px;
}
.component-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.component-head h3 { margin-top: 22px; }
.component-head .anchor-id {
  font-family: var(--sw-mono);
  font-size: 11px;
  color: #9aa8b5;
}
.component-figure { margin: 10px 0 6px; }
.component-figure img { max-width: 320px; }

/* 代码 */
pre {
  font-family: var(--sw-mono);
  font-size: 12px;
  line-height: 1.6;
  background: #f7f9fb;
  border: 1px solid var(--sw-border);
  border-left: 3px solid #9fb6c9;
  padding: 12px 14px;
  margin: 10px 0 18px;
  overflow-x: auto;
  color: #24323f;
  tab-size: 4;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

details.source {
  border: 1px solid var(--sw-border);
  background: #fbfcfd;
  margin: 14px 0 20px;
}
details.source > summary {
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-navy);
  background: #eef3f8;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.source > summary::-webkit-details-marker { display: none; }
details.source > summary::before {
  content: "＋";
  font-weight: 700;
  color: var(--sw-blue);
  font-size: 12px;
}
details.source[open] > summary::before { content: "－"; }
details.source > summary:hover { background: #e4eef7; }
details.source pre { margin: 0; border: 0; border-top: 1px solid var(--sw-border); max-height: 560px; }

/* 表格内代码块 */
pre.inline-pre {
  margin: 0;
  border: 0;
  border-left: 2px solid #dbe4ec;
  background: #f9fbfc;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  max-height: 190px;
}
td pre.inline-pre { overflow: auto; }

.lead {
  font-size: 15px;
  line-height: 1.8;
  color: #2f4050;
  margin-bottom: 18px;
}

.muted { color: var(--sw-text-soft); }

/* 更新日志 */
.changelog {
  border-left: 2px solid #dbe4ec;
  margin: 18px 0 0 6px;
  padding-left: 20px;
}
.release {
  position: relative;
  padding: 0 0 20px;
  margin-bottom: 6px;
}
.release::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #9db8cd;
}
.release:first-child::before { border-color: var(--sw-blue); background: var(--sw-blue); }
.release h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.release .ver { color: var(--sw-navy); font-weight: 700; }
.release .date {
  font-size: 12px;
  font-weight: 400;
  color: #8a97a4;
  font-family: var(--sw-mono);
}
.release .kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #6c8196;
  margin: 8px 0 2px;
}
.release .kicker + ul { margin-top: 0; }
.release ul { margin-bottom: 6px; font-size: 12.8px; }
.release li { margin: 2px 0; }

/* API 函数表 */
table.api-table td:first-child { width: 34%; }
table.api-table td:first-child code { background: none; border: 0; padding: 0; color: #0f4c75; font-weight: 600; font-size: 12px; }
table.api-table td:nth-child(2) { width: 30%; color: #4a5866; }

/* 上一条 / 下一条 */
.sw-page-nav {
  display: flex;
  gap: 14px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--sw-border);
}
.sw-page-nav a {
  flex: 1 1 0;
  border: 1px solid var(--sw-border);
  background: var(--sw-bg-soft);
  padding: 10px 14px;
  display: block;
  color: var(--sw-text);
  min-width: 0;
}
.sw-page-nav a:hover { border-color: var(--sw-blue-light); background: #f1f7fc; text-decoration: none; }
.sw-page-nav .dir { font-size: 11px; color: #8a97a4; display: block; letter-spacing: .4px; }
.sw-page-nav .ttl { color: var(--sw-blue); font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-page-nav .next { text-align: right; }

/* 页脚 */
.sw-footer {
  margin-top: 40px;
  border-top: 1px solid var(--sw-border);
  padding: 16px 0 0;
  font-size: 11.5px;
  color: #8a97a4;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.sw-footer a { color: #8a97a4; }

/* 回到顶部 */
#sw-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--sw-border);
  background: #fff;
  color: var(--sw-navy);
  box-shadow: 0 2px 8px rgba(20, 40, 70, .16);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#sw-top.show { display: flex; }
#sw-top:hover { background: var(--sw-navy); color: #fff; }
#sw-top svg { width: 16px; height: 16px; }

/* 图片放大 */
#sw-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 22, 33, .88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 30px;
  cursor: zoom-out;
}
#sw-lightbox.open { display: flex; }
#sw-lightbox img {
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
#sw-lightbox .hint {
  position: absolute;
  bottom: 18px;
  color: #cfd8e3;
  font-size: 12px;
}

/* 搜索结果面板 */
.sw-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #b9c6d4;
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(20, 40, 70, .18);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 70;
}
.sw-results.open { display: block; }
.sw-results .empty { padding: 12px 14px; color: #8a97a4; font-size: 12.5px; }
.sw-results a {
  display: block;
  padding: 7px 14px;
  border-bottom: 1px solid var(--sw-border-soft);
  color: var(--sw-text);
  font-size: 12.5px;
  line-height: 1.5;
}
.sw-results a:hover, .sw-results a.sel { background: #eaf3fb; text-decoration: none; }
.sw-results a .ctx {
  display: block;
  font-size: 10.5px;
  color: #93a1ae;
  line-height: 1.4;
}
.sw-results a .snip { display: block; font-size: 11px; color: #8a97a4; line-height: 1.5; margin-top: 1px; }
.sw-results a b { color: var(--sw-blue); }

/* 隐藏 search 类型的原生清除按钮，避免与快捷键提示重叠 */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* 移动端 */
.sw-menu-btn {
  display: none;
  border: 1px solid var(--sw-border);
  background: #fff;
  border-radius: 3px;
  width: 34px; height: 32px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sw-navy);
  flex: none;
}
.sw-menu-btn svg { width: 17px; height: 17px; }
#sw-scrim { display: none; }

@media (max-width: 1080px) {
  .sw-main { padding: 0 26px 70px; }
  .sw-product { display: none; }
}

@media (max-width: 860px) {
  .sw-menu-btn { display: inline-flex; }
  .sw-header-links { display: none; }
  .sw-nav {
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: 300px;
    box-shadow: 4px 0 20px rgba(20, 40, 70, .18);
  }
  body.nav-open .sw-nav { transform: none; }
  body.nav-open #sw-scrim {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(15, 26, 38, .35);
    z-index: 35;
  }
  .sw-main { margin-left: 0; padding: 0 16px 60px; }
  h1.topic-title { font-size: 21px; }
  .sw-page-nav { flex-direction: column; }
  .sw-search { flex: 1 1 auto; }
}

/* 打印 */
@media print {
  .sw-header, .sw-nav, #sw-top, #sw-lightbox, .sw-page-nav, .sw-footer { display: none !important; }
  .sw-main { margin: 0; padding: 0; }
  .sw-content { max-width: none; }
  h1.topic-title, h2, .topic-meta { border-color: #666; }
  a { color: #000; }
  table, figure, pre { page-break-inside: avoid; }
  details.source > summary { display: none; }
  details.source pre { max-height: none; }
}

@media print {
  .sw-crumbs { position: static; }
}
