/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-code: #f6f8fa;
  --bg-sidebar: #fafbfc;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --text-primary: #1a1a2e;
  --text-secondary: #3d3d5c;
  --text-muted: #6b7280;
  --accent: #0099e6;
  --accent-hover: #0086c0;
  --accent-dim: rgba(0, 153, 230, 0.06);
  --accent-glow: rgba(0, 153, 230, 0.12);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.06);
  --orange: #d97706;
  --orange-dim: rgba(217, 119, 6, 0.06);
  --cyan: #0891b2;
  --cyan-dim: rgba(8, 145, 178, 0.06);
  --border-color: #e5e7eb;
  --border-subtle: #f0f0f0;
  --code-green: #059669;
  --code-blue: #0099e6;
  --code-orange: #d97706;
  --code-purple: #7c3aed;
  --code-string: #059669;
  --code-keyword: #0099e6;
  --code-comment: #9ca3af;
  --sidebar-width: 260px;
  --toc-width: 200px;
  --header-height: 56px;
  --content-max: 820px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --transition: 0.18s ease;
  --transition-slow: 0.3s ease;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  word-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text-primary);
}
.header-logo svg { width: 28px; height: 28px; }

.header-nav { display: flex; gap: 2px; margin-left: 36px; }
.header-nav a {
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); transition: all var(--transition);
}
.header-nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.header-nav a.active {
  color: var(--accent); background: var(--accent-dim); font-weight: 600;
}

.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header-btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-color); color: var(--text-muted);
  background: transparent; cursor: pointer; transition: all var(--transition);
  font-family: var(--font-sans);
  min-height: 36px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.header-btn:hover { border-color: var(--accent); color: var(--accent); }
.header-btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.header-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ===== Layout ===== */
.layout {
  display: flex; margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width); position: fixed; top: var(--header-height);
  left: 0; bottom: 0; overflow-y: auto; padding: 20px 14px;
  border-right: 1px solid var(--border-color); background: var(--bg-sidebar);
  scrollbar-width: thin; scrollbar-color: var(--border-color) transparent;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-muted); padding: 0 12px; margin-bottom: 8px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-secondary); transition: all var(--transition);
  border-left: 2px solid transparent; margin-bottom: 1px;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-link.active {
  color: var(--accent); background: var(--accent-dim);
  border-left-color: var(--accent); font-weight: 600;
}

/* ===== Main Content ===== */
.main {
  margin-left: var(--sidebar-width); flex: 1;
  display: flex; justify-content: center; padding: 36px 48px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.content {
  max-width: var(--content-max);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ===== TOC ===== */
.toc {
  width: var(--toc-width); position: fixed;
  right: 20px; top: calc(var(--header-height) + 28px);
}
.toc-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-muted); margin-bottom: 12px;
}
.toc-link {
  display: block; padding: 4px 0 4px 14px; font-size: 12.5px;
  color: var(--text-muted); border-left: 2px solid var(--border-color);
  transition: all var(--transition);
}
.toc-link:hover { color: var(--text-secondary); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); }
.toc-link.indent { padding-left: 28px; }

/* ===== Typography ===== */
.content h1 {
  font-size: 34px; font-weight: 800; margin-bottom: 18px;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.content h2 {
  font-size: 21px; font-weight: 700; margin: 48px 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.content h3 {
  font-size: 16px; font-weight: 600; margin: 32px 0 10px;
  color: var(--text-primary);
}
.content p {
  margin-bottom: 16px; color: var(--text-secondary); line-height: 1.8;
}
.content ul, .content ol {
  margin: 0 0 16px 8px; padding-left: 20px; color: var(--text-secondary);
}
.content li { margin-bottom: 6px; line-height: 1.7; }
.content li::marker { color: var(--accent); }
.content strong { color: var(--text-primary); font-weight: 600; }
.content code:not(pre code) {
  background: var(--bg-tertiary); padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 13px; color: var(--code-purple);
  border: 1px solid var(--border-subtle);
}

/* ===== Hero Section ===== */
.hero {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 36px;
}
.hero-subtitle {
  font-size: 13px; color: var(--accent);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.8px; margin-bottom: 10px;
}
.hero-version {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 10px; border-radius: 20px; margin-left: 8px;
  vertical-align: middle;
}
.hero-desc {
  font-size: 15px; color: var(--text-secondary); line-height: 1.75;
  max-width: 580px; margin-bottom: 20px;
}
.hero-badges {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--bg-primary); border: 1px solid var(--border-color);
  font-size: 12px; color: var(--text-secondary);
  transition: all var(--transition);
}
.hero-badge:hover {
  border-color: var(--accent); background: var(--accent-dim);
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.hero-badge .dot.green { background: var(--green); }
.hero-badge .dot.cyan { background: var(--cyan); }
.hero-badge .dot.purple { background: var(--accent); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.4; }

/* ===== Code Block ===== */
.code-block {
  background: var(--bg-code); border: 1px solid var(--border-color);
  border-radius: var(--radius); margin: 14px 0 22px; overflow: hidden;
}
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}
.code-lang {
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.copy-btn {
  background: transparent; border: 1px solid var(--border-color); color: var(--text-muted);
  padding: 3px 10px; border-radius: 4px; font-size: 11px; cursor: pointer;
  font-family: var(--font-sans); transition: all var(--transition);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-block pre {
  padding: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; font-family: var(--font-mono);
  font-size: 13px; line-height: 1.7; color: var(--text-primary);
  scrollbar-width: thin; scrollbar-color: var(--border-color) transparent;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.code-block pre .kw { color: var(--code-keyword); }
.code-block pre .str { color: var(--code-string); }
.code-block pre .cm { color: var(--code-comment); font-style: italic; }
.code-block pre .fn { color: var(--code-orange); }
.code-block pre .op { color: var(--text-muted); }
.code-block pre .cls { color: var(--code-purple); }
.code-block pre .dec { color: var(--code-orange); }

/* ===== Pipeline Diagram ===== */
.pipeline-diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 20px 0 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  box-sizing: border-box;
}
.pipeline-flow {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; flex-wrap: wrap;
}
.pipeline-stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  min-width: 96px;
  transition: all var(--transition);
  cursor: default;
}
.pipeline-stage:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.pipeline-stage .stage-num {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}
.pipeline-stage .stage-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.pipeline-stage .stage-file {
  font-size: 10px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.pipeline-arrow {
  color: var(--text-muted); font-size: 14px; opacity: 0.45;
}

/* ===== Feature Cards ===== */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin: 18px 0 24px;
}
.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.feature-card .card-title {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 6px;
}
.feature-card .card-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}

/* ===== Table ===== */
.doc-table {
  width: 100%; border-collapse: collapse;
  margin: 14px 0 24px; font-size: 13.5px;
}
.doc-table th {
  text-align: left; padding: 10px 14px;
  font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-secondary);
}
.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.doc-table tr:hover td { background: var(--bg-hover); }
.doc-table td code {
  background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 12px; color: var(--code-purple);
  border: 1px solid var(--border-subtle);
}

/* ===== Tabs ===== */
.tabs-container { margin: 14px 0 22px; }
.tabs-header {
  display: flex; gap: 0; border-bottom: 1px solid var(--border-color);
  overflow-x: auto; scrollbar-width: none;
}
.tabs-header::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
  font-family: var(--font-sans);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; padding-top: 4px; }

/* ===== Callout / Info Box ===== */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0 22px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.callout strong { color: var(--text-primary); }
.callout.tip { border-left-color: var(--green); background: var(--green-dim); }
.callout.warning { border-left-color: var(--orange); background: var(--orange-dim); }
.callout.info { border-left-color: var(--cyan); background: var(--cyan-dim); }

/* ===== Output Block ===== */
.output-block {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 22px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
  color: var(--text-secondary); white-space: pre-wrap;
}

/* ===== API Reference Cards ===== */
.api-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin: 14px 0 18px;
  overflow: hidden;
}
.api-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.api-card-header .class-name {
  font-family: var(--font-mono); font-size: 14px;
  font-weight: 600; color: var(--code-purple);
}
.api-card-header .extends {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.api-card-header .tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; margin-left: auto;
}
.api-card-header .tag.builtin {
  background: var(--green-dim); color: var(--green);
}
.api-card-header .tag.base {
  background: var(--accent-dim); color: var(--accent);
}
.api-card-body {
  padding: 12px 16px;
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border-color); padding: 44px 48px 28px;
  margin-left: var(--sidebar-width); background: var(--bg-secondary);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 48px;
}
.footer-col h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); margin-bottom: 12px;
}
.footer-col a {
  display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--border-color); font-size: 12px; color: var(--text-muted);
}

/* ===== Page Nav ===== */
.page-nav { display: flex; justify-content: space-between; margin: 48px 0 0; gap: 14px; }
.page-nav-btn {
  flex: 1; padding: 16px 20px; border: 1px solid var(--border-color);
  border-radius: var(--radius); background: var(--bg-secondary);
  transition: all var(--transition); cursor: pointer;
}
.page-nav-btn:hover {
  border-color: var(--accent); background: var(--accent-dim);
  transform: translateY(-1px);
}
.page-nav-btn .label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.page-nav-btn .title {
  font-size: 14px; color: var(--text-primary); font-weight: 500; margin-top: 4px;
}
.page-nav-btn.next { text-align: right; }

/* ===== Install Command Box ===== */
.install-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin: 14px 0 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}
.install-box .prefix {
  color: var(--accent); font-weight: 600;
}
.install-box .cmd {
  flex: 1;
}
.install-box .copy-install {
  background: transparent; border: 1px solid var(--border-color);
  color: var(--text-muted); padding: 4px 12px; border-radius: 4px;
  font-size: 12px; cursor: pointer; font-family: var(--font-sans);
  transition: all var(--transition);
}
.install-box .copy-install:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 1300px) { 
  .toc { display: none; } 
}

@media (max-width: 1100px) {
  .content { padding: 0 20px; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 20px 16px; }
  .footer { margin-left: 0; padding: 28px 16px; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .pipeline-flow { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }
  .feature-grid { grid-template-columns: 1fr; }
  .header {
    padding: 0 16px;
  }
  .header-nav {
    margin-left: 12px;
    flex-wrap: wrap;
  }
  .header-nav a {
    padding: 4px 8px;
    font-size: 12px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-btn {
    padding: 4px 10px;
    font-size: 12px;
  }
  .hero {
    padding: 24px 16px;
  }
  .hero-subtitle {
    font-size: 12px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero-desc {
    font-size: 14px;
  }
  .hero-badges {
    gap: 6px;
  }
  .hero-badge {
    padding: 4px 8px;
    font-size: 11px;
  }
  .page-nav {
    flex-direction: column;
    gap: 12px;
  }
  .page-nav-btn {
    width: 100%;
    text-align: center;
  }
  .page-nav-btn.next {
    text-align: center;
  }
  .doc-table {
    font-size: 12px;
  }
  .doc-table th,
  .doc-table td {
    padding: 8px 10px;
  }
  .code-block pre {
    font-size: 12px;
  }
  .content h1 {
    font-size: 28px;
  }
  .content h2 {
    font-size: 20px;
  }
  .content h3 {
    font-size: 16px;
  }
  .content p {
    font-size: 14px;
  }
}

/* ===== Mobile: Medium Devices (768px and below) ===== */
@media (max-width: 768px) {
  .main {
    padding: 16px 12px;
  }
  .content h1 {
    font-size: 26px;
    margin-bottom: 16px;
  }
  .content h2 {
    font-size: 19px;
    margin: 32px 0 12px;
  }
  .content h3 {
    font-size: 15px;
    margin: 24px 0 8px;
  }
  .content p {
    font-size: 14px;
    margin-bottom: 14px;
  }
  .content ul, .content ol {
    margin: 0 0 14px 4px;
    padding-left: 18px;
  }
  .hero {
    padding: 22px 14px;
    margin-bottom: 28px;
  }
  .hero-desc {
    font-size: 13.5px;
    max-width: none;
  }
  .hero-badges {
    gap: 6px;
  }
  .header-btn.primary {
    padding: 6px 12px;
    font-size: 12px;
  }
  .code-block {
    margin: 12px 0 18px;
  }
  .code-block pre {
    padding: 12px;
    font-size: 12px;
  }
  .code-header {
    padding: 6px 12px;
  }
  .copy-btn {
    padding: 2px 8px;
    font-size: 10px;
  }
  .pipeline-diagram {
    padding: 20px 12px;
    margin: 16px 0 20px;
  }
  .pipeline-stage {
    padding: 10px 12px;
    min-width: 85px;
    font-size: 12px;
  }
  .feature-card {
    padding: 14px;
  }
  .feature-card .card-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .feature-card .card-desc {
    font-size: 12px;
  }
  .doc-table {
    font-size: 12px;
  }
  .doc-table th,
  .doc-table td {
    padding: 8px 10px;
  }
  .install-box {
    padding: 10px 12px;
    font-size: 13px;
  }
  .copy-install {
    padding: 4px 10px;
    font-size: 11px;
  }
  .tabs-header {
    padding: 0 4px;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .callout {
    padding: 12px 14px;
    font-size: 13px;
    margin: 12px 0 18px;
  }
  .page-nav-btn {
    padding: 12px 16px;
  }
  .page-nav-btn .label {
    font-size: 10px;
  }
  .page-nav-btn .title {
    font-size: 13px;
  }
}

/* ===== Mobile: Small Devices (600px and below) ===== */
@media (max-width: 600px) {
  :root {
    --header-height: 50px;
  }

  * {
    max-width: 100%;
  }

  html, body {
    font-size: 14px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .layout {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
    overflow-x: hidden;
  }

  .header {
    height: var(--header-height);
    padding: 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .header-logo {
    font-size: 13px;
    gap: 6px;
  }

  .header-logo svg {
    width: 22px;
    height: 22px;
  }

  .header-nav {
    display: none !important;
    margin-left: 0;
  }

  .header-actions {
    margin-left: auto;
    gap: 6px;
  }

  .header-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
  }

  .header-btn.primary {
    padding: 6px 12px;
    font-size: 11px;
    display: none;
  }

  .main {
    padding: 12px 10px;
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .content {
    max-width: 100%;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .content h1 {
    font-size: 22px;
    margin-bottom: 14px;
    letter-spacing: -0.4px;
    line-height: 1.3;
  }

  .content h2 {
    font-size: 17px;
    margin: 28px 0 10px;
    padding-bottom: 8px;
  }

  .content h3 {
    font-size: 14px;
    margin: 20px 0 8px;
  }

  .content p {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.7;
  }

  .content ul, .content ol {
    margin: 0 0 12px 0;
    padding-left: 16px;
  }

  .content li {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .content code:not(pre code) {
    padding: 1px 5px;
    font-size: 12px;
  }

  .breadcrumb {
    font-size: 11px;
    margin-bottom: 16px;
  }

  .hero {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 12px;
    margin-bottom: 20px;
  }

  .hero-subtitle {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .hero-version {
    font-size: 9px;
    padding: 2px 6px;
    margin-left: 6px;
  }

  .hero-desc {
    font-size: 13px;
    line-height: 1.6;
    max-width: none;
    margin-bottom: 12px;
  }

  .hero-badges {
    gap: 6px;
    flex-wrap: wrap;
  }

  .hero-badge {
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
  }

  .hero-badge .dot {
    width: 5px;
    height: 5px;
  }

  .install-box {
    flex-direction: column;
    text-align: center;
    padding: 10px 12px;
    gap: 8px;
    margin: 12px 0 18px;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-all;
  }

  .install-box .prefix,
  .install-box .cmd {
    display: block;
    width: 100%;
    word-break: break-word;
  }

  .install-box .cmd {
    word-break: break-all;
    font-size: 12px;
    padding: 4px 0;
  }

  .install-box .copy-install {
    width: 100%;
    padding: 6px 10px;
    font-size: 11px;
  }

  .code-block {
    border-radius: 6px;
    margin: 12px 0 16px;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }

  .code-header {
    padding: 6px 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .code-lang {
    font-size: 10px;
  }

  .copy-btn {
    padding: 2px 6px;
    font-size: 10px;
  }

  .code-block pre {
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.6;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .pipeline-diagram {
    padding: 14px 10px;
    border-radius: 8px;
    margin: 14px 0 18px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pipeline-flow {
    flex-direction: column;
    gap: 4px;
    min-width: min-content;
  }

  .pipeline-stage {
    padding: 8px 10px;
    min-width: 100%;
    width: 100%;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
  }

  .pipeline-stage .stage-num {
    font-size: 9px;
  }

  .pipeline-stage .stage-name {
    font-size: 11px;
  }

  .pipeline-stage .stage-file {
    font-size: 8px;
  }

  .pipeline-arrow {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0 16px;
  }

  .feature-card {
    padding: 12px;
    border-radius: 6px;
  }

  .feature-card .card-title {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .feature-card .card-desc {
    font-size: 12px;
    line-height: 1.5;
  }

  .doc-table {
    font-size: 11px;
    margin: 12px 0 16px;
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .doc-table th {
    padding: 8px 8px;
    font-size: 10px;
  }

  .doc-table td {
    padding: 8px 8px;
    word-break: break-word;
    max-width: 100%;
  }

  .doc-table td code {
    padding: 1px 4px;
    font-size: 10px;
  }

  .tabs-container {
    margin: 12px 0 16px;
  }

  .tabs-header {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tab-content {
    padding-top: 8px;
  }

  .callout {
    border-left: 3px solid var(--accent);
    padding: 10px 12px;
    font-size: 12px;
    margin: 10px 0 14px;
    border-radius: 0 4px 4px 0;
  }

  .output-block {
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.5;
    margin: 10px 0 14px;
  }

  .api-card {
    border-radius: 6px;
    margin: 10px 0 14px;
  }

  .api-card-header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .api-card-header .class-name {
    font-size: 12px;
  }

  .api-card-header .extends {
    font-size: 10px;
  }

  .api-card-header .tag {
    font-size: 9px;
    padding: 2px 6px;
    margin-left: auto;
  }

  .api-card-body {
    padding: 10px 12px;
    font-size: 12px;
  }

  .page-nav {
    flex-direction: column;
    gap: 10px;
    margin: 32px 0 0;
  }

  .page-nav-btn {
    padding: 12px;
    width: 100%;
    text-align: center;
    border-radius: 6px;
  }

  .page-nav-btn .label {
    font-size: 9px;
  }

  .page-nav-btn .title {
    font-size: 13px;
    margin-top: 4px;
  }

  .footer {
    margin-left: 0;
    padding: 20px 12px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    padding: 0;
  }

  .footer-col h4 {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .footer-col a {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .footer-bottom {
    font-size: 11px;
    margin-top: 16px;
    padding-top: 12px;
  }

  .toc {
    display: none;
  }

  .toc-link {
    font-size: 11px;
  }
}

/* ===== Extra Small Devices (480px and below) ===== */
@media (max-width: 480px) {
  .header-btn {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 40px;
  }

  .content h1 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .content h2 {
    font-size: 15px;
    margin: 20px 0 8px;
  }

  .content h3 {
    font-size: 12px;
  }

  .content p,
  .content li {
    font-size: 11px;
  }

  .hero h1 {
    font-size: 17px;
  }

  .hero-desc {
    font-size: 11px;
  }

  .install-box .cmd {
    font-size: 10px;
  }

  .code-block pre {
    font-size: 9px;
    padding: 8px 10px;
  }

  .feature-card .card-title {
    font-size: 11px;
  }

  .feature-card .card-desc {
    font-size: 10px;
  }

  .doc-table {
    font-size: 9px;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 10px;
  }

  .api-card-header .class-name {
    font-size: 10px;
  }

  .main {
    padding: 10px 8px;
  }

  .breadcrumb {
    font-size: 9px;
  }
}

/* ===== Ultra Small Devices (360px and below) ===== */
@media (max-width: 360px) {
  .header-logo {
    font-size: 12px;
  }

  .header-btn {
    padding: 5px 8px;
    font-size: 10px;
    min-height: 36px;
  }

  .content h1 {
    font-size: 16px;
  }

  .content h2 {
    font-size: 13px;
  }

  .content p {
    font-size: 10px;
    margin-bottom: 10px;
  }

  .main {
    padding: 8px 6px;
  }

  .hero {
    padding: 12px 10px;
  }

  .hero h1 {
    font-size: 15px;
  }

  .code-block pre {
    font-size: 8px;
    padding: 6px 8px;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content > * {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}
.content > *:nth-child(1) { animation-delay: 0.04s; }
.content > *:nth-child(2) { animation-delay: 0.08s; }
.content > *:nth-child(3) { animation-delay: 0.12s; }
.content > *:nth-child(4) { animation-delay: 0.16s; }
.content > *:nth-child(5) { animation-delay: 0.2s; }
.content > *:nth-child(n+6) { animation-delay: 0.24s; }

.hero {
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 0.04s;
  opacity: 0;
}

.pipeline-stage {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}
.pipeline-stage:nth-child(1) { animation-delay: 0.08s; }
.pipeline-stage:nth-child(3) { animation-delay: 0.16s; }
.pipeline-stage:nth-child(5) { animation-delay: 0.24s; }
.pipeline-stage:nth-child(7) { animation-delay: 0.32s; }
.pipeline-stage:nth-child(9) { animation-delay: 0.4s; }
.pipeline-stage:nth-child(11) { animation-delay: 0.48s; }

/* ===== Selection ===== */
::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}
