/* 灵犀汇金 · 灵犀终端 — 帮助中心（网页） */
:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1a1d26;
  --muted: #5c6370;
  --accent: #c45c26;
  --accent-dim: #e8a882;
  --border: #e2e5eb;
  --maxw: 42rem;
  /* 品牌色（与官网统一，仅用于表头/导航区域） */
  --brand-navy: #0A192F;
  --brand-gold: #D4AF37;
  --brand-gold-hi: #E8D5A3;
  --brand-ink-d: #CDD9F0;
  --brand-muted-d: #8EA0B8;
  /* 与官网导航通宽一致 */
  --help-shell-max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  /* 页内锚点滚动时不被粘性顶栏遮挡 */
  scroll-padding-top: 6.5rem;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 由软件打开时传入 hash：#v= &auth= &authName= 时显示（两行说明用换行） */
#help-env-banner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.45rem 1.25rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--brand-ink-d);
  background: rgba(6, 16, 32, 0.92);
  border-bottom: 1px solid rgba(212,175,55,0.12);
  text-align: center;
  white-space: pre-line;
  box-sizing: border-box;
}

/* 纯 FREE：隐藏进阶导航与进阶正文块 */
body.help-tier-base .help-nav-advanced,
body.help-tier-base .help-only-advanced {
  display: none !important;
}

body.help-tier-full .help-advanced-gate {
  display: none !important;
}

body.help-tier-full .help-free-tier-hint {
  display: none !important;
}

.help-advanced-gate,
.help-free-tier-hint {
  background: #fff8f0;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: var(--text);
}

.help-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.help-toc__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.help-toc ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

/* 整顶栏粘性固定：标题 + 导航 同一通栏（对齐官网 nav 视觉） */
.help-sticky {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 25, 47, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.help-sticky__inner {
  max-width: var(--help-shell-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1.75rem;
}

.help-sticky .site-header {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 20rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border-bottom: none;
}

.help-sticky .site-header__inner {
  max-width: none;
  margin: 0;
}

.help-sticky .site-header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-gold-hi);
  line-height: 1.25;
}

.help-sticky .site-header p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: var(--brand-muted-d);
}

.help-sticky .nav {
  flex: 1 1 360px;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  justify-content: flex-end;
  align-content: flex-start;
  align-items: center;
  background: transparent;
  border-bottom: none;
}

.help-sticky .nav a {
  font-size: 0.8rem;
  font-weight: 500;
}

/* 非 sticky 场景兜底（若某页未包 help-sticky） */
.site-header {
  background: var(--brand-navy);
  color: #f0f2f5;
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid rgba(212,175,55,0.35);
}

.site-header__inner {
  max-width: var(--help-shell-max);
  margin: 0 auto;
}

.site-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--brand-gold-hi);
}

.site-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--brand-muted-d);
}

.nav {
  max-width: var(--help-shell-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  background: var(--brand-navy);
  border-bottom: 1px solid rgba(212,175,55,0.12);
}

/* 由 help-context.js 注入的「← 返回官网」链接 */
.help-nav-back {
  font-size: 0.82rem;
  color: var(--brand-muted-d);
  padding-right: 0.75rem;
  border-right: 1px solid rgba(212,175,55,0.2);
  margin-right: 0.25rem;
}
.help-nav-back:hover {
  color: var(--brand-gold);
  text-decoration: none;
}

.nav a {
  font-size: 0.9rem;
  color: var(--brand-muted-d);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--brand-gold-hi);
  text-decoration: none;
}

.nav a.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
}

.help-nav-sep {
  display: inline-block;
  width: 1px;
  height: 0.9rem;
  background: rgba(212,175,55,0.3);
  margin: 0 0.15rem;
  align-self: center;
  flex-shrink: 0;
}

/* 平板 / 窄窗：导航单行横向滚动，避免顶栏被链接撑得很高 */
@media (max-width: 1024px) {
  .help-sticky__inner {
    min-width: 0;
  }

  .help-sticky .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    align-content: center;
    min-width: 0;
    max-width: 100%;
    gap: 0.35rem 0.55rem;
    padding-bottom: 0.28rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
  }

  .help-sticky .nav::-webkit-scrollbar {
    height: 3px;
  }

  .help-sticky .nav::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 2px;
  }

  .help-sticky .nav a,
  .help-sticky .nav .help-nav-sep {
    flex-shrink: 0;
  }

  .help-sticky .nav a {
    white-space: nowrap;
  }
}

/* 手机：再叠品牌区 + 压缩边距与字号 */
@media (max-width: 720px) {
  html {
    scroll-padding-top: 5.5rem;
  }

  #help-env-banner {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
  }

  .help-sticky__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem 0.5rem;
  }

  .help-sticky .site-header {
    max-width: none;
  }

  .help-sticky .site-header h1 {
    font-size: 0.92rem;
    margin-bottom: 0.08rem;
    letter-spacing: 0.04em;
  }

  .help-sticky .site-header p {
    font-size: 0.64rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .help-sticky .nav {
    flex: 1 1 auto;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .help-sticky .nav a {
    font-size: 0.74rem;
  }
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.card a {
  font-weight: 600;
}

article h1 {
  font-size: 1.5rem;
  margin-top: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-dim);
}

article h2 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.65rem;
}

article h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #fff9f5;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
  background: var(--card);
  border: 1px solid var(--border);
}

th,
td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #eef0f4;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin: 0.35rem 0;
}

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.site-footer__icp {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.88em;
}

.site-footer__icp:hover {
  color: var(--text);
}

.back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

/* ---------- 文章内图片 / 视频（复制片段即用） ---------- */
.article-media {
  margin: 1.25rem 0;
}

.article-media img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
}

.article-media figcaption {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.video-wrap {
  position: relative;
  width: 100%;
  margin: 1.25rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-wrap--16x9 {
  padding-bottom: 56.25%;
  height: 0;
}

.video-wrap--16x9 iframe,
.video-wrap--16x9 video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 本地 MP4：不用黑边包裹时可用 */
video.article-video {
  display: block;
  width: 100%;
  max-height: 24rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
}

article code {
  font-family: Consolas, "SF Mono", monospace;
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  background: #eef0f4;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre.snippet {
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  background: #1e222d;
  color: #e8eaef;
  border-radius: 8px;
  border: 1px solid var(--border);
}

