/* MaxTerm 帮助文档专属样式 — 跟主站 style.css 共用变量 */

/* 顶栏 */
.doc-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--blue-deep); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.8rem 1.5rem;
}
.doc-header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
}
.doc-header a.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: #fff; opacity: 0.9; text-decoration: none;
}
.doc-header a.brand:hover { opacity: 1; text-decoration: none; }
.doc-header .brand img { height: 18px; }
.doc-header .crumb {
  font-size: 13px; color: rgba(255,255,255,0.55);
}
.doc-header .crumb .sep { margin: 0 0.4rem; opacity: 0.4; }
.doc-header .links { margin-left: auto; display: flex; gap: 1.2rem; }
.doc-header .links a {
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.doc-header .links a:hover { color: var(--green); text-decoration: none; }

/* 主区:2 列 */
.doc-wrap {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding: 2rem 1.5rem 4rem;
}
.doc-wrap aside.toc {
  position: sticky; top: 70px; align-self: start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 0.5rem;
}
.toc h4 {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--dim); margin-bottom: 0.6rem;
}
.toc ul { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.35rem 0.7rem;
  font-size: 13.5px; color: var(--text-2);
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.toc a:hover {
  color: var(--blue); background: var(--bg-soft);
  text-decoration: none;
}
.toc a.active {
  color: var(--blue); border-left-color: var(--accent);
  background: var(--bg-soft); font-weight: 600;
}
.toc ul ul { margin: 0.1rem 0 0.3rem 0.5rem; }
.toc ul ul a { font-size: 12.5px; padding: 0.25rem 0.7rem; }

/* 文档内容 */
article.doc {
  min-width: 0;
  max-width: 760px;
  font-size: 15px; line-height: 1.75;
  color: var(--text-2);
}
article.doc h2 {
  font-size: 28px; font-weight: 700; color: var(--text);
  margin-top: 3rem;
  padding-top: 1rem;
  scroll-margin-top: 70px;
}
article.doc h2:first-child { margin-top: 0; padding-top: 0; }
article.doc h3 {
  font-size: 19px; font-weight: 700; color: var(--text);
  margin-top: 2rem; margin-bottom: 0.6rem;
  scroll-margin-top: 70px;
}
article.doc h4 {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-top: 1.4rem; margin-bottom: 0.4rem;
}
article.doc p { margin: 0.7rem 0; }
article.doc ul, article.doc ol {
  margin: 0.6rem 0 1rem 1.4rem;
}
article.doc li { margin: 0.3rem 0; }
article.doc strong { color: var(--text); font-weight: 600; }
article.doc a {
  color: var(--blue);
  border-bottom: 1px dotted rgba(26,72,148,0.3);
}
article.doc a:hover { border-bottom-style: solid; text-decoration: none; }
article.doc code {
  background: var(--bg-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--blue);
  border: 1px solid var(--line-soft);
}
article.doc pre {
  background: #0f1f3d; color: #c0caf5;
  padding: 0.7rem 0.8rem 0.7rem 1.1rem;
  border-radius: 8px;
  margin: 0.8rem 0;
  font-size: 14px; line-height: 1.7;
  display: flex; align-items: center; gap: 0.9rem;
}
article.doc pre code {
  flex: 1; min-width: 0;
  background: none; padding: 0; border: 0;
  color: inherit; font-size: inherit;
  white-space: pre; overflow-x: auto;
}
article.doc pre .copy {
  flex-shrink: 0;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 0; padding: 0.35rem 0.9rem;
  border-radius: 5px; font-size: 12px; cursor: pointer;
}
article.doc pre .copy:hover { background: rgba(255,255,255,0.2); }
article.doc kbd {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: "SF Mono", Menlo, monospace;
  color: var(--text);
  vertical-align: 1px;
}
article.doc blockquote {
  display: block;        /* override global .warn{display:flex} from ../style.css */
  margin: 1rem 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--green);
  background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text-2);
}
article.doc blockquote.tip { border-color: var(--green); }
article.doc blockquote.warn { border-color: #f0b429; background: #fff8e6; color: #6b4a00; }
article.doc blockquote.danger { border-color: #d93838; background: #fdecec; color: #7a1818; }
article.doc blockquote strong { color: inherit; }
article.doc blockquote > p:first-child { margin-top: 0; }
article.doc blockquote > p:last-child { margin-bottom: 0; }
article.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 13.5px;
}
article.doc table th, article.doc table td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}
article.doc table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
}
article.doc table tr:hover td { background: var(--bg-soft); }
article.doc img { max-width: 100%; border-radius: 6px; margin: 0.6rem 0; }
article.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* 章节锚点跳转高亮 */
article.doc h2:target, article.doc h3:target {
  animation: anchor-flash 1.2s ease;
}
@keyframes anchor-flash {
  0% { background: rgba(255,122,61,0.18); }
  100% { background: transparent; }
}

/* 响应式 */
@media (max-width: 880px) {
  .doc-wrap { grid-template-columns: 1fr; gap: 1rem; padding: 1.2rem 1rem 3rem; }
  .doc-wrap aside.toc {
    position: relative; top: 0; max-height: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
  }
  .doc-header .crumb { display: none; }
}
