/* ============================================================
   Quick Build WP 官方文档 — 样式表
   风格参考 docs.vxras.com（Fumadocs / shadcn 设计体系）
   ============================================================ */

:root {
  --fd-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --fd-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Light */
  --fd-background: #f5f5f5;
  --fd-foreground: #0a0a0a;
  --fd-muted: #f5f5f5;
  --fd-muted-foreground: #737373;
  --fd-popover: #fafafa;
  --fd-popover-foreground: #272727;
  --fd-card: #f1f1f1;
  --fd-card-foreground: #0a0a0a;
  --fd-border: #cccccc80;
  --fd-primary: #18181b;
  --fd-primary-foreground: #fafafa;
  --fd-secondary: #ededed;
  --fd-secondary-foreground: #171717;
  --fd-accent: #d1d1d180;
  --fd-accent-foreground: #171717;
  --fd-ring: #a3a3a3;
  --fd-overlay: #0003;

  --fd-info: #2563eb;
  --fd-warning: #d97706;
  --fd-error: #dc2626;
  --fd-success: #16a34a;

  --fd-navbar-height: 3.5rem;
  --fd-sidebar-width: 16rem;
  --fd-toc-width: 16.75rem;
  --fd-brand: #2563eb;
  --fd-brand-2: #7c3aed;
}

.dark {
  --fd-background: #121212;
  --fd-foreground: #ebebeb;
  --fd-muted: #212121;
  --fd-muted-foreground: #b3b3b3cc;
  --fd-popover: #1e1e1e;
  --fd-popover-foreground: #dedede;
  --fd-card: #191919;
  --fd-card-foreground: #fafafa;
  --fd-border: #6663;
  --fd-primary: #fafafa;
  --fd-primary-foreground: #18181b;
  --fd-secondary: #212121;
  --fd-secondary-foreground: #ebebeb;
  --fd-accent: #6868684d;
  --fd-accent-foreground: #e6e6e6;
  --fd-ring: #8c8c8c;

  --fd-info: #60a5fa;
  --fd-warning: #fbbf24;
  --fd-error: #f87171;
  --fd-success: #4ade80;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.fd-body {
  margin: 0;
  min-height: 100vh;
  background: var(--fd-background);
  color: var(--fd-foreground);
  font-family: var(--fd-font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button {
  font-family: inherit;
}

/* ---------- 顶部导航 ---------- */

.fd-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--fd-navbar-height);
  border-bottom: 1px solid var(--fd-border);
  background: color-mix(in srgb, var(--fd-background) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fd-navbar-inner {
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.fd-navbar-left,
.fd-navbar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.fd-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.375rem;
  font-weight: 600;
  white-space: nowrap;
}

.fd-brand-logo {
  width: auto;
  height: 1.75rem;
  max-width: 10rem;
  object-fit: contain;
}

.fd-nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: 0.75rem;
}

.fd-nav-links a {
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--fd-muted-foreground);
  transition: color 0.15s, background-color 0.15s;
}

.fd-nav-links a:hover {
  color: var(--fd-foreground);
  background: var(--fd-accent);
}

.fd-nav-links a.active {
  color: var(--fd-foreground);
  font-weight: 500;
}

.fd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--fd-muted-foreground);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.fd-icon-btn:hover {
  color: var(--fd-foreground);
  background: var(--fd-accent);
}

.fd-search-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.375rem;
  background: var(--fd-secondary);
  color: var(--fd-muted-foreground);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.fd-search-hint:hover {
  background: var(--fd-accent);
  color: var(--fd-foreground);
}

.fd-search-hint .kbd {
  margin-left: 0.25rem;
  padding: 0 0.375rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.25rem;
  background: var(--fd-background);
  font-size: 0.6875rem;
}

/* ---------- 文档布局 ---------- */

.fd-layout {
  display: grid;
  grid-template-columns: var(--fd-sidebar-width) minmax(0, 1fr);
  padding-top: var(--fd-navbar-height);
  min-height: calc(100vh - var(--fd-navbar-height));
}

.fd-sidebar {
  position: sticky;
  top: var(--fd-navbar-height);
  height: calc(100vh - var(--fd-navbar-height));
  overflow-y: auto;
  border-right: 1px solid var(--fd-border);
  padding: 1rem 0.75rem 1.5rem;
  background: var(--fd-background);
  scrollbar-width: thin;
}

.fd-sidebar-group {
  margin-bottom: 1rem;
}

/* 一级:分组标题(可折叠) */
.fd-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fd-foreground);
}

.fd-sidebar-title .fd-chev {
  font-size: 0.875rem;
  color: var(--fd-muted-foreground);
  transition: transform 0.15s ease;
}

.fd-sidebar-title.fd-collapsed .fd-chev {
  transform: rotate(-90deg);
}

/* 二级:子分组标题(可折叠) */
.fd-sidebar-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.3rem 0.5rem 0.3rem 0.9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fd-muted-foreground);
}

.fd-sidebar-subtitle .fd-chev {
  font-size: 0.625rem;
  transition: transform 0.15s ease;
}

.fd-sidebar-subtitle:not(.fd-open) .fd-chev {
  transform: rotate(-90deg);
}

.fd-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 三级子菜单 */
.fd-sidebar ul.fd-sidebar-sub {
  display: none;
  margin: 0.125rem 0 0.25rem 1.05rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--fd-border);
}

.fd-sidebar ul.fd-sidebar-sub.fd-open {
  display: block;
}

.fd-sidebar ul.fd-collapsed {
  display: none;
}

.fd-sidebar li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--fd-muted-foreground);
  transition: color 0.15s, background-color 0.15s;
}

.fd-sidebar ul.fd-sidebar-sub li a {
  font-size: 0.8125rem;
}

.fd-sidebar li a i {
  width: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.85;
}

.fd-sidebar li a:hover {
  color: var(--fd-foreground);
  background: var(--fd-accent);
}

.fd-sidebar li a.fd-active {
  background: var(--fd-accent);
  color: var(--fd-accent-foreground);
  font-weight: 500;
}

.fd-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--fd-navbar-height) 0 0 0;
  z-index: 30;
  background: var(--fd-overlay);
}

/* ---------- 正文 ---------- */

.fd-main {
  min-width: 0;
}

.fd-article {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

@media (min-width: 768px) {
  .fd-article {
    padding: 2rem 1.5rem 4rem;
  }
}

@media (min-width: 1280px) {
  .fd-article {
    padding: 3.5rem 2rem 5rem;
  }
}

.fd-article h1 {
  margin: 0;
  font-size: 1.75em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.fd-lead {
  margin: 0;
  font-size: 1.125rem;
  color: var(--fd-muted-foreground);
}

.fd-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--fd-border);
}

.fd-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.375rem;
  background: var(--fd-secondary);
  color: var(--fd-secondary-foreground);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.fd-chip-btn:hover {
  background: var(--fd-accent);
  color: var(--fd-accent-foreground);
}

.fd-chip-btn i {
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
}

/* ---------- 文章排版 ---------- */

.fd-prose {
  flex: 1;
  min-width: 0;
}

.fd-prose h2,
.fd-prose h3 {
  scroll-margin-top: calc(var(--fd-navbar-height) + 1.5rem);
}

.fd-prose h2 {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 2.25rem 0 1rem;
  font-size: 1.3em;
  font-weight: 600;
}

.fd-prose h2:first-child {
  margin-top: 0.25rem;
}

.fd-prose h2 .fd-anchor {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 0.25rem;
  color: var(--fd-muted-foreground);
  font-size: 0.8125rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.fd-prose h2:hover .fd-anchor {
  opacity: 1;
}

.fd-prose h2 .fd-anchor:hover {
  background: var(--fd-accent);
  color: var(--fd-accent-foreground);
}

.fd-prose h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.1em;
  font-weight: 600;
}

.fd-prose p {
  margin: 0.875rem 0;
}

.fd-prose ul,
.fd-prose ol {
  margin: 0.875rem 0;
  padding-left: 1.5rem;
}

.fd-prose li {
  margin: 0.375rem 0;
}

.fd-prose li > ul,
.fd-prose li > ol {
  margin: 0.25rem 0;
}

.fd-prose code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--fd-border);
  border-radius: 0.375rem;
  background: var(--fd-secondary);
  font-family: var(--fd-font-mono);
  font-size: 0.85em;
}

.fd-prose strong {
  font-weight: 600;
}

.fd-prose a:not(.fd-card):not(.fd-chip-btn) {
  color: var(--fd-info);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.fd-prose a:not(.fd-card):not(.fd-chip-btn):hover {
  border-bottom-color: currentColor;
}

.fd-prose hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--fd-border);
}

/* 代码块 */

.fd-code-block {
  margin: 1rem 0;
  border: 1px solid var(--fd-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--fd-secondary);
}

.fd-code-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--fd-border);
  font-size: 0.75rem;
  color: var(--fd-muted-foreground);
  font-family: var(--fd-font-mono);
}

.fd-code-title i {
  font-size: 0.6875rem;
}

.fd-code-block pre {
  margin: 0;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  font-family: var(--fd-font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--fd-foreground);
}

.fd-code-block pre code {
  padding: 0;
  border: none;
  background: transparent;
  font-size: inherit;
  font-family: inherit;
}

/* 表格 */

.fd-table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid var(--fd-border);
  border-radius: 0.5rem;
}

.fd-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.fd-table-wrap thead th {
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
  background: var(--fd-secondary);
  border-bottom: 1px solid var(--fd-border);
  white-space: nowrap;
}

.fd-table-wrap tbody td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--fd-border);
  vertical-align: top;
}

.fd-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.fd-table-wrap tbody tr:hover td {
  background: color-mix(in srgb, var(--fd-accent) 40%, transparent);
}

.fd-table-wrap td code {
  white-space: nowrap;
}

/* 提示框 */

.fd-callout {
  display: flex;
  gap: 0.625rem;
  margin: 1rem 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.5rem;
  background: var(--fd-card);
  font-size: 0.875rem;
}

.fd-callout i {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.fd-callout-body {
  min-width: 0;
}

.fd-callout-body p {
  margin: 0 0 0.375rem;
}

.fd-callout-body p:last-child {
  margin-bottom: 0;
}

.fd-callout-title {
  font-weight: 600;
}

.fd-callout-info > i,
.fd-callout-info .fd-callout-title {
  color: var(--fd-info);
}

.fd-callout-warning > i,
.fd-callout-warning .fd-callout-title {
  color: var(--fd-warning);
}

.fd-callout-danger > i,
.fd-callout-danger .fd-callout-title {
  color: var(--fd-error);
}

.fd-callout-success > i,
.fd-callout-success .fd-callout-title {
  color: var(--fd-success);
}

/* 步骤列表 */

.fd-steps {
  list-style: none;
  counter-reset: fd-step;
  padding-left: 0;
  margin: 1rem 0;
}

.fd-steps li {
  position: relative;
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0;
  counter-increment: fd-step;
}

.fd-steps li::before {
  content: counter(fd-step);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.125rem;
  border: 1px solid var(--fd-border);
  border-radius: 9999px;
  background: var(--fd-card);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fd-muted-foreground);
}

.fd-steps li > div {
  min-width: 0;
}

.fd-steps li p {
  margin: 0.125rem 0;
}

/* 卡片网格 */

.fd-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

@media (max-width: 640px) {
  .fd-cards {
    grid-template-columns: 1fr;
  }
}

.fd-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.75rem;
  background: var(--fd-card);
  color: var(--fd-card-foreground);
  transition: background-color 0.15s;
}

.fd-card:hover {
  background: color-mix(in srgb, var(--fd-accent) 80%, transparent);
}

.fd-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.fd-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
}

.fd-card-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.625rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.5rem;
  background: var(--fd-secondary);
  color: var(--fd-muted-foreground);
  font-size: 0.875rem;
}

/* ---------- 服务器推广横幅 / 推广卡片 ---------- */

.fd-promo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  color: #fff;
}

.fd-promo-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.25rem;
}

.fd-promo-body {
  flex: 1;
  min-width: 0;
}

.fd-promo-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.fd-promo-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 400;
  opacity: 0.95;
}

.fd-promo-body p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.92;
}

.fd-promo-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5625rem 1.125rem;
  border-radius: 9999px;
  background: #fff;
  color: var(--fd-brand);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fd-promo-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.35);
}

@media (max-width: 640px) {
  .fd-promo {
    flex-direction: column;
    align-items: flex-start;
  }

  .fd-promo-btn {
    width: 100%;
    justify-content: center;
  }
}

.fd-card.fd-card-promo {
  position: relative;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  border-color: transparent;
  color: #fff;
}

.fd-card.fd-card-promo:hover {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--fd-brand) 86%, #000),
    color-mix(in srgb, var(--fd-brand-2) 86%, #000)
  );
}

.fd-card.fd-card-promo .fd-card-icon {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.fd-card.fd-card-promo p {
  color: rgba(255, 255, 255, 0.88);
}

.fd-card.fd-card-promo .fd-promo-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.fd-card.fd-card-promo h3 {
  padding-right: 2.5rem;
}

/* 上下页 */

.fd-pagination {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.fd-pagination a {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: background-color 0.15s;
}

.fd-pagination a:hover {
  background: color-mix(in srgb, var(--fd-accent) 80%, transparent);
  color: var(--fd-accent-foreground);
}

.fd-pagination a.next {
  align-items: flex-end;
  text-align: right;
}

.fd-pagination .fd-pg-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.fd-pagination a.next .fd-pg-label {
  flex-direction: row-reverse;
}

.fd-pagination .fd-pg-desc {
  color: var(--fd-muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.fd-last-updated {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--fd-border);
  font-size: 0.75rem;
  color: var(--fd-muted-foreground);
}

/* ---------- 右侧目录 ---------- */

.fd-toc {
  display: none;
  position: sticky;
  top: var(--fd-navbar-height);
  height: calc(100vh - var(--fd-navbar-height));
  overflow-y: auto;
  padding: 3rem 1rem 1rem 0;
  scrollbar-width: thin;
}

@media (min-width: 1280px) {
  .fd-toc {
    display: block;
    width: var(--fd-toc-width);
  }

  .fd-layout-has-toc {
    grid-template-columns: var(--fd-sidebar-width) minmax(0, 1fr) var(--fd-toc-width);
  }
}

.fd-toc-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fd-muted-foreground);
}

.fd-toc ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.75rem;
  border-left: 1px solid var(--fd-border);
}

.fd-toc ul li {
  margin: 0.25rem 0;
}

.fd-toc ul li a {
  display: block;
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
  transition: color 0.15s;
}

.fd-toc ul li a:hover {
  color: var(--fd-foreground);
}

.fd-toc ul li a.fd-toc-active {
  color: var(--fd-foreground);
  font-weight: 500;
}

/* ---------- 首页 Landing ---------- */

.fd-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 7rem 1.5rem 4rem;
}

.fd-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--fd-border);
  border-radius: 9999px;
  background: var(--fd-card);
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
}

.fd-hero-badge i {
  color: var(--fd-success);
}

.fd-hero h1 {
  max-width: 52rem;
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.fd-hero h1 .fd-hero-gradient {
  background: linear-gradient(120deg, var(--fd-brand), var(--fd-brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fd-hero-lead {
  max-width: 40rem;
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--fd-muted-foreground);
}

.fd-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.fd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.fd-btn-sm {
  height: 2rem;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
}

.fd-btn-primary {
  background: var(--fd-primary);
  color: var(--fd-primary-foreground);
}

.fd-btn-primary:hover {
  opacity: 0.9;
}

.fd-btn-secondary {
  border: 1px solid var(--fd-border);
  background: var(--fd-secondary);
  color: var(--fd-secondary-foreground);
}

.fd-btn-secondary:hover {
  background: var(--fd-accent);
  color: var(--fd-accent-foreground);
}

.fd-hero-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 64rem;
  margin: 4rem auto 0;
  padding: 0 1.5rem;
  text-align: left;
}

@media (min-width: 1024px) {
  .fd-hero-features {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.fd-hero-features .fd-card {
  display: flex;
  flex-direction: column;
}

.fd-tech-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 48rem;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}

.fd-tech-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--fd-border);
  border-radius: 9999px;
  background: var(--fd-card);
  font-size: 0.75rem;
  color: var(--fd-muted-foreground);
  font-family: var(--fd-font-mono);
}

/* ---------- 页脚 ---------- */

.fd-footer {
  border-top: 1px solid var(--fd-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--fd-muted-foreground);
}

.fd-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.fd-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.15s;
}

.fd-footer-links a:hover {
  color: var(--fd-foreground);
}

.fd-footer p {
  margin: 0.375rem 0;
}

/* ---------- 搜索弹层 ---------- */

.fd-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 15vh 1rem 0;
  background: var(--fd-overlay);
  backdrop-filter: blur(2px);
}

.fd-search-overlay[hidden] {
  display: none !important;
}

.fd-search-dialog {
  width: 100%;
  max-width: 34rem;
  border: 1px solid var(--fd-border);
  border-radius: 0.75rem;
  background: var(--fd-popover);
  color: var(--fd-popover-foreground);
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.35);
  overflow: hidden;
}

.fd-search-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--fd-border);
}

.fd-search-input-row i {
  color: var(--fd-muted-foreground);
  font-size: 0.875rem;
}

.fd-search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.9375rem;
}

.fd-search-results {
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.375rem;
}

.fd-search-result {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.fd-search-result:hover,
.fd-search-result.selected {
  background: var(--fd-accent);
  color: var(--fd-accent-foreground);
}

.fd-search-result i {
  color: var(--fd-muted-foreground);
  font-size: 0.8125rem;
}

.fd-search-result .t {
  font-size: 0.875rem;
}

.fd-search-result .d {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--fd-muted-foreground);
}

.fd-search-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--fd-muted-foreground);
}

/* ---------- 移动端 ---------- */

.fd-sidebar-close {
  display: none;
}

@media (min-width: 768px) {
  .fd-navbar #sidebarToggle,
  .fd-navbar #searchOpen {
    display: none;
  }
}

@media (max-width: 767px) {
  .fd-sidebar {
    position: fixed;
    top: var(--fd-navbar-height);
    left: 0;
    bottom: 0;
    z-index: 50;
    width: var(--fd-sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 24px rgb(0 0 0 / 0.2);
  }

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

  .fd-sidebar-close {
    display: inline-flex;
    margin-bottom: 0.5rem;
  }

  .fd-layout,
  .fd-layout-has-toc {
    grid-template-columns: 1fr;
  }

  .fd-nav-links a:not(.keep) {
    display: none;
  }

  .fd-search-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ============================================================
   AI 问答助手（右下角悬浮）
   ============================================================ */

.fd-ai-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  color: #fff;
  font-size: 1.125rem;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
  box-shadow: 0 8px 24px -6px rgb(37 99 235 / 0.45);
  transition: transform 0.15s;
}

.fd-ai-fab:hover {
  transform: scale(1.06);
}

.fd-ai-fab.fd-ai-open {
  transform: scale(0);
}

.fd-ai-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(23rem, calc(100vw - 2rem));
  height: min(34rem, calc(100vh - 8rem));
  border: 1px solid var(--fd-border);
  border-radius: 0.875rem;
  background: var(--fd-popover);
  color: var(--fd-popover-foreground);
  box-shadow: 0 18px 48px -12px rgb(0 0 0 / 0.35);
  overflow: hidden;
}

.fd-ai-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--fd-border);
}

.fd-ai-head .fd-ai-ico {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
}

.fd-ai-head b {
  font-size: 0.875rem;
}

.fd-ai-head .fd-ai-tag {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--fd-border);
  border-radius: 9999px;
  font-size: 0.6875rem;
  color: var(--fd-muted-foreground);
}

.fd-ai-head button {
  border: none;
  background: transparent;
  color: var(--fd-muted-foreground);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-radius: 0.375rem;
}

.fd-ai-head button:hover {
  background: var(--fd-accent);
  color: var(--fd-foreground);
}

.fd-ai-note {
  padding: 0.375rem 0.75rem;
  border-bottom: 1px solid var(--fd-border);
  font-size: 0.6875rem;
  color: var(--fd-muted-foreground);
  background: var(--fd-secondary);
}

.fd-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--fd-border);
}

.fd-ai-chips button {
  border: 1px solid var(--fd-border);
  border-radius: 9999px;
  background: var(--fd-secondary);
  color: var(--fd-secondary-foreground);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.fd-ai-chips button:hover {
  background: var(--fd-accent);
}

.fd-ai-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  scrollbar-width: thin;
}

.fd-ai-msg {
  max-width: 88%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.65;
  word-break: break-word;
}

.fd-ai-msg.user {
  align-self: flex-end;
  background: var(--fd-primary);
  color: var(--fd-primary-foreground);
  border-bottom-right-radius: 0.25rem;
}

.fd-ai-msg.assistant {
  align-self: flex-start;
  background: var(--fd-secondary);
  color: var(--fd-secondary-foreground);
  border-bottom-left-radius: 0.25rem;
}

.fd-ai-msg.assistant p {
  margin: 0 0 0.375rem;
}

.fd-ai-msg.assistant p:last-child {
  margin-bottom: 0;
}

.fd-ai-msg.assistant ol,
.fd-ai-msg.assistant ul {
  margin: 0.25rem 0;
  padding-left: 1.125rem;
}

.fd-ai-msg.assistant code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--fd-border);
  border-radius: 0.25rem;
  background: var(--fd-background);
  font-family: var(--fd-font-mono);
  font-size: 0.85em;
}

.fd-ai-msg.loading i {
  animation: fd-ai-blink 1.1s ease-in-out infinite;
}

@keyframes fd-ai-blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.fd-ai-msg.error {
  align-self: flex-start;
  background: color-mix(in srgb, var(--fd-error) 14%, transparent);
  color: var(--fd-foreground);
}

.fd-ai-input {
  display: flex;
  align-items: flex-end;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--fd-border);
}

.fd-ai-input textarea {
  flex: 1;
  min-height: 2.25rem;
  max-height: 7rem;
  resize: none;
  border: 1px solid var(--fd-border);
  border-radius: 0.625rem;
  background: var(--fd-secondary);
  color: var(--fd-foreground);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  outline: none;
}

.fd-ai-input textarea:focus {
  border-color: var(--fd-ring);
}

.fd-ai-input button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 9999px;
  color: #fff;
  cursor: pointer;
  font-size: 0.8125rem;
  background: linear-gradient(135deg, var(--fd-brand), var(--fd-brand-2));
}

.fd-ai-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
