/* ================================================================
   金石量化 - 帮助文档阅读页样式 (Docs)
   从 docs.html 内联 <style> 提取
   ================================================================ */

/* Layout */
.docs-wrap {
  display: flex;
  max-width: 90vw;
  margin: 80px auto 0;
  min-height: calc(100vh - 140px);
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--c-bg);
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  align-self: flex-start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 24px 0;
}
.sidebar h3 {
  padding: 0 24px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-lighter);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Sidebar items */
.doc-item {
  display: block;
  padding: 6px 24px 6px 24px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.doc-item.l0 {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  padding: 8px 24px 8px 24px;
  margin-top: 4px;
}
.doc-item.l1 { padding-left: 44px; font-size: 14px; }
.doc-item.l2 { padding-left: 64px; font-size: 14px; color: var(--c-text-light); }
.doc-item.l3 { padding-left: 84px; font-size: 13px; color: var(--c-text-lighter); }
.doc-item:hover { color: var(--c-brand); }
.doc-item.active {
  color: var(--c-brand);
  border-left-color: var(--c-brand);
  font-weight: 500;
}
.doc-item.l0.active {
  font-weight: 700;
  color: var(--c-brand);
}
.doc-item .toggle {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  color: var(--c-text-lighter);
  transition: transform .2s;
}
.doc-item .toggle.open { transform: rotate(90deg); }

/* === Content Area === */
.content-area {
  flex: 1;
  padding: 0 48px 80px;
  max-width: 820px;
  overflow-x: hidden;
  color: var(--c-text);
}

/* Headings */
.content-area h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-light);
}
.content-area h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 3rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--c-text);
}
.content-area h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 .75rem;
  color: var(--c-text);
}

/* Paragraph */
.content-area p {
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 1rem;
  color: var(--c-text);
}

/* Lists */
.content-area ul, .content-area ol {
  padding-left: 1.5em;
  margin-bottom: 1rem;
  line-height: 1.85;
}
.content-area li {
  font-size: 15px;
  line-height: 1.85;
  color: var(--c-text);
  margin-bottom: 4px;
}

/* Inline code */
.content-area code {
  background: #f3f4f5;
  color: #e74c3c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .88em;
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}

/* Code blocks */
.content-area pre {
  background: var(--c-code-bg);
  color: #abb2bf;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  font-size: 14px;
  line-height: 1.7;
}
.content-area pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Blockquote */
.content-area blockquote {
  border-left: 4px solid var(--c-brand);
  background: #f8fafc;
  padding: 12px 18px;
  margin: 1rem 0 1.5rem;
  color: var(--c-text-light);
  font-size: 14px;
  border-radius: 0 4px 4px 0;
}

/* Links */
.content-area a {
  color: var(--c-brand);
  font-weight: 500;
  text-decoration: none;
}
.content-area a:hover { text-decoration: underline; }

/* Tables */
.content-area table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
}
.content-area th, .content-area td {
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
}
.content-area th {
  background: #f8fafc;
  font-weight: 600;
}

/* Images */
.content-area img {
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  margin: 8px 0;
}
.img-wrapper { position: relative; display: inline-block; cursor: zoom-in; }
.img-wrapper img { display: block; }
.img-wrapper .zoom-icon {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 6px; font-size: 18px; line-height: 32px; text-align: center;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.img-wrapper:hover .zoom-icon { opacity: 1; }

/* Lightbox */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.82);
  z-index: 9999; display: none; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close {
  position: fixed; top: 20px; right: 28px;
  width: 40px; height: 40px; background: rgba(255,255,255,.15);
  border: none; border-radius: 50%; color: #fff; font-size: 24px;
  cursor: pointer; z-index: 10000; transition: background .2s; line-height: 40px; text-align: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* Align */
.content-area .ql-align-center { text-align: center; }
.content-area .ql-align-right { text-align: right; }

/* Welcome */
.welcome-msg {
  text-align: center;
  padding: 100px 0;
  color: var(--c-text-lighter);
}
.welcome-msg .icon { font-size: 64px; margin-bottom: 16px; }
.welcome-msg h2 { font-size: 22px; margin-bottom: 8px; color: var(--c-text-light); font-weight: 600; }
.welcome-msg p { font-size: 14px; }

/* Resizer */
.resize-bar {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background .2s;
}
.resize-bar:hover, .resize-bar.dragging { background: var(--c-brand); }

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 2px; }
