/* ========== Help Center (Huawei Doc Center style) ========== */
.page-help {
  background: var(--bg-page);
}

.page-help .top-header {
  justify-content: flex-start;
  gap: 16px;
}

.page-help .header-left {
  flex-shrink: 0;
}

.page-help .header-center {
  position: static;
  transform: none;
  flex: 1;
  max-width: 480px;
  pointer-events: auto;
}

.page-help .header-nav {
  display: none;
}

.help-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.help-header-divider {
  color: var(--border);
  margin: 0 4px;
}

.help-header-title {
  font-size: var(--font-md);
  color: var(--text-secondary);
  white-space: nowrap;
}

.help-layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  max-width: 1400px;
  margin: 0 auto;
}

/* Left doc sidebar */
.help-sidebar {
  flex: 0 0 260px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  z-index: 50;
}

.help-sidebar::-webkit-scrollbar {
  width: 4px;
}

.help-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.help-sidebar-search {
  padding: 16px 16px 8px;
  position: sticky;
  top: 0;
  background: var(--bg-white);
  z-index: 1;
}

.help-sidebar-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: var(--font-md);
  font-family: inherit;
  outline: none;
}

.help-sidebar-search input:focus {
  border-color: var(--primary);
}

.help-nav {
  padding: 8px 0 24px;
}

.help-nav-group {
  margin-bottom: 4px;
}

.help-nav-group-title {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: var(--font-md);
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.help-nav-group-title:hover {
  color: var(--primary);
}

.help-nav-group-title .nav-arrow {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.help-nav-group-title:not(.expanded) .nav-arrow {
  transform: rotate(-90deg);
}

.help-nav-group-title:not(.expanded) + .help-nav-list {
  display: none;
}

.help-nav-list {
  list-style: none;
  padding: 0;
}

.help-nav-list li.hidden {
  display: none;
}

.help-nav-link {
  display: block;
  padding: 8px 16px 8px 36px;
  font-size: var(--font-md);
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.help-nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.help-nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 500;
}

.help-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(0, 0, 0, 0.4);
  z-index: 45;
}

/* Main content */
.help-main {
  flex: 1;
  min-width: 0;
  padding: 24px 40px 48px;
  background: var(--bg-white);
  min-height: calc(100vh - var(--header-height));
}

.help-doc {
  display: none;
  max-width: 820px;
}

.help-doc.active {
  display: block;
}

.help-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: 20px;
}

.help-breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.help-breadcrumb a:hover {
  color: var(--primary);
}

.help-breadcrumb .current {
  color: var(--text-secondary);
}

.help-doc-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.help-doc-header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.help-doc-meta {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.help-doc-body {
  font-size: var(--font-base);
  line-height: 1.8;
  color: var(--text-primary);
}

.help-doc-body p {
  margin-bottom: 16px;
}

.help-doc-body h2 {
  font-size: var(--font-lg);
  font-weight: 600;
  margin: 32px 0 16px;
  padding-top: 8px;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.help-doc-body h2:first-child {
  margin-top: 0;
}

.help-doc-body ul,
.help-doc-body ol {
  margin: 0 0 16px 24px;
}

.help-doc-body li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.help-doc-body a {
  color: var(--primary);
}

.help-doc-body a:hover {
  text-decoration: underline;
}

.help-notice {
  padding: 14px 16px;
  background: #fff8f6;
  border-left: 3px solid var(--primary);
  border-radius: 0 4px 4px 0;
  margin-bottom: 24px;
  font-size: var(--font-md);
  line-height: 1.7;
  color: var(--text-secondary);
}

.help-doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.help-doc-nav-btn {
  font-size: var(--font-md);
  color: var(--primary);
  padding: 8px 0;
}

.help-doc-nav-btn:hover {
  text-decoration: underline;
}

.help-doc-nav-btn.prev {
  margin-right: auto;
}

/* Right TOC */
.help-toc {
  flex: 0 0 200px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 16px;
  background: var(--bg-page);
  border-left: 1px solid var(--border);
}

.help-toc-inner {
  position: sticky;
  top: 24px;
}

.help-toc-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.help-toc-list {
  list-style: none;
}

.help-toc-list li {
  margin-bottom: 4px;
}

.help-toc-list a {
  display: block;
  padding: 4px 0 4px 12px;
  font-size: var(--font-sm);
  color: var(--text-muted);
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: all var(--transition);
}

.help-toc-list a:hover {
  color: var(--primary);
}

.help-toc-list a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.help-toc-list .toc-h3 a {
  padding-left: 24px;
  font-size: var(--font-xs);
}

/* Responsive */
@media (max-width: 1100px) {
  .help-toc {
    display: none;
  }

  .help-main {
    padding: 24px 32px 48px;
  }
}

@media (max-width: 768px) {
  .help-menu-toggle {
    display: flex;
  }

  .help-header-title {
    display: none;
  }

  .help-header-divider {
    display: none;
  }

  .help-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  }

  .help-sidebar.open {
    transform: translateX(0);
  }

  .help-sidebar-overlay.active {
    display: block;
  }

  .help-main {
    padding: 20px 16px 40px;
  }

  .help-doc-header h1 {
    font-size: 22px;
  }
}
