/* ============================================================================
   远程绿幕 · 帮助中心（/help）
   ----------------------------------------------------------------------------
   作用域：body.hp-body（继承 body.lp-body 的深色变量，见 home.css）。
   布局：左侧分类锚点侧栏（sticky）+ 右侧文章流；顶部全局搜索过滤文章。
   ========================================================================== */

.hp-body { overflow-x: hidden; }

/* ------------------------------ 顶部导航 ------------------------------ */
.hp-body .lp-nav { padding-right: calc(40px + var(--sar)); }
.hp-body .hp-nav .brand { display: inline-flex; align-items: center; }

/* ------------------------------ 页头 ------------------------------ */
.hp {
  max-width: var(--tk-container);
  margin: 0 auto;
  /* 顶部 120px 是给固定导航留的位；导航高度加了 --sat，这里同步加，
     否则 iPhone 14 Pro Max（inset 59px）会算到只剩 -3px，标题钻到状态栏后面。 */
  padding: calc(120px + var(--sat)) 24px calc(40px + var(--sab));
}
.hp-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}
.hp-head h1 {
  margin: 20px 0 14px;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 900;
  letter-spacing: 1px;
}
.hp-head p { font-size: 14.5px; line-height: 1.9; color: var(--lp-muted); }

.hp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 28px auto 0;
  padding: 0 16px;
  height: 48px;
  border-radius: var(--tk-r-md);
  border: 1px solid var(--lp-panel-line);
  background: var(--lp-panel);
  transition: border-color 0.2s;
}
.hp-search:focus-within { border-color: rgba(79, 139, 255, 0.55); }
.hp-search svg { width: 17px; height: 17px; color: #5f6f8f; flex: none; }
.hp-search input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--lp-text);
  font-size: 14px;
  font-family: inherit;
}
.hp-search input::placeholder { color: #5f6f8f; }

/* ------------------------------ 布局 ------------------------------ */
.hp-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ------------------------------ 侧栏 ------------------------------ */
.hp-side {
  position: -webkit-sticky;
  position: sticky;
  top: calc(84px + var(--sat));
  max-height: calc(100vh - 104px);
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  padding-right: 6px;
}
.hp-side-in { display: grid; gap: 2px; }
.hp-side-title {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #6d9bff;
}
.hp-side-title:first-child { margin-top: 0; }
.hp-side a {
  display: block;
  font-size: 13px;
  color: var(--lp-muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: var(--tk-r-sm);
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.hp-side a:hover { color: var(--lp-text); background: rgba(255, 255, 255, 0.04); }
.hp-side a.is-active {
  color: #9fc0ff;
  background: rgba(37, 99, 235, 0.12);
  border-left-color: #4f8bff;
}

/* ------------------------------ 文章 ------------------------------ */
.hp-cat {
  margin: 44px 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #6d9bff;
}
.hp-cat:first-of-type { margin-top: 0; }
.hp-art {
  margin-bottom: 16px;
  padding: 28px 30px 24px;
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-panel-line);
  background: var(--lp-panel);
  scroll-margin-top: 96px;
}
.hp-art.is-hit-strong {
  border-color: rgba(79, 139, 255, 0.5);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.15);
}
.hp-art h3 { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
.hp-art p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.95;
  color: #b6c2d9;
}
.hp-art p:last-child { margin-bottom: 0; }
.hp-art b { color: var(--lp-text); }
.hp-art code {
  padding: 2px 7px;
  border-radius: var(--tk-r-xs);
  font-size: 12.5px;
  color: #9fc0ff;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(79, 139, 255, 0.25);
  font-family: var(--font-code, ui-monospace, monospace);
}
.hp-art mark {
  padding: 0 3px;
  border-radius: var(--tk-r-xs);
  color: inherit;
  background: rgba(34, 211, 238, 0.28);
}
.hp-link {
  color: #6d9bff;
  font-weight: 700;
  text-decoration: none;
}
.hp-link:hover { text-decoration: underline; }
.hp-empty {
  padding: 48px 0;
  text-align: center;
  font-size: 14px;
  color: var(--lp-muted);
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1024px) {
  /* ⚠️ 长写法 padding-top 会**整条覆盖**上面 .hp 的 padding 简写。
     漏掉 inset 就等于「手机断点一进，安全区立刻失效」，白做一遍。 */
  .hp { padding-top: calc(100px + var(--sat)); }
  .hp-layout { grid-template-columns: 1fr; gap: 24px; }
  .hp-side {
    position: static;
    max-height: none;
    padding: 14px 16px;
    border-radius: var(--tk-r-md);
    border: 1px solid var(--lp-panel-line);
    background: var(--lp-panel);
  }
  .hp-side-in { grid-auto-flow: column; grid-template-rows: repeat(4, auto); gap: 2px 10px; }
  .hp-side-title { grid-column: 1 / -1; }
  .hp-art { padding: 22px 20px 20px; }
}

/* ---------------- 手机竖屏（≤640px）----------------
   ① 侧栏从「4 行横向排」改回「竖向列表 + 自身滚动」：
      横向排法在 360px 屏上会排成 4 列、整块比屏幕还宽，
      再被 body 的 overflow-x:hidden 一裁，分类就点不全了。
   ② 触控目标抬到 ~40px（手指点得中）。
   ③ 卡片内边距收紧，把宽度让给文案。 */
@media (max-width: 640px) {
  .hp { padding-left: 16px; padding-right: 16px; }
  .hp-head { margin-bottom: 32px; }
  .hp-head h1 { font-size: 26px; letter-spacing: 0; }
  .hp-head p { font-size: 14px; line-height: 1.85; }
  .hp-search { height: 44px; margin-top: 20px; }

  .hp-side {
    padding: 12px 14px;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hp-side-in { grid-auto-flow: row; grid-template-rows: none; gap: 1px; }
  .hp-side-title { grid-column: auto; margin: 12px 0 4px; }
  .hp-side-title:first-child { margin-top: 0; }
  .hp-side a { padding: 9px 10px; }

  .hp-cat { margin: 30px 0 12px; letter-spacing: 2px; }
  .hp-art { padding: 18px 16px 16px; scroll-margin-top: calc(76px + var(--sat)); }
  .hp-art h3 { font-size: 16.5px; }
  .hp-art p { font-size: 13.5px; line-height: 1.85; }
}
