/* Gotero User Guide — Editorial Light (Unified with Main Site) */
:root {
  --bg: #fbfbf9;
  --bg-subtle: #f3f2ee;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(251, 251, 249, 0.86);
  --ink: #111318;
  --ink-secondary: #4b5260;
  --ink-tertiary: #7b8291;
  --hairline: rgba(17, 19, 24, 0.09);
  --hairline-strong: rgba(17, 19, 24, 0.16);
  --accent: #1d3557;
  --accent-hover: #162944;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 53, 87, 0.07);
  --pill-bg: rgba(17, 19, 24, 0.045);
  --code-bg: rgba(17, 19, 24, 0.055);
  --note-bg: #f6f4ee;
  --note-border: #d8d0bf;
  --card-shadow:
    0 1px 2px rgba(17, 19, 24, 0.03),
    0 16px 38px -18px rgba(17, 19, 24, 0.12);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --font-serif-zh: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-serif-en: "Iowan Old Style", "New York", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 58px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}

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

.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.brand-sep {
  color: var(--hairline-strong);
  font-size: 14px;
}

.brand-section {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.nav-back {
  font-size: 13.5px;
  color: var(--ink-secondary);
  text-decoration: none;
}

.nav-back:hover {
  color: var(--ink);
}

.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-github:hover {
  background: var(--pill-bg);
  color: var(--ink);
}

.nav-github svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--hairline);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink-tertiary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.12);
}

/* ── Main Layout ────────────────────────────────────────────── */
.docs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 32px 96px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 84px;
}

.sidebar-search {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  margin-bottom: 18px;
}

.sidebar-search:focus {
  border-color: var(--accent);
}

.toc-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin: 0 0 10px 10px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13.5px;
  color: var(--ink-secondary);
  transition: background 0.14s ease, color 0.14s ease;
}

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

.toc-list a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 560;
}

.toc-num {
  font-size: 11.5px;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.sidebar-contact {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-tertiary);
  padding-left: 10px;
}

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

.sidebar-contact a:hover {
  text-decoration: underline;
}

/* ── Article Typography ─────────────────────────────────────── */
.doc-content {
  max-width: 780px;
}

.doc-hero {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 44px;
}

.doc-hero h1,
.doc-section h2 {
  font-family: var(--font-serif-zh);
  font-weight: 600;
  letter-spacing: -0.018em;
}

html[lang="en"] .doc-hero h1,
html[lang="en"] .doc-section h2 {
  font-family: var(--font-serif-en);
  letter-spacing: -0.024em;
}

.doc-hero h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.18;
}

.doc-hero p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--ink-secondary);
}

.doc-section {
  padding-bottom: 52px;
  margin-bottom: 52px;
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 84px;
}

.doc-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.doc-section.dimmed {
  display: none;
}

.sec-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: 10px;
}

.doc-section h2 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.24;
}

.doc-section h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.doc-section p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.76;
  color: var(--ink-secondary);
}

.doc-section ul,
.doc-section ol {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.76;
}

.doc-section li {
  margin-bottom: 6px;
}

.doc-section strong {
  color: var(--ink);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--code-bg);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 5px;
}

kbd {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}

.callout {
  margin: 18px 0 22px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-secondary);
}

.callout strong {
  color: var(--ink);
}

.doc-figure {
  margin: 22px 0 24px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-elevated);
  box-shadow: var(--card-shadow);
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 17, 23, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  cursor: zoom-out;
}

.lightbox-backdrop[hidden] {
  display: none;
}

.lightbox-img {
  max-width: min(94vw, 1520px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.55);
  background: #ffffff;
}

.doc-figure figcaption {
  padding: 11px 16px;
  font-size: 12.5px;
  color: var(--ink-tertiary);
  border-top: 1px solid var(--hairline);
  background: var(--bg);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 14px;
}

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

.doc-table th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-tertiary);
  background: var(--bg-subtle);
}

.doc-table td {
  color: var(--ink-secondary);
}

.doc-table td:first-child {
  color: var(--ink);
  font-weight: 550;
  white-space: nowrap;
}

.search-empty {
  padding: 36px 0;
  font-size: 15px;
  color: var(--ink-tertiary);
}

.docs-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-tertiary);
}

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

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 20px 64px;
  }

  .sidebar {
    position: static;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--hairline);
  }

  .toc-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .toc-list a {
    background: var(--pill-bg);
    padding: 6px 11px;
    font-size: 12.5px;
  }

  .sidebar-contact {
    display: none;
  }

  .doc-hero h1 {
    font-size: 32px;
  }

  .doc-section h2 {
    font-size: 24px;
  }

  .doc-table td:first-child {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .topnav-inner {
    padding: 0 16px;
  }

  .brand-sep,
  .brand-section {
    display: none;
  }
}
