* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --top-nav-height: 64px;
  --sidebar-width: 260px;
  --toc-width: 240px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: white;
  color: var(--gray-900);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

code, pre {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 50;
}

.top-nav-container {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--gray-900);
}

.top-nav-logo-img {
  width: 32px;
  height: 32px;
}

.top-nav-logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.top-nav-links {
  display: flex;
  gap: 24px;
}

.top-nav-link {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.top-nav-link:hover {
  color: var(--gray-900);
}

.top-nav-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-900);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.top-nav-button:hover {
  background: var(--gray-700);
}

/* Documentation Container */
.docs-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  margin-top: var(--top-nav-height);
  min-height: calc(100vh - var(--top-nav-height));
}

/* Left Sidebar */
.sidebar-left {
  position: sticky;
  top: var(--top-nav-height);
  height: calc(100vh - var(--top-nav-height));
  overflow-y: auto;
  border-right: 1px solid var(--gray-200);
  padding: 24px 0;
}

.sidebar-left::-webkit-scrollbar {
  width: 6px;
}

.sidebar-left::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.sidebar-nav {
  padding: 0 16px;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  margin-bottom: 12px;
  padding: 0 12px;
}

.nav-item {
  display: block;
  padding: 6px 12px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* Main Content */
.main-content {
  min-width: 0;
  padding: 48px 80px 120px 80px;
}

/* Article */
.article {
  max-width: 100%;
}

.article h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.article h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  margin-top: 64px;
  margin-bottom: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}

.article h2:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.article h3 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--gray-900);
  margin-top: 48px;
  margin-bottom: 16px;
}

.article h4 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gray-900);
  margin-top: 32px;
  margin-bottom: 12px;
}

.article p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 20px;
}

.article a {
  color: var(--blue-600);
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
}

.article ul,
.article ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.article li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.article code {
  background: var(--gray-100);
  color: #DB2777;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.article pre {
  background: #FCFCFC;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}

.article pre code {
  background: transparent;
  padding: 0;
  display: block;
  font-weight: normal;
}

.article blockquote {
  border-left: 2px solid var(--gray-300);
  padding-left: 16px;
  margin: 24px 0;
  color: var(--gray-600);
}

.article strong {
  font-weight: 600;
  color: var(--gray-900);
}

.article hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 48px 0;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

.article th,
.article td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.article th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-900);
}

.article td {
  color: var(--gray-600);
}

/* Right Sidebar - TOC */
.sidebar-right {
  position: fixed;
  top: var(--top-nav-height);
  right: 0;
  width: var(--toc-width);
  height: calc(100vh - var(--top-nav-height));
  overflow-y: auto;
  padding: 48px 16px 48px 24px;
}

.sidebar-right::-webkit-scrollbar {
  width: 6px;
}

.sidebar-right::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.toc-wrapper {
  position: sticky;
  top: 24px;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.2s;
}

.toc-link:hover {
  color: var(--blue-600);
}

.toc-link-sub {
  padding-left: 12px;
  font-size: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.footer-left {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.footer-left a {
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-left a:hover {
  color: var(--gray-900);
}

/* Responsive */
@media (max-width: 1280px) {
  .sidebar-right {
    display: none;
  }
  
  .docs-container {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
}

@media (max-width: 768px) {
  .top-nav-links {
    display: none;
  }
  
  .sidebar-left {
    display: none;
  }
  
  .docs-container {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    padding: 32px 24px;
  }
  
  .article h1 {
    font-size: 36px;
  }
  
  .article h2 {
    font-size: 24px;
  }
}
