/* iHub Docs · shared styles */
:root {
  --bg: #F6F5F1;
  --bg-2: #EFEEE9;
  --surface: #FBFAF7;
  --ink: #141517;
  --ink-2: #45484D;
  --ink-3: #6E727A;
  --line: rgba(20, 21, 23, .12);
  --line-strong: rgba(20, 21, 23, .22);
  --accent: #0E8A61;
  --accent-soft: rgba(14, 138, 97, .085);
  --accent-line: rgba(14, 138, 97, .34);
  --coral: #C2414D;
  --shadow: 0 24px 70px rgba(20, 21, 23, .08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font-sans: "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --logo-body: #111417;
  --logo-sig: #0E9E6E;
  --top-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0A0B0C;
  --bg-2: #0E0F11;
  --surface: #111214;
  --ink: #F1F1EC;
  --ink-2: #B4B7BC;
  --ink-3: #858990;
  --line: rgba(241, 241, 236, .13);
  --line-strong: rgba(241, 241, 236, .26);
  --accent: #4ADF9F;
  --accent-soft: rgba(74, 223, 159, .09);
  --accent-line: rgba(74, 223, 159, .36);
  --coral: #EC707D;
  --shadow: 0 30px 90px rgba(0, 0, 0, .55);
  --logo-body: #FFFFFF;
  --logo-sig: #3DDC97;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden;
  font-family: var(--font-sans); font-size: 15px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1000px 540px at 50% -10%, var(--accent-soft), transparent 62%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 200; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); transform: translateY(-160%); transition: transform .2s; }
.skip:focus { transform: none; }

/* top bar */
.docs-top {
  position: sticky; top: 0; z-index: 100; height: var(--top-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.docs-top-inner {
  width: min(1086px, calc(100% - 48px)); height: 100%; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: inline-flex; align-items: flex-end; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.02em; color: var(--ink); width: max-content; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand span { font-size: 15px; line-height: 1; margin-bottom: 7.5px; }
.top-divider { width: 1px; height: 18px; background: var(--line-strong); }
.top-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-link { font-size: 12.5px; color: var(--ink-2); padding: 7px 10px; border-radius: 8px; }
.top-link:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent;
  color: var(--ink-2); cursor: pointer;
  transition: color .25s, background .25s, border-color .25s;
}
.icon-btn:hover { color: var(--ink); background: var(--accent-soft); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }
.menu-btn { display: none; }
.menu-btn .lines { position: relative; width: 18px; height: 12px; }
.menu-btn .lines i { position: absolute; left: 0; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), top .3s var(--ease), opacity .2s; }
.menu-btn .lines i:nth-child(1) { top: 0; }
.menu-btn .lines i:nth-child(2) { top: 5px; }
.menu-btn .lines i:nth-child(3) { top: 10px; }
body.docs-menu-open .menu-btn .lines i:nth-child(1) { top: 5px; transform: rotate(45deg); }
body.docs-menu-open .menu-btn .lines i:nth-child(2) { opacity: 0; }
body.docs-menu-open .menu-btn .lines i:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* layout */
.docs-shell {
  width: min(1086px, calc(100% - 48px)); margin: 0 auto;
  display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 52px;
  padding: 38px 0 88px; align-items: start;
}
.docs-side {
  position: sticky; top: calc(var(--top-h) + 24px);
  max-height: calc(100vh - var(--top-h) - 48px); overflow: auto;
  padding-right: 6px;
}
.side-group { margin: 22px 0 8px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.side-group:first-child { margin-top: 0; }
.docs-side a {
  position: relative; display: block; padding: 6px 10px; margin: 1px 0;
  border-radius: 8px; color: var(--ink-2); font-size: 13.5px;
  text-decoration: none; transition: color .2s, background .2s;
}
.docs-side a:hover { color: var(--ink); background: var(--accent-soft); }
.docs-side a.active { color: var(--ink); background: var(--accent-soft); font-weight: 500; }
.docs-side a.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 14px; border-radius: 2px; background: var(--accent);
}
.docs-main { min-width: 0; }
.docs-content { max-width: 820px; }

/* content */
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 { margin: 18px 0 14px; font-size: clamp(34px, 4.6vw, 50px); line-height: 1.1; letter-spacing: -.04em; font-weight: 600; }
.doc-lede { margin: 0; max-width: 680px; font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.doc-meta { margin-top: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3); }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 26px 0 18px; }
.quick-card { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; transition: border-color .25s, transform .25s var(--ease); }
.quick-card:hover { border-color: var(--accent-line); transform: translateY(-2px); text-decoration: none; }
.quick-card b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.quick-card span { font-size: 12px; color: var(--ink-3); }

h2 { margin: 58px 0 14px; padding-top: 6px; font-size: 25px; line-height: 1.25; letter-spacing: -.03em; font-weight: 600; scroll-margin-top: calc(var(--top-h) + 22px); }
h2:first-of-type { margin-top: 42px; }
h3 { margin: 28px 0 8px; font-size: 16.5px; line-height: 1.4; letter-spacing: -.015em; font-weight: 600; scroll-margin-top: calc(var(--top-h) + 22px); }
p { margin: 10px 0; color: var(--ink-2); }
strong { color: var(--ink); font-weight: 600; }
ul, ol { margin: 10px 0; padding-left: 1.45em; color: var(--ink-2); }
li { margin: 5px 0; }
li > p { margin: 4px 0; }
code {
  padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-2); color: var(--ink); font-family: var(--font-mono); font-size: 12.3px;
}
pre {
  position: relative; margin: 14px 0 20px; padding: 18px 18px 18px;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px;
  background: #101214; color: #D5DAE0;
  overflow-x: auto; font-size: 12.5px; line-height: 1.85;
}
pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.code-copy {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  height: 26px; padding: 0 9px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(16, 18, 20, .8);
  color: #B9BFC7; font-family: var(--font-mono); font-size: 10px; cursor: pointer;
  opacity: 0; transition: opacity .2s, color .2s, border-color .2s;
}
pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .34); }
.code-copy.copied { color: #5FE0A4; border-color: rgba(95, 224, 164, .4); }
.table-wrap { margin: 16px 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; background: var(--surface); white-space: nowrap; }
td { color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td code { font-size: 11.8px; }
.callout { margin: 16px 0; padding: 13px 16px; border: 1px solid var(--line); border-left: 2px solid var(--accent-line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 13.5px; line-height: 1.8; }
.callout strong { color: var(--ink); }
.callout.warn { border-left-color: var(--coral); }
.callout.tip { border-left-color: var(--accent); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 14px 0 20px; }
.steps > li { position: relative; padding-left: 40px; margin: 14px 0; color: var(--ink-2); }
.steps > li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  display: grid; place-items: center; width: 27px; height: 27px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3);
}
.steps > li > b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.faq-q { margin: 26px 0 6px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.faq-a { margin: 0 0 4px; color: var(--ink-2); }
footer.docs-foot { margin-top: 70px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3); }
footer.docs-foot a { color: var(--ink-2); }
footer.docs-foot a:hover { color: var(--accent); }
.docs-backdrop { display: none; }
.docs-content > section { scroll-margin-top: calc(var(--top-h) + 22px); }

@media (max-width: 1000px) {
  .docs-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 34px; }
}
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; padding-top: 26px; }
  .docs-side {
    position: fixed; left: 0; top: var(--top-h); bottom: 0; z-index: 95;
    width: 286px; max-height: none; padding: 18px 18px 40px;
    background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto;
    transform: translateX(-102%); transition: transform .35s var(--ease);
  }
  body.docs-menu-open .docs-side { transform: none; }
  .docs-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(0, 0, 0, .36); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  body.docs-menu-open .docs-backdrop { opacity: 1; visibility: visible; }
  .menu-btn { display: grid; }
  .docs-content { max-width: none; }
}
@media (max-width: 600px) {
  .docs-top-inner, .docs-shell { width: calc(100% - 32px); }
  .top-label, .top-divider { display: none; }
  .top-link { display: none; }
  h1 { font-size: 34px; }
  h2 { font-size: 23px; margin-top: 46px; }
  .quick-grid { grid-template-columns: 1fr; }
  .code-copy { opacity: 1; }
  footer.docs-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (hover: none) {
  .code-copy { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
