/* ========================================
   help.css - 帮助中心页面样式
   ======================================== */

/* 帮助中心头部 */
.help-hero {
  background: linear-gradient(180deg, #f5f8fc 0%, #eaf1f9 60%, #f8fafd 100%);
  padding: 80px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.help-hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}

.help-hero-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(15, 89, 160, 0.06);
  top: -100px;
  right: -80px;
}

.help-hero-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(43, 125, 233, 0.05);
  bottom: -60px;
  left: -60px;
}

.help-hero .container {
  position: relative;
  z-index: 2;
}

.help-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.help-hero h1 span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.help-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* 搜索框 */
.help-search {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.help-search input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  background: var(--bg-white);
  color: var(--text-body);
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.help-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 89, 160, 0.1);
}

.help-search input::placeholder {
  color: var(--text-light);
}

.help-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-light);
  pointer-events: none;
}

/* 全文搜索结果下拉（fixed 定位避开 .help-hero 的 overflow:hidden） */
.help-search-results {
  position: fixed;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  text-align: left;
}

.help-search-results[hidden] { display: none; }

.help-search-result {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.help-search-result:last-child { border-bottom: none; }

.help-search-result:hover,
.help-search-result:focus {
  background: var(--bg-light);
  outline: none;
}

.help-search-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.help-search-result-snippet {
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.help-search-results mark {
  background: rgba(15, 89, 160, 0.15);
  color: var(--primary);
  padding: 0 2px;
  border-radius: 2px;
}

.help-search-empty {
  padding: 20px 16px;
  font-size: 0.875rem;
  color: var(--text-light);
  text-align: center;
}

/* 文章内目标锚点高亮（用户通过搜索跳转） */
.help-article :target {
  animation: help-target-flash 2s ease-out;
  scroll-margin-top: 80px;
}

@keyframes help-target-flash {
  0%   { background-color: rgba(15, 89, 160, 0.25); }
  100% { background-color: transparent; }
}

/* 分类区域 */
.help-categories {
  padding: 64px 0;
  background: var(--bg-white);
}

.help-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.help-category-card {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
}

.help-category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.help-category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-ultra-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.help-category-icon svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.help-category-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.help-category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-category-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.help-category-list a:hover {
  color: var(--primary);
}

.help-category-list a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: var(--transition);
}

.help-category-list a:hover svg {
  opacity: 1;
  color: var(--primary);
}

/* 文章页面 */
.help-article-page {
  padding: 48px 0 80px;
  background: var(--bg-white);
}

.help-article-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

/* 侧边栏 */
.help-sidebar {
  position: sticky;
  top: 88px;
}

.help-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.help-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.help-sidebar-list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1.5;
}

.help-sidebar-list a:hover {
  color: var(--primary);
  background: var(--primary-ultra-light);
}

.help-sidebar-list a.active {
  color: var(--primary);
  background: var(--primary-ultra-light);
  font-weight: 600;
}

/* 面包屑 */
.help-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

.help-breadcrumb a {
  color: var(--text-muted);
}

.help-breadcrumb a:hover {
  color: var(--primary);
}

.help-breadcrumb svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* 文章内容 */
.help-article {
  max-width: 800px;
}

.help-article h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.help-article h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 88px;
}

.help-article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 28px;
  margin-bottom: 12px;
  scroll-margin-top: 88px;
}

.help-article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 20px;
  margin-bottom: 8px;
}

.help-article p {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 16px;
}

.help-article ul,
.help-article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.help-article ul {
  list-style: disc;
}

.help-article ol {
  list-style: decimal;
}

.help-article li {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 6px;
}

.help-article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.help-article code {
  background: var(--bg-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.help-article pre {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.help-article pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
}

.help-article a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help-article a:hover {
  color: var(--primary-dark);
}

.help-article strong {
  font-weight: 700;
  color: var(--text-dark);
}

/* 提示框 */
.help-note {
  background: var(--primary-ultra-light);
  border-left: 3px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}

.help-note p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--text-body);
}

.help-warning {
  background: #FFF8E6;
  border-left: 3px solid #F0A500;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}

.help-warning p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--text-body);
}

/* 返回链接 */
.help-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--primary);
  margin-top: 40px;
  padding: 8px 0;
}

.help-back:hover {
  gap: 10px;
}

.help-back svg {
  width: 16px;
  height: 16px;
}

/* 无结果 */
.help-no-results {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  display: none;
}

@media (max-width: 1024px) {
  .help-article-layout {
    grid-template-columns: 1fr;
  }

  .help-sidebar {
    position: static;
    margin-bottom: 24px;
  }
}

@media (max-width: 768px) {
  .help-hero {
    padding: 60px 0 36px;
  }

  .help-hero h1 {
    font-size: 1.75rem;
  }

  .help-categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .help-article h1 {
    font-size: 1.5rem;
  }

  .help-article h2 {
    font-size: 1.125rem;
  }
}
