
.help-layout {
  display: flex;
  min-height: calc(100vh - 72px);
}

.help-sidebar {
  position: sticky;
  top: 72px;
  width: 300px;
  min-width: 300px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background: var(--soft);
}

.help-sidebar h2 {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.help-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-sidebar a {
  display: block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.help-sidebar a:hover,
.help-sidebar a.active {
  background: #ffffff;
  color: var(--brand);
  font-weight: 600;
}

.help-sidebar a.toc-h2 {
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.help-sidebar a.toc-h3 {
  padding-left: 22px;
  font-size: 13px;
}

.help-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.help-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px clamp(32px, 6vw, 80px);
  background: transparent;
  position: sticky;
  top: 72px;
  z-index: 10;
}

.help-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.help-search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 68px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: var(--soft);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.help-search-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 27, 78, 0.12);
  background: #ffffff;
}

.help-search-wrap input::placeholder {
  color: var(--muted);
}

.help-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.help-search-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.help-search-btn svg {
  width: 16px;
  height: 16px;
}

.help-search-clear {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.help-search-clear.visible {
  display: flex;
}

/* ---- 跨页搜索结果下拉 ---- */
.help-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
  font-size: 13px;
}

.help-search-results.visible {
  display: block;
}

.help-search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.1s;
}

.help-search-result-item:last-child {
  border-bottom: 0;
}

.help-search-result-item:hover,
.help-search-result-item.active {
  background: var(--soft);
}

.help-search-result-heading {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.help-search-result-snippet {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-search-result-snippet mark {
  background: #fde68a;
  color: var(--ink);
  border-radius: 2px;
  padding: 0 1px;
}

.help-search-no-results {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.help-search-clear:hover {
  background: var(--line);
  color: var(--ink);
}

.help-search-info {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.help-search-info.visible {
  display: flex;
}

.help-search-nav {
  display: flex;
  gap: 2px;
}

.help-search-nav button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.help-search-nav button:hover {
  background: var(--soft);
}

.help-search-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.help-toc-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.help-toc-toggle:hover {
  background: var(--soft);
}

.help-toc-toggle svg {
  width: 16px;
  height: 16px;
}

.help-main {
  flex: 1;
  min-width: 0;
  padding: 40px clamp(32px, 6vw, 80px) 88px;
  max-width: 960px;
}

.help-main mark {
  background: #fde68a;
  color: var(--ink);
  border-radius: 2px;
  padding: 0 2px;
}

.help-main mark.active {
  background: #f59e0b;
  color: #ffffff;
}

.help-main h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  color: var(--ink);
}

.help-main .doc-meta {
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.help-main h2 {
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  color: var(--ink);
  scroll-margin-top: 88px;
}

.help-main h3 {
  margin: 32px 0 12px;
  font-size: 17px;
  color: var(--ink);
  scroll-margin-top: 88px;
}

.help-main p {
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.8;
}

.help-main ul,
.help-main ol {
  margin: 0 0 16px;
  padding-left: 24px;
  color: var(--ink);
  line-height: 1.8;
}

.help-main li {
  margin-bottom: 4px;
}

.help-main blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-left: 4px solid var(--brand);
  background: var(--soft);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}

.help-main blockquote p {
  margin: 0;
  color: var(--muted);
}

.help-main pre {
  margin: 0 0 16px;
  padding: 16px 20px;
  border-radius: 8px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

.help-main code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.9em;
}

.help-main pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.help-main img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 8px 0 16px;
  box-shadow: var(--shadow);
}

.help-main img.qq-status {
  display: inline;
  max-width: none;
  border: 0;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  vertical-align: middle;
}

.help-main strong {
  color: var(--ink);
}

.help-main .mermaid {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
  padding: 24px;
  border-radius: 8px;
  background: var(--soft);
}

.help-main a {
  color: var(--accent);
  text-decoration: underline;
}

.help-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--muted);
  font-size: 16px;
}

.help-error {
  padding: 40px;
  text-align: center;
  color: #dc2626;
}

.help-toc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.help-toc-overlay.open {
  display: block;
}

.help-toc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.help-toc-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: helpSlideIn 0.2s ease-out;
}

@keyframes helpSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.help-toc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.help-toc-panel-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.help-toc-panel-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-toc-panel-close:hover {
  background: var(--soft);
  color: var(--ink);
}

.help-toc-panel nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-toc-panel nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.help-toc-panel nav a:hover {
  background: var(--soft);
  color: var(--brand);
}

.help-toc-panel nav a.toc-h2 {
  font-weight: 600;
  color: var(--ink);
  margin-top: 6px;
}

.help-toc-panel nav a.toc-h3 {
  padding-left: 22px;
  font-size: 12px;
}

@media (max-width: 1024px) {
  .help-sidebar {
    display: none;
  }

  .help-toc-toggle {
    display: flex;
  }

  .help-toolbar {
    justify-content: flex-start;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
  }
}

/* ---- 面包屑导航 ---- */
.help-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 13px;
  color: var(--muted);
}

.help-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.help-breadcrumb a:hover {
  text-decoration: underline;
}

.help-breadcrumb-sep {
  color: var(--muted);
  user-select: none;
}

/* ---- 上下页导航 ---- */
.help-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.help-pager-prev,
.help-pager-next {
  max-width: 45%;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.help-pager-prev:hover,
.help-pager-next:hover {
  background: var(--brand);
  color: #ffffff;
}

.help-pager-disabled {
  padding: 10px 16px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: default;
}

.help-pager-next {
  margin-left: auto;
  text-align: right;
}

@media (max-width: 640px) {
  .help-toolbar {
padding: 12px 20px;
flex-wrap: wrap;
  }

  .help-search-wrap {
flex: 1;
max-width: none;
min-width: 0;
  }

  .help-search-info.visible {
flex: 0 0 100%;
order: 1;
  }

  .help-toc-toggle {
font-size: 0;
padding: 0 10px;
flex-shrink: 0;
  }
}
