/* 帮助中心目录页：分类分组 + 关键词搜索。视觉与 help-detail 共用 styles.css / catalog-pages.css 的设计语言。 */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶部区 ---------- */
.help-directory-hero {
  padding: 48px 0 40px;
  background:
    linear-gradient(135deg, rgba(238, 249, 255, 0.95), rgba(255, 248, 204, 0.55)),
    #fff;
  border-bottom: 1px solid var(--line);
}

.help-directory-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
}

.help-directory-intro {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.help-directory-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}

.help-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 420px;
  max-width: 560px;
  min-height: 52px;
  padding: 0 14px 0 44px;
  background: #fff;
  border: 1px solid #d7e2ea;
  border-radius: 11px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.help-search:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(7, 157, 223, 0.14);
}

.help-search-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: #8fa3b3;
}

.help-search input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.help-search input::placeholder {
  color: #94a3b8;
}

.help-search input::-webkit-search-cancel-button {
  display: none;
}

.help-search-clear {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

/* display:grid 会覆盖浏览器对 [hidden] 的默认处理，需显式兜底 */
.help-search-clear[hidden] {
  display: none;
}

.help-search-clear:hover {
  background: #e2edf5;
  color: var(--ink);
}

.help-directory-stats {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.help-directory-stats strong {
  color: var(--ink);
  font-size: 16px;
}

/* ---------- 主体两栏 ---------- */
.help-directory-body {
  padding: 44px 0 72px;
}

.help-directory-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}

.help-directory-aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.help-aside-card {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.help-aside-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.help-category-nav {
  display: grid;
  gap: 2px;
}

.help-category-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease;
}

.help-category-nav a:hover,
.help-category-nav a.is-active {
  background: var(--soft-blue);
  color: var(--brand-blue-dark);
}

.help-category-nav em {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.help-category-nav a.is-active em {
  background: #d8eefb;
  color: var(--brand-blue-dark);
}

.help-aside-contact p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.help-aside-phone {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-blue-dark);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.help-aside-mail a {
  color: var(--brand-blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.help-aside-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.help-aside-cta:hover {
  background: var(--brand-blue-dark);
}

/* ---------- 分组与卡片 ---------- */
.help-directory-main {
  min-width: 0;
}

.help-group {
  /* 锚点跳转时避开顶部 sticky 导航 */
  scroll-margin-top: 96px;
}

.help-group + .help-group {
  margin-top: 40px;
}

/* 下载按钮在本页用 <a> 实现，补齐行内对齐 */
.site-header a.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.help-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.help-group-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
}

.help-group-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.help-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-directory li {
  min-width: 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.help-directory li:hover {
  border-color: #b9dcef;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.07);
  transform: translateY(-1px);
}

.help-directory a {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.help-directory a:hover {
  color: var(--brand-blue-dark);
}

.help-directory p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

/* 搜索过滤隐藏：用属性选择器，避免与 :hidden 冲突 */
.help-directory li[hidden],
.help-group[hidden] {
  display: none;
}

.help-empty {
  padding: 40px 24px;
  border: 1px dashed #cfdde8;
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.help-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
}

.help-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.help-empty a {
  color: var(--brand-blue-dark);
  font-weight: 700;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .help-directory-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .help-directory-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .help-directory-aside {
    position: static;
  }

  .help-category-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }

  .help-category-nav a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .help-aside-contact,
  .help-aside-cta {
    display: none;
  }
}

@media (max-width: 640px) {
  .help-directory-hero {
    padding: 32px 0 28px;
  }

  .help-directory-toolbar {
    gap: 12px;
  }

  .help-search {
    flex-basis: 100%;
    max-width: none;
    min-height: 48px;
  }

  .help-directory-body {
    padding: 28px 0 56px;
  }

  .help-directory {
    grid-template-columns: minmax(0, 1fr);
  }

  .help-group-head h2 {
    font-size: 19px;
  }

  .help-directory a {
    font-size: 15px;
  }
}
