:root {
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --muted-2: rgba(255, 255, 255, 0.54);
  --accent: #7c3aed;
  --accent-2: #22c55e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(1100px 600px at 12% 8%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(900px 520px at 92% 6%, rgba(34, 197, 94, 0.14), transparent 60%),
    radial-gradient(900px 520px at 60% 90%, rgba(59, 130, 246, 0.12), transparent 60%), var(--bg);
  position: relative;
}

/* Canvas 动态背景（更易控性能；不影响正文交互） */
.bgcanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
  opacity: 0.95;
}

code {
  font-family: var(--mono);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(11, 18, 32, 0.65);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.brand__title {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 16px;
  line-height: 1.2;
}

.brand__subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.iconbtn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  cursor: pointer;
}

.iconbtn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.iconbtn__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  margin: 4px auto;
  border-radius: 2px;
}

.shell {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 320px 1fr;
  position: relative;
  z-index: 1;
}

.nav {
  height: 100%;
  overflow: auto;
  border-right: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.nav__section {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav__section--list {
  padding: 12px 10px 18px;
}

.nav__footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.muted {
  color: var(--muted-2);
  font-size: 12px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.seg__btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.seg__btn[aria-selected="true"] {
  border-color: rgba(124, 58, 237, 0.55);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.35), rgba(124, 58, 237, 0.14));
}

.seg__btn:focus-visible,
.field__input:focus-visible,
.navitem:focus-visible,
.copybtn:focus-visible,
.chip:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.8);
  outline-offset: 2px;
}

.field__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.field__input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.92);
}

.navgroup {
  padding: 6px 6px 10px;
}

.navgroup__title {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 10px 8px;
  letter-spacing: 0.2px;
  text-transform: none;
}

.navitem {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.navitem:hover {
  background: rgba(255, 255, 255, 0.04);
}

.navitem--active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 58, 237, 0.35);
}

.navitem__title {
  font-weight: 700;
  font-size: 13px;
}

.navitem__desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.main {
  height: 100%;
  overflow: auto;
}

.doc {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.hero {
  padding: 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.hero__kicker {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.hero__title {
  margin: 8px 0 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.hero__desc {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 12px;
}

.chip__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.06);
}

.section {
  margin-top: 18px;
  padding: 18px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

.section h2 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.section p,
.section li {
  color: rgba(255, 255, 255, 0.83);
  line-height: 1.75;
}

.section ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

/* 文档插图/图注（用于 Pipeline/Runner 示意图等） */
.figure {
  margin: 12px 0 0;
}

.docimg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
}

.figcap {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

pre {
  margin: 12px 0 0;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  overflow: auto;
  position: relative;
}

pre code {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
}

/* highlight.js 主题兼容：保持我们自己的 pre 背景与 padding */
pre code.hljs {
  background: transparent;
  padding: 0;
}

.copybtn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  padding: 6px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.copybtn:hover {
  background: rgba(255, 255, 255, 0.10);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .iconbtn {
    display: inline-block;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    width: min(92vw, 360px);
    transform: translateX(-105%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
    z-index: 30;
  }

  .nav--open {
    transform: translateX(0);
  }
}


