/* MaxStudio 使用文档样式 — 自洽（不依赖主站 style.css），骨架学 MaxTerm web/help/help.css */

:root {
  --violet: #6d5bd6;
  --blue: #6d5bd6;          /* 文档链接 / TOC 高亮：用品牌紫 */
  --blue-deep: #14132b;     /* 顶栏底色 */
  --green: #22a06b;         /* 提示块 */
  --accent: #7c5cfc;        /* TOC 选中左边框 */
  --dim: #8a8da3;
  --text: #14132b;
  --text-2: #4a4d68;
  --bg: #fbfbfd;
  --bg-soft: #f4f4fb;
  --card: #ffffff;
  --line: #e6e6f0;
  --line-soft: #eeeef6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Helvetica, sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.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; font-weight: 700;
}
.doc-header a.brand:hover { opacity: 1; text-decoration: none; }
.doc-header .brand img { height: 24px; border-radius: 6px; }
.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; align-items: center; gap: 1.2rem; }
.doc-header .links a {
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.doc-header .links a:hover { color: #fff; text-decoration: none; }
.doc-header .links a.dl {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--violet); color: #fff; font-weight: 600;
  padding: 0.4rem 0.95rem; border-radius: 8px;
}
.doc-header .links a.dl:hover { background: #5a48c4; color: #fff; }

/* 主区: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(--violet); background: var(--bg-soft);
  text-decoration: none;
}
.toc a.active {
  color: var(--violet); 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);
}

/* 文档大标题区 + 速跳 */
.doc-lead {
  margin-bottom: 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.doc-lead h1 {
  font-size: 30px; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 0.5rem;
}
.doc-lead p { font-size: 15px; color: var(--text-2); margin: 0 0 1.1rem; }
.doc-lead .quick-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.doc-lead .quick-jump a {
  font-size: 13px; font-weight: 600; color: var(--violet);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 0.3rem 0.85rem; border-radius: 999px;
}
.doc-lead .quick-jump a:hover {
  background: #fff; border-color: var(--violet); text-decoration: none;
}
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 .tag-new {
  display: inline-block; vertical-align: 3px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  padding: 1px 8px; border-radius: 999px; margin-left: 0.5rem;
}
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(--violet);
  border-bottom: 1px dotted rgba(109,91,214,0.35);
}
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(--violet);
  border: 1px solid var(--line-soft);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
article.doc pre {
  background: #0f1f3d; color: #c0caf5;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin: 0.8rem 0;
  font-size: 13px; line-height: 1.6;
  overflow-x: auto;
  position: relative;
}
article.doc pre code {
  background: none; padding: 0; border: 0;
  color: inherit; font-size: inherit;
}
article.doc pre .copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.1); color: #fff;
  border: 0; padding: 0.25rem 0.6rem;
  border-radius: 4px; font-size: 11px; 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 {
  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 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(124,92,252,0.18); }
  100% { background: transparent; }
}

/* 页脚 */
.doc-foot {
  border-top: 1px solid var(--line);
  margin-top: 3rem; padding-top: 1.4rem;
  font-size: 13px; color: var(--dim);
}
.doc-foot a { color: var(--violet); }

/* 响应式 */
@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; }
}
