/* FluxTime Docs (/docs/), built by scripts/build-docs.mjs. Loaded after site.css on docs pages only. */

.docs-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 200px;
  gap: 56px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.docs-layout-home { grid-template-columns: 236px minmax(0, 1fr); }

/* Chinese docs (/zh/docs/): Geist has no CJK glyphs, so name the system Chinese fonts, and drop the tight tracking. */
.docs:lang(zh), .docs-search:lang(zh) { font-family: "Geist", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
.docs:lang(zh) .docs-title { letter-spacing: -0.01em; }

/* Sidebar */
.docs-sidebar {
  position: sticky; top: 64px; align-self: start;
  max-height: calc(100vh - 64px); overflow-y: auto;
  padding: 32px 4px 32px 0;
  display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.docs-search-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--fill);
  color: var(--text-3); font-size: 13.5px; cursor: pointer; text-align: left;
}
.docs-search-btn:hover { border-color: var(--line-strong); color: var(--text-2); }
.docs-search-btn span { flex: 1; }
.docs-search-btn kbd, .docs-search kbd { font-family: var(--mono); font-size: 11px; color: var(--text-4); }
.docs-nav { display: flex; flex-direction: column; gap: 4px; }
.docs-nav-section summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--text-2);
}
.docs-nav-section summary::-webkit-details-marker { display: none; }
.docs-nav-section summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--text-4); border-bottom: 1.5px solid var(--text-4); transform: rotate(-45deg); transition: transform 0.15s ease; }
.docs-nav-section[open] summary::after { transform: rotate(45deg); }
.docs-nav-section summary:hover { background: var(--fill); color: var(--text); }
.docs-nav-section a {
  display: flex; align-items: center; gap: 8px; margin: 1px 0; padding: 5px 8px 5px 18px; border-radius: 6px;
  font-size: 13.5px; color: var(--text-3);
}
.docs-nav-section a:hover { background: var(--fill); color: var(--text); }
.docs-nav-section a[aria-current="page"] { background: var(--fill-2); color: var(--text); }
.docs-nav-section[open] { padding-bottom: 6px; }
.docs-nav-footer { display: flex; flex-direction: column; gap: 2px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.docs-nav-footer a { padding: 5px 8px; border-radius: 6px; font-size: 13.5px; color: var(--text-3); }
.docs-nav-footer a:hover { background: var(--fill); color: var(--text); }

.docs-pro {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px;
  border: 1px solid rgba(124, 140, 245, 0.45); background: rgba(124, 140, 245, 0.1);
  color: #aab4fb; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em; vertical-align: middle;
}
.docs-title .docs-pro { height: 22px; margin-left: 12px; padding: 0 8px; font-size: 12px; transform: translateY(-4px); }

/* Page */
.docs-main { min-width: 0; padding: 40px 0 96px; }
.docs-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 30px; }
.docs-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-4); }
.docs-crumbs a { color: var(--text-3); }
.docs-crumbs a:hover { color: var(--text); }
.docs-copy {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px; background: transparent;
  color: var(--text-3); font-size: 13px; cursor: pointer;
}
.docs-copy:hover { border-color: var(--line-strong); color: var(--text); }
.docs-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.docs-topbar-home { margin-bottom: -30px; }
.docs-lang {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px;
  border-radius: 7px; color: var(--text-3); font-size: 13px;
}
.docs-lang:hover { background: var(--fill); color: var(--text); }
.docs-copy svg { display: inline-block; }
.docs-title { margin: 32px 0 0; font-size: 40px; line-height: 1.1; letter-spacing: -0.035em; font-weight: 600; }
.docs-lede { margin: 16px 0 0; max-width: 680px; font-size: 18px; line-height: 1.55; color: var(--text-3); }
.docs-prose { margin-top: 40px; max-width: 720px; font-size: 16px; line-height: 1.7; }
.docs-prose h2 { scroll-margin-top: 88px; margin-top: 52px; font-size: 24px; }
.docs-prose h2 a { color: inherit; text-decoration: none; }
.docs-prose h2 a:hover { color: var(--text); }
.docs-prose h3 { scroll-margin-top: 88px; margin-top: 32px; font-size: 18px; }
.docs-prose img { margin: 4px 0 28px; background: var(--surface); }
.docs-prose td, .docs-prose th { font-size: 15px; }
.docs-prose kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; background: var(--fill); font-family: var(--mono); font-size: 0.82em; line-height: 1.5; text-align: center; color: var(--text);
}
.docs-prose blockquote { padding: 14px 18px; border: 1px solid var(--line); border-left: 2px solid #7c8cf5; border-radius: 0 10px 10px 0; background: rgba(124, 140, 245, 0.05); color: var(--text-2); }
.docs-prose blockquote p { margin: 0; }
.docs-prose blockquote p + p { margin-top: 10px; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; margin-top: 64px; }
.docs-pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 15px; font-weight: 500;
}
.docs-pager a:hover { border-color: var(--line-strong); background: var(--fill); }
.docs-pager span { font-size: 12.5px; font-weight: 400; color: var(--text-4); }
.docs-pager-prev span::before { content: "← "; }
.docs-pager-next { text-align: right; grid-column: 2; }
.docs-pager-next span::after { content: " →"; }
.docs-updated { margin: 28px 0 0; font-size: 13px; color: var(--text-4); }

/* On this page */
.docs-toc {
  position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 112px 0 32px;
}
.docs-toc-title { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.docs-toc a { padding: 4px 0 4px 12px; border-left: 1px solid var(--line); font-size: 13px; line-height: 1.4; color: var(--text-4); }
.docs-toc a:hover { color: var(--text-2); }
.docs-toc a.is-active { border-left-color: var(--text); color: var(--text); }

/* Home */
.docs-home-title { margin-top: 24px; font-size: 52px; letter-spacing: -0.045em; }
.docs-home-heading { margin: 56px 0 16px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.docs-cards-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.docs-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.docs-card:hover { border-color: var(--line-strong); background: var(--fill); }
.docs-card.lg { padding: 24px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)); }
.docs-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.docs-card.lg .docs-card-title { font-size: 17px; }
.docs-card-desc { font-size: 13.5px; line-height: 1.5; color: var(--text-3); }

/* Search dialog */
.docs-search { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; padding: 12vh 16px 16px; }
.docs-search[hidden] { display: none; }
.docs-search-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.docs-search-dialog {
  position: relative; width: min(600px, 100%); max-height: 70vh; display: flex; flex-direction: column; align-self: flex-start;
  border: 1px solid var(--line-strong); border-radius: 14px; background: #121315; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); overflow: hidden;
}
.docs-search-input {
  width: 100%; height: 52px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.docs-search-input::placeholder { color: var(--text-4); }
.docs-search-results { margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.docs-search-results a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 8px; }
.docs-search-results a.is-active, .docs-search-results a:hover { background: var(--fill-2); }
.docs-search-results .r-title { font-size: 14.5px; font-weight: 500; }
.docs-search-results .r-meta { font-size: 12.5px; color: var(--text-4); }
.docs-search-empty { padding: 18px 12px; font-size: 14px; color: var(--text-3); }

/* Mobile bar: the sidebar becomes a drop-down list under the site header. */
.docs-mobile-bar { display: none; }

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

@media (max-width: 860px) {
  .docs-layout, .docs-layout-home { display: block; padding: 0 16px; }
  .docs-mobile-bar {
    display: block; position: sticky; top: 64px; z-index: 40;
    border-bottom: 1px solid var(--line-soft); background: rgba(8, 9, 10, 0.92);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .docs-menu-btn {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 16px;
    border: 0; background: transparent; color: var(--text-2); font-size: 14px; text-align: left; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .docs-menu-btn span { color: var(--text-4); }
  .docs-menu-btn::after { content: ""; margin-left: auto; flex-shrink: 0; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg) translateY(-2px); }
  .docs-sidebar { display: none; position: static; max-height: none; padding: 16px 0 24px; border-bottom: 1px solid var(--line-soft); }
  .docs.is-menu-open .docs-sidebar { display: flex; }
  .docs-main { padding: 28px 0 72px; }
  .docs-title { margin-top: 24px; font-size: 32px; }
  .docs-home-title { font-size: 40px; }
  .docs-lede { font-size: 17px; }
  .docs-copy span { display: none; }
  .docs-cards, .docs-cards-lg { grid-template-columns: minmax(0, 1fr); }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-pager-next { grid-column: auto; }
}
