/* Web Extract · Documentation (3-column airy light layout inspired by Screen Ruler Docs) */

:root {
  --ink: #111318;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --surface: #f3f4f6;
  --surface-soft: #f8f9fb;
  --accent: #1a73e8;
  --accent-soft: #eef4ff;
  --accent-soft-hover: #e1ecff;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- Sticky Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}

.header-inner {
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand img { display: block; width: 24px; height: 24px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 inherit;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.lang-btn:hover { color: var(--ink); }

.lang-btn.is-active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 19, 24, 0.08);
}

.header-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 8px;
  transition: color 120ms ease;
}

.header-link:hover { color: var(--ink); }

.header-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}

.header-cta:hover {
  background: var(--accent-soft-hover);
  color: var(--accent);
}

/* ---------- 3-Column Docs Grid ---------- */

.docs {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 32px 88px;
  display: grid;
  grid-template-columns: 210px minmax(0, 668px) 220px;
  justify-content: space-between;
  gap: 56px;
  align-items: start;
}

/* ---------- Left Sidebar Nav ---------- */

.docs-nav {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 500 13.5px/1.3 inherit;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.78;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.nav-item.is-active svg { opacity: 1; }

/* ---------- Central Prose Article ---------- */

.docs-article {
  min-width: 0;
}

.docs-article h1 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.docs-article .lead {
  margin: 0 0 28px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--muted);
}

.docs-article h2 {
  margin: 44px 0 14px;
  scroll-margin-top: 84px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.docs-article p {
  margin: 0 0 16px;
  color: var(--ink-2);
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--ink-2);
}

.docs-article li {
  margin: 7px 0;
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 600 11.5px/1 inherit;
  letter-spacing: 0;
}

.tier-pill.is-pro {
  background: var(--accent-soft);
  color: var(--accent);
}

.docs-article code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.docs-article kbd {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--line);
}

/* Code Blocks */
.code-block {
  position: relative;
  margin: 18px 0 22px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: 14px 74px 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.code-block pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font: 500 11.5px/1 inherit;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.copy-btn:hover { color: var(--ink); border-color: #cbd5e1; }

/* Minimalist Horizontal-Ruled Tables */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14px;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-table td:first-child {
  white-space: nowrap;
  width: 180px;
  color: var(--ink);
}

/* Plain Blockquote */
.docs-article blockquote {
  margin: 20px 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

/* Next Topic Card */
.next-topic {
  margin-top: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.next-topic:hover {
  border-color: #cbd5e1;
  background: var(--surface-soft);
}

.next-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin-bottom: 4px;
}

.next-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.next-arrow {
  font-size: 18px;
  color: var(--muted);
}

/* ---------- Right TOC ---------- */

.toc {
  position: sticky;
  top: 88px;
}

.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc-list a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  transition: color 120ms ease, border-color 120ms ease;
}

.toc-list a:hover { color: var(--ink); }

.toc-list a.is-active {
  color: var(--ink);
  font-weight: 500;
  border-left-color: var(--accent);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .docs {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 40px;
  }
  .toc { display: none; }
}

@media (max-width: 780px) {
  .header-inner { padding: 0 18px; }
  .header-link { display: none; }
  .docs {
    grid-template-columns: 1fr;
    padding: 28px 18px 64px;
    gap: 28px;
  }
  .docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .nav-item { width: auto; padding: 7px 11px; }
  .docs-article h1 { font-size: 28px; }
}
