/* ====== 帮助中心 help.html（与新闻中心等内页风格统一）====== */

.page-help .nav-main a.nav-active {
  color: var(--accent);
  font-weight: 700;
}

.page-help main.help-page {
  overflow-x: clip;
}

/* ----- Hero（对齐 news-hero 深色科技底）----- */
.help-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 11vw, 8rem) 0 clamp(2.25rem, 4vw, 3.5rem);
  background: linear-gradient(168deg, #020617 0%, #0f172a 32%, #1e1b4b 68%, #0c0a1d 100%);
  color: #e2e8f0;
}

.help-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 12% 22%, rgba(34, 211, 238, 0.1), transparent 52%),
    radial-gradient(ellipse 48% 42% at 88% 78%, rgba(168, 85, 247, 0.09), transparent 50%);
}

.help-hero__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
}

.help-hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
}

.help-hero__eyebrow {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neo-cyan);
  padding: 0.28rem 0.9rem;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.08);
  margin: 0 0 1.1rem;
}

.help-hero__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.help-hero__lead {
  margin: 0;
  font-size: clamp(14px, 1.8vw, 15px);
  line-height: 1.75;
  color: #94a3b8;
}

/* ----- 主区：目录 + 正文（自适应栅格）----- */
.help-page__shell {
  margin-top: clamp(-1.5rem, -2vw, -0.75rem);
  padding: 0 0 clamp(3.5rem, 8vw, 5.5rem);
  position: relative;
  z-index: 2;
}

.help-page__layout {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

@media (min-width: 1024px) {
  .help-page__layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  }
}

/* 侧栏目录 */
.help-sidebar {
  transition: opacity 0.2s ease;
}

.help-sidebar.help-sidebar--empty {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .help-sidebar:not(.help-sidebar--empty) {
    position: sticky;
    top: calc(4.5rem + env(safe-area-inset-top, 0px));
  }
}

.help-sidebar__sticky {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 165, 233, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.help-sidebar__label {
  margin: 0 0 0.65rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.help-toc {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.help-toc a {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.help-toc a:hover {
  color: var(--accent);
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.15);
}

/* 平板/手机：目录改为横向可滑动的标签，节省纵向空间 */
@media (max-width: 1023px) {
  .help-sidebar:not(.help-sidebar--empty) .help-sidebar__sticky {
    padding: 0.75rem 0.85rem;
  }

  .help-sidebar__label {
    margin-bottom: 0.5rem;
  }

  .help-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .help-toc a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 13px;
    background: rgba(241, 245, 249, 0.95);
    border: 1px solid var(--line);
  }

  .help-toc a:hover {
    background: rgba(6, 182, 212, 0.1);
  }
}

/* 正文卡片 */
.help-content-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(14, 165, 233, 0.12);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.35rem, 3.2vw, 2.25rem);
  min-width: 0;
}

.help-content {
  max-width: none;
  margin: 0;
  font-size: clamp(15px, 1.1vw, 16px);
  line-height: 1.85;
  color: var(--ink-soft);
}

.help-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 800;
  color: var(--ink);
  margin: 2rem 0 0.9rem;
  padding: 0.15rem 0 0.5rem 0.85rem;
  border-left: 4px solid var(--accent);
  scroll-margin-top: calc(5rem + env(safe-area-inset-top, 0px));
}

.help-content h2:first-child {
  margin-top: 0;
}

.help-content p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

.help-content p:last-child {
  margin-bottom: 0;
}

.help-content__placeholder,
.help-content__loading {
  color: var(--muted);
  font-size: 15px;
  max-width: 48ch;
}

.help-content__placeholder code,
.help-content__loading code {
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

.help-content__error {
  color: #b45309;
}

@media (max-width: 600px) {
  .help-hero {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .help-content-panel {
    padding: 1.1rem 1rem;
    border-radius: 14px;
  }
}
