:root {
  --guide-bg: #f3f5f4;
  --guide-surface: #ffffff;
  --guide-ink: #18201f;
  --guide-muted: #687270;
  --guide-faint: #929c99;
  --guide-line: #dce2df;
  --guide-line-strong: #c7d0cc;
  --guide-teal: #087c72;
  --guide-teal-dark: #075d57;
  --guide-teal-soft: #e8f4f1;
  --guide-amber: #9a6511;
  --guide-amber-soft: #fff5dd;
  --guide-red: #b94545;
  --guide-code: #252b2a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--guide-bg);
  color: var(--guide-ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}
a { color: var(--guide-teal-dark); }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(8, 124, 114, .22); outline-offset: 2px; }

.guide-skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 120;
  padding: 9px 12px;
  border-radius: 5px;
  background: var(--guide-ink);
  color: #fff;
  text-decoration: none;
}
.guide-skip-link:focus { top: 10px; }

.guide-topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid #24312f;
  background: #18201f;
  color: #fff;
}
.guide-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}
.guide-brand > span:last-child { min-width: 0; display: grid; gap: 2px; }
.guide-brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.guide-brand small { color: #a9b8b5; font-size: 10px; font-weight: 700; }
.guide-brand-mark {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  background: var(--guide-teal);
  flex: 0 0 auto;
}
.guide-brand-mark i { width: 3px; display: block; background: #fff; }
.guide-brand-mark i:nth-child(1) { height: 8px; }
.guide-brand-mark i:nth-child(2) { height: 15px; }
.guide-brand-mark i:nth-child(3) { height: 11px; }
.guide-actions { display: flex; align-items: center; gap: 8px; }
.guide-icon-button, .guide-back-link {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #dce6e3;
}
.guide-icon-button { width: 36px; padding: 0; }
.guide-icon-button:hover, .guide-back-link:hover { border-color: rgba(255, 255, 255, .38); color: #fff; }
.guide-icon-button svg, .guide-back-link svg { width: 17px; height: 17px; }
.guide-back-link { gap: 7px; padding: 0 12px; font-size: 13px; font-weight: 700; text-decoration: none; }
.guide-toc-toggle { display: none; }
.guide-reading-progress { height: 3px; position: fixed; top: 64px; right: 0; left: 0; z-index: 81; background: transparent; }
.guide-reading-progress span { width: 100%; height: 100%; display: block; background: var(--guide-teal); transform: scaleX(0); transform-origin: left center; }

.guide-layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 286px minmax(0, 1fr); }
.guide-sidebar {
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow-y: auto;
  padding: 22px 18px 28px;
  border-right: 1px solid var(--guide-line);
  background: #eef1ef;
}
.guide-sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.guide-sidebar-head > div { min-width: 0; display: grid; gap: 4px; }
.guide-sidebar-head span { color: var(--guide-teal); font-size: 10px; font-weight: 800; }
.guide-sidebar-head strong { font-size: 17px; }
.guide-sidebar-close { display: none; border-color: var(--guide-line-strong); color: var(--guide-muted); }
.guide-search { height: 40px; margin-top: 18px; position: relative; display: flex; align-items: center; }
.guide-search svg { width: 16px; height: 16px; position: absolute; left: 11px; color: var(--guide-faint); pointer-events: none; }
.guide-search input {
  width: 100%;
  height: 40px;
  padding: 0 11px 0 36px;
  border: 1px solid var(--guide-line-strong);
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--guide-ink);
  font-size: 14px;
}
.guide-search input:focus { border-color: var(--guide-teal); box-shadow: 0 0 0 3px rgba(8, 124, 114, .1); }
.guide-search-status { min-height: 28px; padding: 7px 1px 5px; color: var(--guide-faint); font-size: 11px; }
.guide-search-status.empty { color: var(--guide-red); }
.guide-toc { display: grid; gap: 2px; }
.guide-toc a {
  min-width: 0;
  padding: 7px 9px;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
  color: #55605d;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}
.guide-toc a:hover { background: rgba(255, 255, 255, .72); color: var(--guide-ink); }
.guide-toc a.active { border-left-color: var(--guide-teal); background: #fff; color: var(--guide-teal-dark); font-weight: 700; }
.guide-toc a[hidden] { display: none; }
.guide-source-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--guide-line); display: flex; gap: 8px; color: var(--guide-faint); font-size: 10px; line-height: 1.55; }
.guide-source-note svg { width: 15px; height: 15px; color: var(--guide-teal); flex: 0 0 auto; }

.guide-main { min-width: 0; background: var(--guide-surface); }
.guide-article { width: min(940px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 70px; }
.guide-intro { padding-bottom: 34px; border-bottom: 2px solid var(--guide-ink); }
.guide-article h1, .guide-article h2, .guide-article h3 { letter-spacing: 0; }
.guide-article h1 { max-width: 820px; margin: 0 0 16px; font-size: 32px; line-height: 1.32; }
.guide-article h2 { margin: 0 0 20px; font-size: 24px; line-height: 1.4; }
.guide-article h3 { margin: 31px 0 12px; color: #27312f; font-size: 18px; line-height: 1.5; }
.guide-article p { margin: 12px 0; color: #3f4947; font-size: 16px; line-height: 1.82; }
.guide-intro > p:first-of-type { color: var(--guide-muted); font-size: 13px; line-height: 1.75; }
.guide-article ul, .guide-article ol { margin: 12px 0; padding-left: 25px; color: #3f4947; }
.guide-article li { margin: 7px 0; padding-left: 3px; line-height: 1.75; }
.guide-article li::marker { color: var(--guide-teal); font-weight: 700; }
.guide-article strong { color: var(--guide-ink); }
.guide-article a { text-underline-offset: 3px; }
.guide-article code {
  padding: 2px 5px;
  border: 1px solid #d9e4e1;
  border-radius: 4px;
  background: var(--guide-teal-soft);
  color: #075b54;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}
.guide-article pre {
  max-width: 100%;
  margin: 18px 0;
  overflow: auto;
  padding: 18px;
  border-left: 4px solid var(--guide-teal);
  border-radius: 0 6px 6px 0;
  background: var(--guide-code);
  color: #e9efed;
  line-height: 1.62;
}
.guide-article pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: 13px; overflow-wrap: normal; }
.guide-article blockquote { margin: 18px 0; padding: 10px 16px; border-left: 4px solid var(--guide-amber); background: var(--guide-amber-soft); }
.guide-article blockquote p { margin: 0; color: #6c4a12; }
.guide-section { padding: 40px 0 42px; border-bottom: 1px solid var(--guide-line); }
.guide-section.search-match > h2 { margin-left: -13px; padding-left: 9px; border-left: 4px solid var(--guide-amber); }
.guide-table-wrap { width: 100%; margin: 18px 0 22px; overflow-x: auto; border: 1px solid var(--guide-line); border-radius: 6px; }
.guide-table-wrap:focus-visible { outline-offset: 3px; }
.guide-article table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.guide-article th, .guide-article td { padding: 11px 12px; border-right: 1px solid var(--guide-line); border-bottom: 1px solid var(--guide-line); text-align: left; vertical-align: top; }
.guide-article th:last-child, .guide-article td:last-child { border-right: 0; }
.guide-article tr:last-child td { border-bottom: 0; }
.guide-article th { background: #eef3f1; color: #384340; font-size: 12px; white-space: nowrap; }
.guide-article tbody tr:nth-child(even) { background: #fafbfa; }
.guide-footer { width: min(940px, calc(100% - 64px)); margin: 0 auto; padding: 24px 0 38px; display: flex; justify-content: space-between; gap: 16px; color: var(--guide-faint); font-size: 12px; }
.guide-footer a { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; text-decoration: none; }
.guide-footer svg { width: 14px; height: 14px; }
.guide-overlay { display: none; }

@media (max-width: 920px) {
  .guide-toc-toggle { display: inline-flex; }
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-sidebar {
    width: min(330px, calc(100vw - 42px));
    height: calc(100vh - 64px);
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 95;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 14px 0 32px rgba(24, 32, 31, .17);
  }
  .guide-nav-open .guide-sidebar { transform: translateX(0); }
  .guide-sidebar-close { display: inline-flex; }
  .guide-sidebar-close:hover { border-color: var(--guide-line-strong); color: var(--guide-ink); }
  .guide-overlay { position: fixed; inset: 64px 0 0; z-index: 90; border: 0; background: rgba(24, 32, 31, .42); }
  .guide-nav-open .guide-overlay { display: block; }
}

@media (max-width: 620px) {
  .guide-topbar { padding: 0 14px; }
  .guide-brand small { display: none; }
  .guide-actions { gap: 6px; }
  .guide-back-link { width: 36px; padding: 0; }
  .guide-back-link span { display: none; }
  .guide-article { width: calc(100% - 34px); padding: 34px 0 52px; }
  .guide-article h1 { font-size: 27px; }
  .guide-article h2 { font-size: 21px; }
  .guide-article h3 { font-size: 17px; }
  .guide-article p { font-size: 15px; line-height: 1.78; }
  .guide-article ul, .guide-article ol { padding-left: 22px; }
  .guide-article pre { padding: 14px; }
  .guide-section { padding: 34px 0 36px; }
  .guide-footer { width: calc(100% - 34px); }
}

@media print {
  .guide-topbar, .guide-reading-progress, .guide-sidebar, .guide-overlay, .guide-footer { display: none !important; }
  .guide-layout { display: block; }
  .guide-article { width: 100%; padding: 0; }
  .guide-section { break-inside: auto; }
  .guide-table-wrap { overflow: visible; }
  .guide-article table { min-width: 0; }
  .guide-article pre { white-space: pre-wrap; }
}
