/* ── document-page.css ─────────────────────────────────────────────────────────
   模块说明：两站帮助、条款和隐私页的共用阅读布局，依赖原基础与世界观样式。
*/

/* ── Back button ── */
#help-back,
#privacy-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
#help-back:hover,
#privacy-back:hover { color: var(--text); border-color: var(--accent2); }

/* ── Sticky nav bar ── */
#help-nav {
  position: sticky;
  top: 49px;            /* below wv-topbar */
  z-index: 90;
  background: rgba(9, 9, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
#help-nav::-webkit-scrollbar { display: none; }

.help-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.76rem;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.help-nav-btn:hover,
.help-nav-btn.active {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(77, 184, 176, 0.08);
}

/* ── Main content ── */
#help-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 100px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Section ── */
.help-section {
  scroll-margin-top: 108px;    /* topbar + nav height */
}

.help-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-section-title .help-icon {
  font-size: 1.15rem;
}

/* 文档页采用 Markdown 阅读层级，保留帮助页的抽屉交互但减少卡片式装饰。 */
.doc-page-title {
  color: var(--text);
  font: inherit;
  margin: 0;
}

.doc-page .help-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
}

.doc-page .help-section:last-child {
  border-bottom: 0;
}

.doc-page .help-section-title {
  display: block;
  margin-bottom: 18px;
}

.doc-heading {
  color: var(--text);
  font: inherit;
  margin: 0;
}

.doc-page .help-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.doc-page .help-card + .help-card {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 18px;
  padding-top: 18px;
}

.doc-page .help-card p {
  margin: 0 0 12px;
}

.doc-page .help-steps {
  counter-reset: none;
  display: block;
  list-style: disc;
  margin: 10px 0 0;
  padding-left: 22px;
}

.doc-page .help-steps li {
  counter-increment: none;
  margin: 7px 0;
  min-height: 0;
  padding-left: 0;
}

.doc-page .help-steps li::before {
  content: none;
}

.doc-page .help-card blockquote {
  border-left: 3px solid var(--accent2);
  color: var(--muted);
  margin: 16px 0;
  padding-left: 14px;
}

/* ── Q&A pairs ── */
.help-qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.help-q {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  line-height: inherit;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
  user-select: none;
}
.help-q:hover { background: var(--surface2); }

.help-q-arrow {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.help-qa.open .help-q-arrow { transform: rotate(180deg); }

.help-a {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.8;
  transition:
    max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity    0.28s ease,
    padding    0.28s ease;
}
.help-qa.open .help-a {
  max-height: none;
  opacity: 1;
  padding: 12px 18px 16px;
}

.help-a p { margin: 10px 0 0; }
.help-a p:first-child { margin-top: 12px; }
.help-a strong { color: var(--text); }
.help-a code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82rem;
  color: var(--accent2);
  font-family: monospace;
}

/* ── Info cards (non-collapsible) ── */
.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 10px;
}
.help-card strong { color: var(--text); }
.help-card .help-badge {
  display: inline-block;
  background: rgba(77, 184, 176, 0.15);
  border: 1px solid rgba(77, 184, 176, 0.3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.76rem;
  color: var(--accent2);
  margin-right: 4px;
}

/* ── Step list ── */
.help-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  min-height: 24px;
}
.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(77, 184, 176, 0.18);
  border: 1px solid rgba(77, 184, 176, 0.35);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Limit table ── */
.help-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
  margin-top: 10px;
}
.help-table th,
.help-table td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  text-align: left;
  overflow-wrap: anywhere;
}
.help-table th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-body);
}
.help-table td { color: var(--text); }
.help-table tr:hover td { background: var(--surface2); }

.help-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.help-quota-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* 长英文和窄屏表格在容器内换行；原生问题按钮保留清晰键盘焦点。 */
.doc-footer { max-width: 820px; margin: 0 auto; padding: 0 20px 28px; font-size: 0.84rem; }
.doc-footer a { color: var(--accent2); }
#help-main, .help-section, .help-qa { min-width: 0; overflow-wrap: anywhere; }
.help-q > span:first-child { min-width: 0; }
.help-q:focus-visible, .help-nav-btn:focus-visible, #help-back:focus-visible, #privacy-back:focus-visible {
  outline: 2px solid var(--accent2); outline-offset: -3px;
}
@media (max-width: 480px) {
  .help-table th, .help-table td { padding: 8px; }
  #help-main { padding: 24px 14px 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-a, .help-q-arrow { transition: none; }
}
