@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #EFF6FF;
  --brand-muted: #DBEAFE;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --bg: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-hover: #F1F5F9;
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --sidebar-w: 260px;
  --content-max: 740px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -5px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: var(--text); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.top-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
}
.top-nav .logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.top-nav .logo svg { width: 28px; height: 28px; }
.logo-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; background: var(--brand); color: white; padding: 1px 5px; border-radius: 4px; }
.logo-divider { color: var(--border); font-size: 20px; font-weight: 300; }
.logo-section { font-weight: 500; color: var(--text-muted); font-size: 14px; }
.nav-search { flex: 1; max-width: 380px; position: relative; }
.nav-search input { width: 100%; height: 34px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 13.5px; color: var(--text); background: var(--bg-subtle); outline: none; transition: all 0.15s; }
.nav-search input:focus { border-color: var(--brand); background: white; box-shadow: 0 0 0 3px var(--brand-muted); }
.nav-search input::placeholder { color: var(--text-light); }
.nav-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; }
.nav-search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-light); background: var(--border-light); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-family: 'JetBrains Mono', monospace; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-link { font-size: 13.5px; color: var(--text-muted); font-weight: 500; padding: 6px 12px; border-radius: var(--radius-sm); text-decoration: none; transition: all 0.12s; }
.nav-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--brand-light); color: var(--brand); }
.nav-cta { font-size: 13px; font-weight: 600; background: var(--brand); color: white; padding: 7px 14px; border-radius: var(--radius-sm); text-decoration: none; transition: background 0.12s; white-space: nowrap; }
.nav-cta:hover { background: var(--brand-dark); text-decoration: none; }

.docs-layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar { width: var(--sidebar-w); flex-shrink: 0; border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; background: var(--bg); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); padding: 12px 20px 4px; }
.sidebar-link { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 450; color: var(--text-muted); padding: 6px 20px; text-decoration: none; transition: all 0.1s; border-radius: 0; position: relative; }
.sidebar-link:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.sidebar-link.active { color: var(--brand); font-weight: 600; background: var(--brand-light); }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); border-radius: 0 2px 2px 0; }
.sidebar-link .icon { font-size: 14px; flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active .icon { opacity: 1; }

.main-content { flex: 1; min-width: 0; display: flex; justify-content: center; }
.content-wrapper { width: 100%; max-width: var(--content-max); padding: 40px 32px 80px; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--text-light); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

.article-header { margin-bottom: 32px; }
.article-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand); background: var(--brand-light); padding: 3px 10px; border-radius: 20px; margin-bottom: 12px; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--text); margin-bottom: 12px; letter-spacing: -0.02em; }
.article-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-muted); }
.article-meta span { display: flex; align-items: center; gap: 4px; }
.meta-divider { color: var(--border); }

.article-body h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 36px 0 12px; padding-top: 8px; border-top: 1px solid var(--border-light); letter-spacing: -0.01em; }
.article-body h2:first-child { margin-top: 0; border-top: none; }
.article-body h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 24px 0 8px; }
.article-body p { margin-bottom: 16px; color: #334155; line-height: 1.7; }
.article-body ul, .article-body ol { margin: 0 0 16px 0; padding-left: 0; list-style: none; }
.article-body li { position: relative; padding-left: 24px; margin-bottom: 8px; color: #334155; }
.article-body ul li::before { content: '•'; position: absolute; left: 6px; color: var(--brand); font-weight: 700; }
.article-body ol { counter-reset: steps; }
.article-body ol li { counter-increment: steps; }
.article-body ol li::before { content: counter(steps); position: absolute; left: 0; width: 18px; height: 18px; background: var(--brand); color: white; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; top: 3px; }
.article-body strong { font-weight: 700; color: var(--text); }
.article-body code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--bg-subtle); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; color: #be185d; }

.steps { margin: 24px 0; }
.step { display: flex; gap: 16px; margin-bottom: 20px; padding: 20px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.15s; }
.step:hover { border-color: var(--brand-muted); }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: white; font-size: 13px; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.step-content h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.step-content p { font-size: 14px; color: var(--text-muted); margin: 0; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); margin: 20px 0; font-size: 14px; line-height: 1.6; }
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body strong { display: block; margin-bottom: 3px; font-size: 14px; }
.callout-body li strong { display: inline; }
.callout-body p { margin: 0; }
.callout.tip { background: var(--brand-light); border-left: 3px solid var(--brand); }
.callout.tip .callout-icon { color: var(--brand); }
.callout.warning { background: var(--warning-bg); border-left: 3px solid var(--warning); }
.callout.warning .callout-icon { color: var(--warning); }
.callout.success { background: var(--success-bg); border-left: 3px solid var(--success); }
.callout.success .callout-icon { color: var(--success); }
.callout-body strong { display: block; margin-bottom: 3px; font-size: 14px; }

.screenshot-frame { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 24px 0; box-shadow: var(--shadow); }
.screenshot-bar { background: #E5E7EB; padding: 8px 12px; display: flex; gap: 5px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #FC5858; } .dot.y { background: #FDBC40; } .dot.g { background: #34C749; }
.screenshot-url { flex: 1; background: white; border-radius: 4px; font-size: 11px; color: var(--text-muted); padding: 3px 8px; font-family: 'JetBrains Mono', monospace; margin: 0 8px; }
.screenshot-img { width: 100%; display: block; background: white; min-height: 120px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-light); font-style: italic; padding: 32px; }

.ui-ref { display: inline-flex; align-items: center; gap: 4px; background: #1e293b; color: #e2e8f0; font-size: 12px; font-family: 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 4px; vertical-align: middle; }

.related-articles { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-articles h3 { font-size: 14px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.related-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; transition: all 0.15s; display: flex; align-items: center; gap: 8px; background: var(--bg); }
.related-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); text-decoration: none; }
.related-card .arrow { margin-left: auto; color: var(--text-light); font-size: 12px; }
.related-card:hover .arrow { color: var(--brand); }

.feedback-box { margin-top: 40px; padding: 20px 24px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.feedback-box p { font-size: 14px; color: var(--text-muted); margin: 0; flex: 1; }
.feedback-btns { display: flex; gap: 8px; }
.feedback-btn { padding: 6px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: white; color: var(--text-muted); transition: all 0.15s; font-family: inherit; }
.feedback-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.feedback-btn.yes:hover { border-color: var(--success); color: var(--success); background: var(--success-bg); }

.toc-sidebar { width: 200px; flex-shrink: 0; position: sticky; top: 76px; height: fit-content; max-height: calc(100vh - 100px); overflow-y: auto; padding: 4px 0 0 24px; display: none; }
@media (min-width: 1200px) { .toc-sidebar { display: block; } }
.toc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-light); margin-bottom: 8px; }
.toc-link { display: block; font-size: 13px; color: var(--text-muted); padding: 4px 0 4px 12px; border-left: 2px solid var(--border); text-decoration: none; transition: all 0.1s; margin-bottom: 2px; }
.toc-link:hover, .toc-link.active { color: var(--brand); border-left-color: var(--brand); text-decoration: none; }

.search-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 80px; backdrop-filter: blur(4px); }
.search-overlay.open { display: flex; }
.search-modal { background: white; width: 100%; max-width: 580px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.search-modal-input { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-modal-input input { flex: 1; border: none; outline: none; font-size: 16px; font-family: inherit; color: var(--text); }
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item { display: flex; gap: 12px; padding: 12px 20px; cursor: pointer; border-bottom: 1px solid var(--border-light); align-items: flex-start; transition: background 0.1s; text-decoration: none; color: inherit; }
.search-result-item:hover, .search-result-item.selected { background: var(--brand-light); }
.search-result-icon { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text); }
.search-result-cat { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.search-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-footer { padding: 10px 20px; background: var(--bg-subtle); display: flex; gap: 16px; font-size: 12px; color: var(--text-light); }
.search-footer .kbd-hint { display: flex; align-items: center; gap: 5px; }
.search-footer .kbd-hint .k { background: white; border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-family: 'JetBrains Mono', monospace; }

.reading-progress { position: fixed; top: 56px; left: 0; right: 0; height: 2px; background: var(--border-light); z-index: 99; }
.reading-progress-bar { height: 100%; background: var(--brand); width: 0%; transition: width 0.1s; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content-wrapper { padding: 24px 16px 60px; }
  h1 { font-size: 22px; }
  .nav-search .kbd { display: none; }
}