:root {
  --pf-bg: #f7f8fa;
  --pf-panel: #ffffff;
  --pf-ink: #111827;
  --pf-muted: #6b7280;
  --pf-soft: #eef2ff;
  --pf-secondary: #f3f4f6;
  --pf-accent: #4f46e5;
  --pf-line: #e5e7eb;
  --pf-info: #4f46e5;
  --pf-warn: #d97706;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--pf-ink);
  background: var(--pf-bg);
  font: 15px/1.7 Inter, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
a { color: var(--pf-ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: #374151; }

.pf-top {
  position: sticky; top: 0; z-index: 40;
  min-height: 56px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--pf-bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-ink);
}
.pf-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--pf-ink); font-weight: 750; letter-spacing: -0.03em; text-decoration: none;
}
.pf-mark {
  width: 28px; height: 22px; border-radius: 4px;
  background: var(--pf-accent); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}
.pf-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tab {
  border: 0; background: transparent; color: var(--pf-muted);
  padding: 16px 10px; cursor: pointer; font: 13px/1 inherit; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--pf-ink); border-bottom-color: var(--pf-accent); font-weight: 650; }
.pf-search {
  width: 180px; height: 32px; border: 1px solid var(--pf-line); border-radius: 6px;
  padding: 0 10px; background: var(--pf-panel); color: var(--pf-ink); font: inherit;
}
.pf-actions { display: flex; gap: 8px; align-items: center; }
.pf-ghost { border: 0; background: transparent; color: var(--pf-muted); cursor: pointer; font: inherit; }
.pf-cta {
  background: var(--pf-ink); color: #fff; border-radius: 6px;
  padding: 7px 12px; font-weight: 650; text-decoration: none;
}
.pf-cta:hover { text-decoration: none; opacity: 0.9; }
.pf-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; min-height: calc(100vh - 56px); }
.pf-side, .pf-toc {
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow: auto; padding: 16px 12px 40px;
}
.pf-side { border-right: 1px solid var(--pf-line); background: var(--pf-bg); }
.pf-toc { border-left: 1px solid var(--pf-line); }
.group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--pf-muted); margin: 16px 8px 6px;
}
.nav-link { display: block; padding: 5px 10px; border-radius: 6px; color: var(--pf-ink); font-size: 13.5px; text-decoration: none; }
.nav-link:hover { background: var(--pf-secondary); text-decoration: none; }
.nav-link.active { background: var(--pf-ink); color: #fff; font-weight: 650; }
.pf-main {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 28px 40px 80px;
  background: var(--pf-panel);
}
.crumb { color: var(--pf-muted); font-size: 13px; margin-bottom: 8px; }
.page-title { font-size: 34px; letter-spacing: -0.03em; margin: 0 0 8px; }
.page-desc { color: var(--pf-muted); margin: 0 0 20px; }
.pf-note {
  background: var(--pf-soft); border: 1px solid var(--pf-line); color: var(--pf-ink);
  padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px;
}
.pf-note.warn { background: #fff7ed; border-color: var(--pf-warn); color: #9a3412; }
.content h2 { margin-top: 32px; }
.content table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.content th, .content td { border: 1px solid var(--pf-line); padding: 8px 10px; }
.content th { background: var(--pf-soft); }
.content pre, .content .code-block {
  background: #111827; color: #fafafa; padding: 14px 16px; border-radius: 8px; overflow: auto;
}
.content :not(pre) > code { background: var(--pf-soft); padding: 1px 5px; border-radius: 4px; }
.content img { max-width: 100%; width: auto; height: auto !important; object-fit: contain; display: block; }
.callout { border: 1px solid var(--pf-line); border-radius: 8px; padding: 10px 14px; margin: 14px 0; background: var(--pf-soft); }
.callout.warning { background: #fff7ed; }
.tabs-box { border: 1px solid var(--pf-line); border-radius: 8px; overflow: hidden; margin: 16px 0; }
.tabs-bar { display: flex; flex-wrap: wrap; background: var(--pf-soft); border-bottom: 1px solid var(--pf-line); }
.tabs-bar button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font: inherit; }
.tabs-bar button.active { background: #fff; font-weight: 700; border-bottom: 2px solid var(--pf-ink); }
.tab-panel { display: none; padding: 14px; }
.tab-panel.active { display: block; }
.pf-toc a { display: block; color: var(--pf-muted); font-size: 13px; padding: 3px 0; text-decoration: none; }
.search-hits {
  position: absolute; right: 18px; top: 56px; width: 360px; max-height: 60vh; overflow: auto;
  background: #fff; border: 1px solid var(--pf-line); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12); display: none; z-index: 50;
}
.search-hits a { display: block; padding: 8px 12px; color: var(--pf-ink); text-decoration: none; }
.search-hits a:hover { background: var(--pf-soft); }
@media (max-width: 1100px) {
  .pf-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .pf-toc { display: none; }
}
@media (max-width: 800px) {
  .pf-layout { grid-template-columns: 1fr; }
  .pf-side { position: relative; height: auto; }
  .pf-tabs { display: none; }
}
