:root {
  --docs-bg: #f6f7f9;
  --docs-panel: #fff;
  --docs-text: #1a1a2e;
  --docs-muted: #5c5f7a;
  --docs-accent: #2563eb;
  --docs-border: #e2e5ef;
  --docs-nav-w: 280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--docs-text);
  background: var(--docs-bg);
}

.docs-layout {
  display: flex;
  min-height: 100vh;
}

.docs-nav {
  width: var(--docs-nav-w);
  flex-shrink: 0;
  background: var(--docs-panel);
  border-right: 1px solid var(--docs-border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}

.docs-nav a {
  color: var(--docs-muted);
  text-decoration: none;
  display: block;
  padding: 0.35rem 1.25rem;
  font-size: 14px;
}

.docs-nav a:hover,
.docs-nav a.active {
  color: var(--docs-accent);
}

.docs-nav .nav-title {
  font-weight: 600;
  color: var(--docs-text);
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-nav .nav-home {
  font-weight: 600;
  color: var(--docs-text);
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--docs-border);
  margin-bottom: 0.5rem;
}

.docs-nav .nav-home a {
  color: var(--docs-accent);
  padding: 0;
}

.docs-content {
  flex: 1;
  min-width: 0; /* flex 子项默认可溢出；配合下方横幅不「破栏」避免盖住侧栏 */
  padding: 2rem 3rem 4rem;
  max-width: 860px;
}

.docs-content h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

/* 横幅限制在主栏内，不向左侧「破栏」，避免动图被 sticky 侧栏压住或裁切 */
.docs-hero-banner {
  margin: 1.25rem 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--docs-border);
  line-height: 0;
  background: var(--docs-panel);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  max-height: min(78vh, 710px);
  max-height: min(78dvh, 710px);
}

.docs-hero-banner img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(78vh, 710px);
  max-height: min(78dvh, 710px);
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.docs-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--docs-border);
}

.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-content h3,
.docs-content h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
}

.docs-content p,
.docs-content li {
  margin: 0.5rem 0;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.35rem;
}

.docs-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 14px;
}

.docs-banner.warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.docs-banner a {
  color: var(--docs-accent);
}

@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
  }

  .docs-nav {
    width: 100%;
    max-height: none;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--docs-border);
  }

  .docs-content {
    padding: 1.5rem 1.25rem 3rem;
  }

  .docs-hero-banner {
    width: 100%;
    margin-left: 0;
    max-height: min(52vh, 420px);
    max-height: min(52dvh, 420px);
  }

  .docs-hero-banner img {
    max-height: min(52vh, 420px);
    max-height: min(52dvh, 420px);
  }
}
