/* ==========================================================================
   帮助中心 · 文档站样式（2026-11-04）
   布局规格取自 workbuddy.cn/docs 线上 CSS（VitePress）：
     侧栏 272px / 正文 688px / 右侧目录 224px / 顶栏 64px
   为什么照抄这套：内容一多，"一页到底"就找不着东西。三栏让人点着走、跳着看。

   依赖：theme/tokens.css + theme/wb-tokens.css（品牌色、缓动、字重）
   ========================================================================== */

/* ==================== 1. 三栏骨架 ==================== */

.doc{
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 224px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}

/* 左侧导航：滚到哪都停在屏幕里 */
.doc-side{
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 28px 16px 40px 24px;
  border-right: 1px solid #f2f4f8;
  scrollbar-width: thin;
}
.doc-side::-webkit-scrollbar{ width: 4px; }
.doc-side::-webkit-scrollbar-thumb{ background: #e3e6ea; border-radius: 2px; }

.doc-nav__group{ margin-bottom: 26px; }
.doc-nav__title{
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  color: #a3a3a3;
  cursor: pointer;
  user-select: none;
  background: none; border: 0; width: 100%; text-align: left; font-family: inherit;
}
.doc-nav__title:hover{ color: #646464; }
/* 折叠箭头：用边框画的小三角，省一张图 */
.doc-nav__title::after{
  content: '';
  width: 5px; height: 5px; margin-left: auto;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s var(--wb-ease);
}
.doc-nav__group.is-folded .doc-nav__title::after{ transform: rotate(-45deg); }
.doc-nav__group.is-folded .doc-nav__list{ display: none; }

.doc-nav__list{ list-style: none; margin: 0; padding: 0; }
.doc-nav__link{
  position: relative;
  display: block;
  padding: 7px 10px 7px 14px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #4a4e57;
  text-decoration: none;
  transition: background .16s var(--wb-ease), color .16s var(--wb-ease);
}
.doc-nav__link:hover{ background: #f7f8f9; color: #1a1a1a; }
.doc-nav__link.is-on{
  background: var(--accent-w);
  color: var(--accent-h);
  font-weight: 500;
}
/* 当前页：左边一条 2px 竖线。比整块变色更清楚是"哪一条"，也不会让侧栏花 */
.doc-nav__link.is-on::before{
  content: '';
  position: absolute; left: 4px; top: 50%;
  width: 2px; height: 14px; margin-top: -7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ==================== 2. 正文 ==================== */

.doc-main{
  min-width: 0;
  padding: 40px 56px 96px;
}
.doc-article{
  max-width: 688px;
  margin: 0 auto;
}

/* 面包屑 */
.doc-crumb{
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #a3a3a3;
}
.doc-crumb a{ color: #a3a3a3; text-decoration: none; }
.doc-crumb a:hover{ color: var(--accent); }
.doc-crumb span{ opacity: .5; }

/* 标题 + 一句话结论 */
.doc-h1{
  margin: 0 0 14px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: #1a1a1a;
}
.doc-lead{
  margin: 0 0 34px;
  padding-bottom: 28px;
  border-bottom: 1px solid #f2f4f8;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.85;
  color: #646464;
}
.doc-lead b{ color: #1a1a1a; font-weight: 500; }

/* 正文排版 */
.doc-body{ font-size: 15px; font-weight: 300; line-height: 1.9; color: #4a4e57; }
.doc-body h2{
  margin: 44px 0 14px;
  padding-top: 4px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.35;
  color: #1a1a1a;
  scroll-margin-top: 88px;
}
.doc-body h3{
  margin: 28px 0 10px;
  font-size: 16.5px;
  font-weight: 500;
  color: #1a1a1a;
  scroll-margin-top: 88px;
}
.doc-body p{ margin: 0 0 16px; }
.doc-body b, .doc-body strong{ color: #1a1a1a; font-weight: 500; }
.doc-body a{ color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-w); }
.doc-body a:hover{ border-bottom-color: var(--accent); }

.doc-body ul, .doc-body ol{ margin: 0 0 18px; padding-left: 22px; }
.doc-body li{ margin-bottom: 8px; }
.doc-body li::marker{ color: #c8ccd2; }

.doc-body code{
  padding: 2px 6px;
  border-radius: 5px;
  background: #f7f8f9;
  font-family: SF Mono, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: #1a1a1a;
}
.doc-body pre{
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #f7f8f9;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.75;
}
.doc-body pre code{ padding: 0; background: none; }

.doc-body table{
  width: 100%; border-collapse: collapse;
  margin: 0 0 22px; font-size: 13.5px;
}
.doc-body th{
  padding: 9px 12px; text-align: left;
  background: #f7f8f9; font-weight: 500; color: #4a4e57;
  font-size: 12.5px;
}
.doc-body td{ padding: 10px 12px; border-bottom: 1px solid #f2f4f8; }

/* 步骤块：编号 + 一条线连起来，比纯文字列表清楚 */
.doc-steps{ counter-reset: s; margin: 0 0 22px; padding: 0; list-style: none; }
.doc-steps li{
  counter-increment: s;
  position: relative;
  padding: 0 0 20px 34px;
  border-left: 1px solid #ebebeb;
  margin-left: 10px;
}
.doc-steps li:last-child{ border-left-color: transparent; padding-bottom: 0; }
.doc-steps li::before{
  content: counter(s);
  position: absolute; left: -11px; top: -2px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-w); color: var(--accent-h);
  font-size: 11.5px; font-weight: 600;
}
/* 只有「步骤标题」（li 里的第一个 b）才换行成小标题。
   之前写成 .doc-steps li b，把正文里的强调也换行了 ——
   「这一步会 / 自动把账号建好 / ，不用另外填资料」读起来是断的。 */
.doc-steps li > b:first-child{ display: block; margin-bottom: 3px; color: #1a1a1a; font-weight: 500; }
.doc-steps li b{ color: #1a1a1a; font-weight: 500; }

/* 提示块 */
.doc-tip{
  margin: 0 0 22px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: var(--accent-w);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: #1c4d40;
}
.doc-tip b{ color: #0d3a2f; }
.doc-warn{
  border-left-color: #d97706;
  background: #fdf6ec;
  color: #7a4a12;
}
.doc-warn b{ color: #5c3608; }

/* 末尾「还是不行」 */
.doc-next{
  margin: 48px 0 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: #f7f8f9;
}
.doc-next__t{ margin: 0 0 10px; font-size: 14px; font-weight: 500; color: #1a1a1a; }
.doc-next__row{ display: flex; gap: 20px; flex-wrap: wrap; font-size: 13.5px; font-weight: 300; }
.doc-next__row a{ color: var(--accent); text-decoration: none; }
.doc-next__row a:hover{ text-decoration: underline; }

/* 上一篇 / 下一篇 */
.doc-pager{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #f2f4f8;
}
.doc-pager a{
  display: block;
  padding: 14px 18px;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .18s var(--wb-ease), transform .18s var(--wb-ease);
}
.doc-pager a:hover{ border-color: var(--accent); transform: translateY(-1px); }
.doc-pager span{ display: block; font-size: 11.5px; color: #a3a3a3; margin-bottom: 4px; }
.doc-pager b{ font-size: 14px; font-weight: 500; color: #1a1a1a; }
.doc-pager .is-next{ text-align: right; }

/* ==================== 3. 右侧目录 ==================== */

.doc-toc{
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 44px 24px 40px 8px;
  scrollbar-width: none;
}
.doc-toc::-webkit-scrollbar{ display: none; }
.doc-toc__t{
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .08em;
  color: #a3a3a3;
}
.doc-toc__list{ list-style: none; margin: 0; padding: 0; border-left: 1px solid #f2f4f8; }
.doc-toc__list a{
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.55;
  color: #8a8f99;
  text-decoration: none;
  transition: color .16s var(--wb-ease), border-color .16s var(--wb-ease);
}
.doc-toc__list a:hover{ color: #1a1a1a; }
.doc-toc__list a.is-on{
  color: var(--accent-h);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* ==================== 4. 文档首页（帮助中心入口） ==================== */

.doc-home{ max-width: 960px; margin: 0 auto; padding: 56px 24px 96px; }
.doc-home h1{ margin: 0 0 12px; font-size: 40px; font-weight: 500; letter-spacing: -.03em; }
.doc-home .sub{ margin: 0 0 36px; font-size: 16px; font-weight: 300; color: #646464; }

.doc-search{
  display: flex; align-items: center; gap: 10px;
  max-width: 520px;
  margin-bottom: 40px;
  padding: 12px 16px;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s var(--wb-ease), box-shadow .18s var(--wb-ease);
}
.doc-search:focus-within{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-w); }
.doc-search input{
  flex: 1; border: 0; outline: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 300; color: #1a1a1a;
}
.doc-search input::placeholder{ color: #a3a3a3; }

.doc-cards{ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.doc-card{
  display: block;
  padding: 20px 22px;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  text-decoration: none;
  transition: border-color .18s var(--wb-ease), transform .18s var(--wb-ease),
              box-shadow .18s var(--wb-ease);
}
.doc-card:hover{
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(16,18,22,.24);
}
.doc-card b{ display: block; margin-bottom: 5px; font-size: 15px; font-weight: 500; color: #1a1a1a; }
.doc-card span{ font-size: 13px; font-weight: 300; line-height: 1.7; color: #646464; }

/* ==================== 5. 手机 ==================== */

.doc-toggle{
  display: none;
  position: fixed; left: 16px; bottom: 20px; z-index: 60;
  align-items: center; gap: 7px;
  height: 42px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: #1a1a1a; color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  cursor: pointer;
}

@media (max-width: 1180px){
  .doc{ grid-template-columns: 248px minmax(0,1fr); }
  .doc-toc{ display: none; }
}

@media (max-width: 900px){
  .doc{ display: block; }
  .doc-side{
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
    width: 280px; height: 100vh;
    background: #fff;
    border-right: 1px solid #ebebeb;
    transform: translateX(-100%);
    transition: transform .28s var(--wb-ease);
    padding-top: 76px;
  }
  .doc.is-nav-open .doc-side{ transform: none; }
  .doc.is-nav-open::after{
    content: ''; position: fixed; inset: 0; z-index: 70;
    background: rgba(0,0,0,.32);
  }
  .doc-toggle{ display: inline-flex; }
  .doc-main{ padding: 28px 20px 80px; }
  .doc-h1{ font-size: 26px; }
  .doc-lead{ font-size: 15px; }
  .doc-body{ font-size: 14.5px; }
  .doc-body h2{ font-size: 19px; margin-top: 36px; }
  .doc-pager{ grid-template-columns: 1fr; }
  .doc-pager .is-next{ text-align: left; }
  .doc-home{ padding: 36px 20px 80px; }
  .doc-home h1{ font-size: 28px; }
  .doc-cards{ grid-template-columns: 1fr; }
}

/* 帮助首页（body[data-doc="home"]）没有右侧目录，
   那个浮动「目录」按钮只会浮在卡片上挡住内容 —— 只在文档页显示。 */
body[data-doc="home"] .doc-toggle{ display: none !important; }

/* 手机上底部有一排主题色浮层（theme.js 注入），
   文档页正文留 80px 不够，版权/上下篇会被压住。 */
@media (max-width: 900px){
  .doc-main{ padding-bottom: 104px; }
  .doc-home{ padding-bottom: 104px; }
}

/* 手机上「目录」按钮原来在左下角 —— 正文是左对齐的，
   读者从左边开始读，这个按钮正好压在每行的开头。
   移到右下、抬高一层，避开右下角的主题色浮层（fixed, bottom:14px）。 */
@media (max-width: 900px){
  .doc-toggle{
    left: auto;
    right: 14px;
    bottom: 72px;
    height: 40px;
    padding: 0 16px;
    font-size: 13px;
  }
}
