/* ---------------------------------------------------------------------------
   help.css —— 站内帮助（右侧抽屉 + /help 中心页）

   风格与站点一致：白底、10px 圆角、品牌蓝 `--accent` 做强调，
   间距/字号全部走 tokens.css，不写裸数值（见 tokens.css 顶部约定）。

   挂载：`partials/help_drawer.php` 自带 <link> 引入本文件 —— 只在含顶栏的
   布局里出现，且在站点 CSS 之后加载，同特异性下覆盖安全。
   --------------------------------------------------------------------------- */

/* 抽屉打开时锁住页面滚动 */
body.ps-help-lock {
  overflow: hidden;
}

/* ---------- 顶栏那颗「?」 ---------- */
.ps-help-trigger {
  background: none;
  border: 0;
  cursor: pointer;
}
.ps-help-trigger .bi {
  font-size: 1rem;
}
.ps-help-trigger:hover {
  color: var(--accent);
}

/* ---------- 抽屉 ---------- */
.ps-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(29, 33, 41, .42);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast, .15s) ease, visibility var(--t-fast, .15s) ease;
}
.ps-help-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.ps-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1061;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  background: #fff;
  box-shadow: -.5rem 0 2rem rgba(29, 33, 41, .14);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility .28s;
}
.ps-help-drawer.is-open {
  transform: none;
  visibility: visible;
}

/* 头部 */
.ps-help-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3, .75rem);
  padding: var(--sp-4, 1rem) var(--sp-4, 1rem) var(--sp-3, .75rem);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
}
.ps-help-head-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-md, .625rem);
  background: rgba(var(--accent-rgb), .1);
  color: var(--accent);
  font-size: 1.1rem;
}
.ps-help-head-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.ps-help-kicker {
  display: block;
  font-size: var(--fs-xs, .72rem);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}
.ps-help-title {
  margin: .15rem 0 0;
  font-size: var(--fs-lg, 1.2rem);
  font-weight: 700;
  line-height: var(--lh-tight, 1.15);
  color: var(--navy);
  overflow-wrap: anywhere;
}
.ps-help-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--t-fast, .15s) ease;
}
.ps-help-close:hover {
  background: var(--light);
  color: var(--navy);
}

/* 正文 */
.ps-help-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-4, 1rem) var(--sp-4, 1rem) var(--sp-5, 1.5rem);
  -webkit-overflow-scrolling: touch;
}
.ps-help-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2, .5rem);
  padding: var(--sp-3, .75rem) var(--sp-4, 1rem);
  border-top: 1px solid var(--border);
  background: #fafbfc;
  font-size: var(--fs-sm, .8rem);
}
.ps-help-foot a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.ps-help-foot a:hover {
  text-decoration: underline;
}

/* 帮助正文排版（抽屉与独立页共用） */
.ps-help-content {
  font-size: var(--fs-base, .92rem);
  line-height: var(--lh-base, 1.5);
  color: var(--navy-2);
}
.ps-help-content h2,
.ps-help-content h3,
.ps-help-content h4 {
  margin: var(--sp-5, 1.5rem) 0 var(--sp-2, .5rem);
  font-size: var(--fs-md, 1rem);
  font-weight: 700;
  line-height: var(--lh-tight, 1.15);
  color: var(--navy);
}
.ps-help-content h2:first-child,
.ps-help-content h3:first-child {
  margin-top: 0;
}
.ps-help-content h3 {
  font-size: var(--fs-base, .92rem);
}
.ps-help-content p {
  margin: 0 0 var(--sp-3, .75rem);
}
.ps-help-content ul,
.ps-help-content ol {
  margin: 0 0 var(--sp-3, .75rem);
  padding-left: 1.15rem;
}
.ps-help-content li {
  margin-bottom: .3rem;
}
.ps-help-content li::marker {
  color: var(--accent);
}
.ps-help-content strong {
  color: var(--navy);
  font-weight: 700;
}
.ps-help-content code {
  padding: .1rem .32rem;
  border-radius: var(--r-sm, .375rem);
  background: var(--light);
  color: var(--navy);
  font-size: .86em;
}
.ps-help-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ps-help-content blockquote {
  margin: 0 0 var(--sp-3, .75rem);
  padding: var(--sp-3, .75rem) var(--sp-4, 1rem);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md, .625rem) var(--r-md, .625rem) 0;
  background: rgba(var(--accent-rgb), .06);
  color: var(--navy);
  font-size: var(--fs-sm, .8rem);
}
.ps-help-content blockquote p:last-child {
  margin-bottom: 0;
}
.ps-help-content hr {
  margin: var(--sp-4, 1rem) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* 抽屉里的空态：这一页还没写说明 */
.ps-help-empty {
  text-align: center;
  padding: var(--sp-6, 2.5rem) var(--sp-3, .75rem);
  color: var(--muted);
}
.ps-help-empty .bi {
  display: block;
  font-size: 2rem;
  color: var(--border);
  margin-bottom: var(--sp-3, .75rem);
}
.ps-help-empty p {
  margin: 0 0 var(--sp-3, .75rem);
  font-size: var(--fs-base, .92rem);
}
.ps-help-empty .btn {
  font-size: var(--fs-sm, .8rem);
}

/* ---------- /help 中心页 ---------- */
.help-page {
  background: var(--light);
  min-height: 60vh;
  padding-bottom: var(--sp-7, 4.5rem);
}
.help-hero {
  padding: var(--sp-6, 2.5rem) 0 var(--sp-5, 1.5rem);
  background: linear-gradient(180deg, #fff 0%, var(--light) 100%);
}
.help-hero h1 {
  margin: 0 0 var(--sp-2, .5rem);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
}
.help-hero p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: var(--fs-md, 1rem);
}
.help-search {
  position: relative;
  margin-top: var(--sp-4, 1rem);
  max-width: 520px;
}
.help-search .bi {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.help-search input {
  width: 100%;
  padding: .7rem .9rem .7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  background: #fff;
  font-size: var(--fs-base, .92rem);
  color: var(--navy);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast, .15s) ease, box-shadow var(--t-fast, .15s) ease;
}
.help-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}

.help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, .5rem);
  margin: 0 0 var(--sp-5, 1.5rem);
}
.help-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  background: #fff;
  color: var(--navy-2);
  font-size: var(--fs-sm, .8rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast, .15s) ease;
}
.help-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.help-tab.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.help-tab .badge {
  background: rgba(0, 0, 0, .08);
  color: inherit;
  font-weight: 600;
}
.help-tab.is-on .badge {
  background: rgba(255, 255, 255, .24);
}

.help-section {
  margin-bottom: var(--sp-6, 2.5rem);
}
.help-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2, .5rem);
  margin-bottom: var(--sp-3, .75rem);
}
.help-section-head h2 {
  margin: 0;
  font-size: var(--fs-lg, 1.2rem);
  font-weight: 700;
  color: var(--navy);
}
.help-section-head span {
  font-size: var(--fs-sm, .8rem);
  color: var(--muted);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3, .75rem);
}
.help-card {
  display: flex;
  gap: var(--sp-3, .75rem);
  padding: var(--sp-4, 1rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 1rem);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--t-fast, .15s) ease, box-shadow var(--t-fast, .15s) ease, transform var(--t-fast, .15s) ease;
}
.help-card:hover {
  border-color: rgba(var(--accent-rgb), .45);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}
.help-card-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--r-md, .625rem);
  background: rgba(var(--accent-rgb), .09);
  color: var(--accent);
  font-size: 1rem;
}
.help-card-txt {
  min-width: 0;
}
.help-card-txt h3 {
  margin: 0 0 .2rem;
  font-size: var(--fs-base, .92rem);
  font-weight: 700;
  color: var(--navy);
}
.help-card-txt p {
  margin: 0;
  font-size: var(--fs-sm, .8rem);
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.help-empty {
  padding: var(--sp-6, 2.5rem) var(--sp-4, 1rem);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg, 1rem);
  background: #fff;
  text-align: center;
  color: var(--muted);
}

/* ---------- 单篇帮助页 ---------- */
.help-article {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-6, 2.5rem) var(--sp-4, 1rem) var(--sp-7, 4.5rem);
}
.help-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: var(--sp-3, .75rem);
  font-size: var(--fs-sm, .8rem);
  color: var(--muted);
}
.help-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.help-article h1 {
  margin: 0 0 var(--sp-2, .5rem);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--navy);
}
.help-article .help-summary {
  margin: 0 0 var(--sp-4, 1rem);
  font-size: var(--fs-md, 1rem);
  color: var(--muted);
}
.help-article-card {
  padding: var(--sp-5, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 1rem);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.help-more {
  margin-top: var(--sp-5, 1.5rem);
}
.help-more h2 {
  margin: 0 0 var(--sp-3, .75rem);
  font-size: var(--fs-md, 1rem);
  font-weight: 700;
  color: var(--navy);
}
.help-more-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, .5rem);
}
.help-more-list a {
  padding: .38rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill, 999px);
  background: #fff;
  color: var(--navy-2);
  font-size: var(--fs-sm, .8rem);
  text-decoration: none;
}
.help-more-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- 手机 ---------- */
@media (max-width: 767.98px) {
  .ps-help-drawer {
    width: 100vw;
    border-radius: 0;
  }
  .ps-help-head {
    padding-top: calc(var(--sp-4, 1rem) + env(safe-area-inset-top, 0px));
  }
  .ps-help-foot {
    padding-bottom: calc(var(--sp-3, .75rem) + env(safe-area-inset-bottom, 0px));
  }
  .help-hero {
    padding-top: var(--sp-5, 1.5rem);
  }
  .help-grid {
    grid-template-columns: 1fr;
  }
}
