/* ---------- 帮助中心 (spec 2026-10-06 docs site) ----------
   A full-screen dialog: a top bar (目录, title, search, 在新标签页打开, close), then contents | page | 本页目录. The page
   lays the guides' own markup out with the workbench's tokens; the guide's stylesheet never comes in. */
dialog.docs {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
}
dialog.docs[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
/* An opaque full-screen dialog: nothing to blur behind it. */
dialog.docs::backdrop {
  backdrop-filter: none;
}
.docs-notice {
  position: absolute;
  top: 64px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow);
}
/* The environment the server wrote into the guide (as the guide itself does with data-env on <html>). */
dialog.docs[data-env="test"] .env-prod,
dialog.docs[data-env="production"] .env-test {
  display: none !important;
}
.docs-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.docs-title {
  font-size: var(--fs-md);
  white-space: nowrap;
}
.docs-search {
  flex: 1 1 auto;
  max-width: 420px;
  margin-left: auto;
}
.docs-search input {
  padding-left: 12px;
}
#docs-menu {
  display: none;
}
/* contents | page | 本页目录 (an auto column: it takes no room when 本页目录 is hidden or the page has no sections). */
.docs-body {
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) auto;
  min-height: 0;
}
.docs-nav,
.docs-toc {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 20px 12px 40px;
  overflow-y: auto;
}
.docs-nav {
  gap: 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.docs-group {
  display: grid;
  gap: 2px;
}
.docs-nav button,
.docs-toc button {
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
  font-size: var(--fs-sm);
  text-align: left;
  white-space: normal;
  box-shadow: none;
}
.docs-nav button:hover:not(:disabled),
.docs-toc button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--text);
}
.docs-nav button.sub {
  padding-left: 24px;
  color: var(--text-3);
  font-weight: 400;
}
.docs-nav button.on,
.docs-toc button.on,
.docs-nav button.on:hover:not(:disabled),
.docs-toc button.on:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.docs-toc {
  width: 200px;
  border-left: 1px solid var(--border);
}
.docs-toc:empty {
  display: none;
}
.docs-main,
.docs-nav,
.docs-toc {
  overscroll-behavior: contain;
}
.docs-main {
  min-width: 0;
  overflow-y: auto;
  outline: none;
  scroll-padding-top: 16px;
}
.docs-article {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 32px 64px;
  display: grid;
  gap: 16px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}
.docs-crumbs {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.docs-article h1 {
  font-size: 26px;
  line-height: 1.35;
}
.docs-article h3 {
  margin-top: 12px;
  font-size: var(--fs-lg);
  scroll-margin-top: 16px;
}
.docs-article p,
.docs-article ul,
.docs-article ol {
  max-width: 68ch;
  margin: 0;
}
.docs-article a {
  color: var(--accent);
}
.docs-article img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: zoom-in;
}
.docs-article figure {
  display: grid;
  gap: 8px;
  margin: 0;
}
.docs-article figure.narrow img {
  max-width: 640px;
}
.docs-article figcaption {
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.docs-article .lead {
  font-size: 16px;
  color: var(--text-2);
}
.docs-article .muted {
  color: var(--text-3);
}
/* The guides' notes: plain is a heads-up, .red a warning, .green good news. */
.docs-article .note {
  max-width: 72ch;
  padding: 12px 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs);
}
.docs-article .note.red {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}
.docs-article .note.green {
  border-color: var(--border);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.docs-article .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.docs-article .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.docs-article .chip.p {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.docs-article code,
.docs-article .id {
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.88em;
}
/* 「button names」 in the text: a key-like chip, not a workbench button. */
.docs-article .ui-btn {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--accent-soft);
  font-size: 0.9em;
  white-space: nowrap;
}
.docs-article .ui-btn.pri {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}
.docs-article .pair,
.docs-article .roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}
.docs-article .role {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.docs-article ol.steps {
  display: grid;
  gap: 24px;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.docs-article ol.steps > li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 14px;
  counter-increment: s;
}
.docs-article ol.steps > li::before {
  content: counter(s);
  grid-row: 1 / span 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.docs-article ol.steps > li > * {
  grid-column: 2;
}
.docs-article ul.tight {
  display: grid;
  gap: 4px;
  padding-left: 1.2em;
}
.docs-article .table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.docs-article table {
  font-size: var(--fs);
}
/* The workbench's sticky table headers would float over the contents drawer here. */
.docs-article th,
.docs-article td {
  position: static;
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.docs-article .env-table {
  table-layout: fixed;
}
.docs-article .env-table th,
.docs-article .env-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}
/* The streamer handbook's own layouts: phone screenshots side by side, text beside a phone, 话术 cards, tags. */
.docs-article .eyebrow {
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.12em;
  font-weight: 500;
}
.docs-article .phones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  align-items: start;
}
.docs-article .split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.docs-article .split figure {
  max-width: 300px;
}
.docs-article .say {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.docs-article .say .card {
  padding: 14px 16px;
}
.docs-article .tag {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--fs-xs);
}
.docs-article .tag.ok {
  border-color: transparent;
  background: var(--success-soft);
  color: var(--success);
}
.docs-article .tag.off {
  background: var(--surface-2);
  color: var(--text-3);
}
@container (max-width: 640px) {
  .docs-article .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-article .phones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
.docs-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.docs-step {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 0;
  padding: 10px 14px;
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  white-space: normal;
  text-align: left;
}
.docs-step.next {
  align-items: flex-end;
  text-align: right;
}
.docs-step:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.docs-step small {
  color: var(--text-3);
}
.docs-results {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 32px 64px;
  display: grid;
  gap: 8px;
}
.docs-hit {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  padding: 12px 14px;
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  white-space: normal;
  text-align: left;
}
.docs-hit:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.docs-hit span {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-2);
}
.docs-hit mark,
.docs-hit strong mark {
  background: var(--warn-soft);
  color: inherit;
}
.docs-zoom:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: var(--surface-glass);
  cursor: zoom-out;
}
.docs-zoom img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
/* Narrower: 本页目录 goes first, then the contents become a drawer under 目录. */
@container (max-width: 1100px) {
  .docs-toc {
    display: none;
  }
}
@media (max-width: 900px) {
  #docs-menu {
    display: inline-flex;
  }
  #docs-newtab {
    display: none;
  }
  .docs-body {
    grid-template-columns: minmax(0, 1fr);
  }
  /* The contents slide over the page from the left, under the top bar; closed, they are out of the way and out of
     the tab order. */
  .docs-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.2s,
      visibility 0.2s;
  }
  dialog.docs.nav-open .docs-nav {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-lg);
  }
  /* A tap on a picture shows it at twice the screen's width, to scroll around in. */
  .docs-zoom:not([hidden]) {
    place-items: start;
  }
  .docs-zoom img {
    width: 190vw;
    max-width: none;
    max-height: none;
  }
  /* The page dims behind the open drawer; a tap on it closes the drawer (docs.js). */
  dialog.docs.nav-open .docs-main {
    opacity: 0.35;
  }
  .docs-article,
  .docs-results {
    padding: 20px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
  }
  .docs-article h1 {
    font-size: 22px;
  }
  .docs-search {
    max-width: none;
  }
}
