:root {
  --font-body: "Noto Sans SC", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-heading: "Noto Serif SC", "Source Serif Pro", Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --text: #142230;
  --muted: #5e6b79;
  --border: #d8e0e8;
  --accent: #0f766e;
  --accent-weak: #e8f5f3;
  --shell: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #e7f4f9 0, var(--bg) 42%);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.docs-shell {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
}

.i18n-zh,
.i18n-en {
  display: inline;
}

body[data-lang="zh"] .i18n-en {
  display: none;
}

body[data-lang="en"] .i18n-zh {
  display: none;
}

.docs-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.docs-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 74px;
}

.docs-logo {
  font-family: var(--font-heading);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.docs-logo:hover {
  text-decoration: none;
}

.docs-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.docs-nav-link {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.docs-nav-link:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--surface);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
}

.lang-link:hover {
  text-decoration: none;
}

.lang-link.active {
  color: #ffffff;
  background: var(--accent);
}

.docs-main {
  padding: 28px 0 56px;
}

.docs-hero {
  background: linear-gradient(145deg, #ffffff, #eef7f6);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
}

.docs-kicker {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.docs-hero h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.docs-hero-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.docs-list {
  margin-top: 24px;
}

.docs-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.docs-section-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.48rem;
}

.docs-taxonomy {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-grid {
  display: grid;
  gap: 14px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.doc-card-link {
  display: block;
  padding: 20px;
  color: inherit;
}

.doc-card-link:hover {
  text-decoration: none;
}

.doc-card h3 {
  margin: 0;
  font-size: 1.22rem;
  font-family: var(--font-heading);
  line-height: 1.25;
}

.doc-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.doc-card-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.docs-empty {
  display: none;
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--muted);
}

.docs-empty.visible {
  display: block;
}

.docs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.page-numbers {
  display: inline-flex;
  gap: 6px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--surface);
}

.page-link.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.page-link.disabled {
  opacity: 0.45;
}

.docs-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(18px, 3.5vw, 42px);
}

.docs-article-head h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.15;
}

.docs-article-excerpt {
  margin: 12px 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.docs-meta {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.docs-cover {
  margin: 22px 0 0;
  border-radius: 14px;
  overflow: hidden;
}

.docs-content {
  margin-top: 24px;
  font-size: 1.03rem;
}

.docs-content h2 {
  margin: 2em 0 0.55em;
  font-family: var(--font-heading);
  font-size: 1.68rem;
  line-height: 1.25;
}

.docs-content h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.3rem;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  margin: 0 0 1em;
}

.docs-content pre {
  margin: 1em 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  font-family: var(--font-mono);
}

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

.docs-content blockquote {
  margin: 1em 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-weak);
  border-radius: 6px;
}

.docs-article-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.docs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-tag {
  color: var(--accent);
  font-size: 0.88rem;
}

.docs-post-nav {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.docs-post-link {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
}

.docs-post-link:hover {
  color: var(--accent);
  text-decoration: none;
  border-color: var(--accent);
}

.paid-content-gate {
  margin: 1.2em 0;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  background: var(--accent-weak);
}

.paid-cta {
  display: inline-flex;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.paid-cta:hover {
  color: #fff;
  text-decoration: none;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.2em 0;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.docs-footer {
  border-top: 1px solid var(--border);
  background: #f9fcfd;
}

.docs-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  color: var(--muted);
  font-size: 0.9rem;
}

.docs-footer-copy,
.docs-footer-meta {
  margin: 0;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .docs-header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .docs-logo {
    font-size: 1.2rem;
  }

  .docs-nav {
    order: 3;
  }

  .lang-switch {
    justify-self: start;
  }

  .docs-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0;
  }

  .docs-post-nav {
    flex-direction: column;
  }
}
