/* 巨蓝鲸AI API 文档 - Main Stylesheet */

/* Default: Dark Mode */
:root {
  --color-primary: #4f8cff;
  --color-primary-dark: #8ab4ff;
  --color-accent: #f6c343;
  --color-bg: #0b1020;
  --color-bg-elevated: #10182b;
  --color-bg-sidebar: #0f172a;
  --color-bg-code: #0d1426;
  --color-text: #eef4ff;
  --color-text-secondary: #9fb0c8;
  --color-text-sidebar: #b7c3d6;
  --color-border: #26344d;
  --color-border-light: #1b263b;
  --color-hover: #17233a;
  --color-active: #1b3154;
  --color-link: #8ab4ff;
  --color-table-header: #111a2e;
  --color-inline-code-bg: #17233a;
  --color-code-text: #f4f7fb;
  --sidebar-width: 280px;
  --header-height: 74px;
  --content-max-width: 1040px;
}

/* Light Mode */
[data-theme="light"] {
  --color-bg: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-bg-sidebar: #f8fafc;
  --color-bg-code: #f6f8fa;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-sidebar: #334155;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-hover: #eff6ff;
  --color-active: #dbeafe;
  --color-link: #2563eb;
  --color-table-header: #f8fafc;
  --color-inline-code-bg: #e2e8f0;
  --color-code-text: #1e293b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(56,189,248,0.10) 44%, transparent 52%),
    repeating-linear-gradient(90deg, transparent 0 70px, rgba(59,130,246,0.045) 70px 71px),
    repeating-linear-gradient(0deg, transparent 0 70px, rgba(168,85,247,0.035) 70px 71px);
  opacity: 0.72;
  animation: qrScan 9s ease-in-out infinite;
}

.header,
.layout {
  position: relative;
}

.layout {
  z-index: 1;
}

@keyframes qrScan {
  0%, 100% { transform: translateX(-5%); opacity: 0.48; }
  50% { transform: translateX(5%); opacity: 0.86; }
}

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(18, 7, 31, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 16px;
}

.logo:hover { text-decoration: none; }

.logo-img {
  height: 36px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.header-nav a {
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: #F5C242;
  text-decoration: none;
}

.header-nav a.nav-highlight {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.header-nav a.nav-highlight:hover {
  background: linear-gradient(135deg, #fbbf24, #f87171);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-login {
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.header-login:hover {
  color: #F5C242;
  text-decoration: none;
}

.header-register {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 12px;
  background: #F5C242;
  color: #1A1033;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.header-register:hover {
  background: #E0AE2F;
  text-decoration: none;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}

.sidebar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* Layout */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--color-bg-sidebar) 0%, rgba(22,13,40,0.97) 100%);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 50;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sidebar-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-text-secondary);
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 0 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar-close:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

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

/* Navigation items */
.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0 8px;
  letter-spacing: 0.3px;
}

.nav-section-title:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.nav-section-title .arrow {
  font-size: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text-secondary);
  opacity: 0.4;
}

.nav-section.collapsed .arrow {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-children {
  display: none;
}

.nav-children {
  list-style: none;
  position: relative;
  padding: 4px 0 6px;
}

.nav-children::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 4px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--color-border) 0%, transparent 100%);
  border-radius: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 6px 14px 6px 34px;
  font-size: 13px;
  color: var(--color-text-sidebar);
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.5;
  border-radius: 6px;
  margin: 1px 8px;
  position: relative;
  border-left: 2px solid transparent;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--color-border);
  transition: background 0.2s;
}

.nav-item:hover {
  background: var(--color-hover);
  color: var(--color-link);
  text-decoration: none;
  transform: translateX(1px);
}

.nav-item:hover::before {
  background: var(--color-link);
}

.nav-item.active {
  background: var(--color-active);
  color: var(--color-primary);
  font-weight: 600;
  border-left-color: var(--color-primary);
}

.nav-item.active::before {
  background: var(--color-primary);
}

.nav-method {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.5px;
  line-height: 14px;
  vertical-align: middle;
  font-family: "SF Mono", "Fira Code", monospace;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-method.post {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.nav-method.get {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-method.put {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.nav-method.delete {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.nav-item.active .nav-method.post {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}

.nav-item.active .nav-method.get {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.nav-item.active .nav-method.put {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}

.nav-item.active .nav-method.delete {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.nav-subsection .nav-section-title {
  padding-left: 32px;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.nav-subsection .nav-item {
  padding-left: 44px;
}

.nav-subsection .nav-item::before {
  left: 20px;
  width: 12px;
}

.nav-subsection .nav-children::before {
  left: 32px;
}

.nav-subsection .nav-subsection .nav-item {
  padding-left: 56px;
}

.nav-subsection .nav-subsection .nav-item::before {
  left: 32px;
  width: 12px;
}

.nav-subsection .nav-subsection .nav-children::before {
  left: 44px;
}

.nav-subsection .nav-subsection .nav-section-title {
  padding-left: 44px;
}

/* Content */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  max-width: calc(var(--content-max-width) + 80px);
  padding: 32px 40px 60px;
  min-width: 0;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-link);
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 4px;
  color: var(--color-border);
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

/* Doc content */
.doc-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
  line-height: 1.3;
}

.doc-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.doc-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--color-text);
}

.doc-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 6px;
  color: var(--color-text);
}

.doc-content p,
.doc-content section {
  margin: 0 0 12px;
}

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

.doc-content li {
  margin-bottom: 4px;
}

/* Reset nested divs from Apifox content - prevent visual indentation */
.doc-content div {
  margin: 0;
  padding: 0;
  max-width: none;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 14px;
}

.doc-content th, .doc-content td {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: var(--color-table-header);
  font-weight: 600;
}

.doc-content blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--color-bg-sidebar);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
  color: var(--color-text-secondary);
}

.doc-content blockquote p:last-child {
  margin-bottom: 0;
}

.doc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

/* Code blocks */
.doc-content pre {
  position: relative;
  background: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-code-text);
}

.doc-content pre code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

.doc-content code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
  background: var(--color-inline-code-bg);
  color: var(--color-text);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

.copy-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.copy-btn.copied {
  background: #dcfce7;
  color: #16a34a;
  border-color: #bbf7d0;
}

/* Page navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin: 40px 0 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
  gap: 16px;
}

.page-nav a {
  color: var(--color-link);
  font-size: 14px;
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: all 0.15s;
}

.page-nav a:hover {
  background: var(--color-hover);
  text-decoration: none;
  border-color: var(--color-primary);
}

.page-nav-prev { margin-right: auto; }
.page-nav-next { margin-left: auto; }

/* Footer */
.doc-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.doc-footer a {
  color: var(--color-text-secondary);
}

.doc-footer a:hover {
  color: var(--color-link);
}

/* Tip/Warning/Info boxes */
.doc-content .tip,
.doc-content .warning,
.doc-content .info {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0 16px;
}

.doc-content .tip {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
}

.doc-content .warning {
  background: #fefce8;
  border-left: 3px solid #eab308;
}

.doc-content .info {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85vw;
    max-width: 320px;
    top: 0;
    bottom: 0;
    height: auto;
    max-height: 100vh;
    z-index: 200;
    transition: left 0.25s ease;
    padding-top: 0;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-header {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 150;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .content {
    margin-left: 0;
    padding: 20px 16px 40px;
  }

  .header-nav {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 44px;
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    padding: 0 16px;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 90;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .header-nav a:last-child {
    margin-right: 16px;
  }

  .header-nav a {
    flex-shrink: 0;
    font-size: 14px;
    padding: 12px 0;
    white-space: nowrap;
  }

  .header-nav a.nav-highlight {
    padding: 6px 14px;
  }

  .content {
    margin-left: 0;
    margin-top: 44px;
    padding: 20px 16px 40px;
  }

  .header-actions .header-login,
  .header-actions .header-register {
    display: none;
  }

  .logo-text {
    font-size: 16px;
  }

  .doc-content h1 { font-size: 22px; }
  .doc-content h2 { font-size: 18px; }
  .doc-content h3 { font-size: 16px; }

  .doc-content pre {
    padding: 12px;
    font-size: 12px;
  }

  .page-nav {
    flex-direction: column;
  }

  .doc-content table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }

  .doc-content th, .doc-content td {
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  .logo-sub { display: none; }
  .header-nav a:nth-child(2) { display: none; }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
  transition: background 0.2s;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* Print styles */
@media print {
  .header, .sidebar, .sidebar-toggle, .sidebar-overlay, .page-nav { display: none; }
  .content { margin-left: 0; max-width: 100%; padding: 0; }
}

/* Theme Toggle */
.theme-toggle {
  background: var(--color-border);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--color-active);
}

.theme-icon-dark { display: inline; }
.theme-icon-light { display: none; }

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }

/* Tip/Warning/Info boxes dark mode adjustments */
.doc-content .tip {
  background: #0a1f0a;
  border-left: 3px solid #22c55e;
}
.doc-content .warning {
  background: #1f1a0a;
  border-left: 3px solid #eab308;
}
.doc-content .info {
  background: #0a1520;
  border-left: 3px solid #3b82f6;
}

[data-theme="light"] .doc-content .tip {
  background: #f0fdf4;
}
[data-theme="light"] .doc-content .warning {
  background: #fefce8;
}
[data-theme="light"] .doc-content .info {
  background: #eff6ff;
}

/* Copy button dark mode */
.copy-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.copy-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

/* API Reference Styles */
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 24px;
  padding: 16px 20px;
  background: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  flex-wrap: wrap;
}

.api-method {
  display: inline-block;
  padding: 4px 12px;
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.api-method.post { background: #22c55e; }
.api-method.get { background: #3b82f6; }
.api-method.put { background: #f59e0b; }
.api-method.delete { background: #ef4444; }

.api-url {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;
  font-size: 14px;
  color: var(--color-text);
  word-break: break-all;
}

.api-debug-btn {
  margin-left: auto;
  padding: 6px 16px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.api-debug-btn:hover {
  opacity: 0.85;
  text-decoration: none;
  color: #fff;
}

.param-section {
  margin: 20px 0;
}

.param-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.param-required {
  color: #ef4444;
  font-size: 12px;
  margin-left: 4px;
}

.param-optional {
  color: var(--color-text-secondary);
  font-size: 12px;
  margin-left: 4px;
}

.param-type {
  color: var(--color-primary-dark);
  font-size: 12px;
  font-family: "SF Mono", monospace;
}

.param-enum {
  display: inline-block;
  background: var(--color-active);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--color-primary);
  margin: 2px 2px;
}

/* === Apifox-style Parameter Cards === */
.param-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
}

.param-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
}

.param-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.param-card-content-type {
  display: inline-block;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-inline-code-bg);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin-left: 8px;
  vertical-align: middle;
}

.param-card-body {
  padding: 4px 0;
}

.param-row {
  padding: 10px 16px;
}

.param-row + .param-row {
  border-top: 1px solid var(--color-border-light);
}

.param-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.param-name {
  font-size: 12px;
  font-weight: 600;
  color: #1890ff;
  padding: 0 8px;
  line-height: 22px;
  white-space: nowrap;
  font-family: "SF Mono", "Fira Code", monospace;
  cursor: pointer;
}

.param-name:hover {
  text-decoration: underline;
}

.param-type-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 22px;
  white-space: nowrap;
}

.param-type-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-left: 2px;
}

.param-divider {
  flex: 1;
  height: 0;
  margin: 0 6px;
  border-top: 1px dashed transparent;
  transition: border-color 0.15s;
}

.param-row:hover .param-divider {
  border-top-color: var(--color-border);
}

.param-badge {
  font-size: 12px;
  white-space: nowrap;
  padding: 0 12px;
  line-height: 22px;
}

.param-badge.required {
  color: #f79009;
}

.param-badge.optional {
  color: var(--color-text-secondary);
}

.param-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  padding-left: 8px;
  line-height: 1.6;
}

.param-desc code {
  font-size: 12px;
}

.param-example-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  padding-left: 8px;
  font-size: 13px;
}

.param-example-key {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.param-example-value {
  color: var(--color-text);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  word-break: break-all;
}

/* Authorization collapsible section */
.auth-section {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.auth-header:hover {
  background: var(--color-hover);
}

.auth-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  font-size: 10px;
  transition: transform 0.2s;
}

.auth-section.collapsed .auth-arrow {
  transform: rotate(-90deg);
}

.auth-section.collapsed .auth-body {
  display: none;
}

.auth-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.auth-body {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.auth-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #1890ff;
  background: rgba(24,144,255,0.08);
  padding: 0 8px;
  border-radius: 4px;
  line-height: 22px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.auth-example {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-example code {
  font-size: 13px;
  padding: 4px 12px;
  background: var(--color-bg-code);
  border-radius: 4px;
  border: 1px solid var(--color-border);
  word-break: break-all;
}

/* Body parameters split layout (schema + example) */
.param-card-body-split {
  display: flex;
  flex-direction: column;
}

@media (min-width: 880px) {
  .param-card-body-split {
    flex-direction: row;
  }
}

.param-schema {
  flex: 3;
  padding: 4px 0;
  min-width: 0;
}

.param-example-panel {
  flex: 2;
  border-top: 1px solid var(--color-border);
  padding: 12px 16px;
  background: var(--color-bg-code);
  min-width: 0;
}

@media (min-width: 880px) {
  .param-example-panel {
    border-top: none;
    border-left: 1px solid var(--color-border);
  }
}

.param-example-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.param-example-panel pre {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--color-code-text);
  line-height: 1.5;
}

.param-example-panel pre code {
  font-size: 12px;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
}

/* Nested parameter tree lines */
.param-nested {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
}

.param-nested .param-row {
  position: relative;
}

.param-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 2px;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.param-expand-btn.collapsed {
  transform: rotate(-90deg);
}

.param-children {
  overflow: hidden;
}

.param-children.collapsed {
  display: none;
}

/* Enum values inline */
.param-enum-list {
  display: inline;
}

.param-enum-val {
  display: inline-block;
  background: var(--color-active);
  padding: 0 6px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--color-primary);
  margin: 2px 2px;
  font-family: "SF Mono", "Fira Code", monospace;
  line-height: 20px;
}

.response-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 8px;
}

.response-status.success { background: #16a34a20; color: #22c55e; }
.response-status.error { background: #ef444420; color: #ef4444; }

/* Debug Panel */
.debug-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.debug-panel-sidebar {
  background: var(--color-bg-sidebar);
  border-left: 1px solid var(--color-border);
  width: 520px;
  max-width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.debug-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.debug-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
}

.debug-close:hover { color: var(--color-text); background: var(--color-hover); }

/* URL bar */
.debug-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-bg-code);
  border-bottom: 1px solid var(--color-border);
}

.debug-method-badge {
  background: #f97316;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.debug-url-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 13px;
  font-family: monospace;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

.debug-url-input:focus { border-color: var(--color-primary); }

.debug-send-top {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 2px;
}

.debug-send-top:hover { opacity: 0.85; }
.debug-send-top:disabled { opacity: 0.5; cursor: not-allowed; }

/* Scrollable body */
.debug-body-scroll {
  flex: 1;
  overflow-y: auto;
}

/* Sections */
.debug-section {
  border-bottom: 1px solid var(--color-border);
}

.debug-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.debug-section-toggle:hover { background: var(--color-hover); }

.debug-section-arrow {
  font-size: 10px;
  color: var(--color-text-secondary);
  display: inline-block;
  width: 12px;
  text-align: center;
}

.debug-section-content {
  padding: 0 16px 12px;
}

/* Auth row - simplified, no tabs */
.debug-auth-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.debug-auth-prefix {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-code);
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
  font-weight: 500;
}

.debug-auth-row input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

.debug-eye-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  border-left: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 14px;
  opacity: 0.5;
}

.debug-eye-btn:hover { opacity: 1; }

/* Headers table - editable */
.debug-headers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.debug-headers-table td {
  padding: 3px 4px;
  vertical-align: middle;
}

.debug-headers-table tr { border-bottom: 1px solid var(--color-border-light); }
.debug-headers-table tr:last-child { border-bottom: none; }

.debug-hdr-check {
  width: 30px;
  text-align: center;
}

.debug-hdr-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.debug-hdr-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text);
  outline: none;
  font-family: monospace;
}

.debug-hdr-input:focus {
  border-color: var(--color-primary);
  background: var(--color-bg);
}

.debug-hdr-input[readonly] {
  color: var(--color-text-secondary);
}

.debug-hdr-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.4;
}

.debug-hdr-del { width: 24px; text-align: center; }

.debug-hdr-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 3px;
  line-height: 1;
}

.debug-headers-table tr:hover .debug-hdr-del-btn { opacity: 0.5; }
.debug-hdr-del-btn:hover { opacity: 1 !important; color: #ef4444; }

.debug-hdr-add-row td { padding: 5px 4px; }

/* Body toolbar */
.debug-body-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.debug-example-select {
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  outline: none;
}

.debug-body-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.debug-body-format-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-bg-code);
  color: var(--color-text-secondary);
  font-weight: 500;
  border: 1px solid var(--color-border);
}

.debug-trash-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0.5;
}

.debug-trash-btn:hover { opacity: 1; color: #ef4444; }

/* Editor with syntax highlighting */
.debug-editor-wrap {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg-code);
}

.debug-highlight-pre {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  padding-left: 48px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre;
  overflow: auto;
  pointer-events: none;
  margin: 0;
}

.debug-editor-wrap textarea {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 12px;
  padding-left: 48px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: var(--color-text);
  resize: none;
  min-height: 180px;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

.debug-editor-wrap textarea::selection { background: rgba(37, 99, 235, 0.3); }

.debug-editor-gutter {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  padding: 10px 6px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  opacity: 0.4;
  text-align: right;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  z-index: 1;
}

/* JSON syntax highlighting */
.dj-key { color: #7dd3fc; }
.dj-str { color: #fbbf24; }
.dj-num { color: #4ade80; }
.dj-bool { color: #c084fc; }
[data-theme="light"] .dj-key { color: #0369a1; }
[data-theme="light"] .dj-str { color: #c2410c; }
[data-theme="light"] .dj-num { color: #15803d; }
[data-theme="light"] .dj-bool { color: #7c3aed; }

/* Add section buttons (Query, Cookie) */
.debug-add-sections {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}

.debug-add-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.debug-add-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Result area at bottom */
.debug-result-area {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-code);
}

.debug-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.debug-result-header:hover { background: var(--color-hover); }

.debug-result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--color-text-secondary);
  font-size: 13px;
  opacity: 0.5;
}

.debug-result-placeholder-icon { font-size: 28px; }

.debug-response-pre {
  padding: 12px 16px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text);
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.debug-status-ok { color: #22c55e; font-weight: 600; font-size: 12px; }
.debug-status-err { color: #ef4444; font-weight: 600; font-size: 12px; }

/* Code Language Tabs */
.code-tabs {
  margin: 16px 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.code-tabs-header {
  display: flex;
  background: var(--color-bg-code);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  white-space: nowrap;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}

.code-tab:hover {
  color: var(--color-text);
  background: var(--color-hover);
}

.code-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--color-active);
}

.code-tabs-content {
  position: relative;
}

.code-tab-panel {
  display: none;
}

.code-tab-panel.active {
  display: block;
}

.code-tab-panel pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Tutorial step layout (教程) */
.tutorial-intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 28px;
}

.tutorial-card {
  background: linear-gradient(180deg, #1B1033 0%, #140B27 100%);
  border: 1px solid rgba(245,194,66,0.18);
  border-radius: 18px;
  padding: 28px 24px;
  margin-bottom: 32px;
}

.tutorial-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tutorial-card-title {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
}

.tutorial-card-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: #D9D2E9;
  margin: 0 0 16px;
}

.tutorial-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.progress-step {
  font-size: 14px;
  font-weight: 600;
  color: #F5C242;
}

.progress-arrow {
  font-size: 14px;
  color: #7A6B94;
}

.install-step {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F5C242;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h4 {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
}

.step-body p {
  font-size: 16px;
  line-height: 1.8;
  color: #EDE6F5;
  margin: 8px 0 12px;
}

.step-body p a {
  color: #F5C242;
}

.step-body ul {
  font-size: 14px;
  line-height: 1.7;
  color: #D9D2E9;
  padding-left: 20px;
  margin: 6px 0;
}

.step-body ul li {
  margin-bottom: 4px;
}

.step-body code {
  background: rgba(245,194,66,0.12);
  color: #EDE6F5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.terminal-block {
  background: #0D0519;
  border: 1px solid rgba(245,194,66,0.12);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 10px;
  overflow-x: auto;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #eab308; }
.terminal-dots span:nth-child(3) { background: #22c55e; }

.terminal-label {
  font-size: 12px;
  color: #7A6B94;
  margin-left: 8px;
}

.terminal-block pre {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 15px;
  line-height: 1.7;
  color: #EDE6F5;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-block pre code {
  color: #EDE6F5;
}

.os-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.os-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.os-tab.active {
  background: #F5C242;
  color: #1A1033;
}

.os-tab:not(.active) {
  background: rgba(255,255,255,0.08);
  color: #D9D2E9;
}

.os-panel {
  display: none;
}
.os-panel-heading {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 10px;
}
.os-panel-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #D9D2E9;
  margin: 0 0 20px;
}

.os-panel.active {
  display: block;
}

.config-file-label {
  font-size: 12px;
  color: #7A6B94;
  margin-bottom: 4px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}

.step-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

/* Light mode override for tutorial card */
[data-theme="light"] .tutorial-card {
  background: linear-gradient(180deg, #f8f6ff 0%, #f0ecfa 100%);
  border: 1px solid rgba(37,99,235,0.15);
}

[data-theme="light"] .tutorial-card-title {
  color: #1a1033;
}

[data-theme="light"] .tutorial-card-subtitle {
  color: #555;
}

[data-theme="light"] .step-body h4 {
  color: #1a1033;
}

[data-theme="light"] .step-body p,
[data-theme="light"] .step-body ul {
  color: #555;
}

[data-theme="light"] .step-body p a {
  color: #2563eb;
}

[data-theme="light"] .terminal-block {
  background: #1e1e2e;
}

[data-theme="light"] .os-tab:not(.active) {
  color: #555;
  background: rgba(0,0,0,0.06);
}

/* Tutorial warning box */
.tutorial-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
  color: #F5C242;
  font-size: 14px;
  line-height: 1.5;
}

.tutorial-warning svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-warning p {
  font-size: 14px;
  line-height: 1.5;
  color: #F5C242;
  margin: 0;
}

.doc-content .tool-guide {
  --tool-guide-color: #38bdf8;
  margin: 44px 0 56px;
  padding: 24px 22px 30px;
  border-left: 4px solid var(--tool-guide-color);
  background: color-mix(in srgb, var(--tool-guide-color) 11%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--tool-guide-color) 22%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--tool-guide-color) 18%, transparent);
}

.doc-content .tool-guide-codex {
  --tool-guide-color: #38bdf8;
}

.doc-content .tool-guide-desktop {
  --tool-guide-color: #a78bfa;
}

.doc-content .tool-guide-terminal {
  --tool-guide-color: #f59e0b;
}

html[data-theme] .doc-content .tool-guide > h2 {
  margin-top: 0;
  color: var(--tool-guide-color);
  border-bottom-color: color-mix(in srgb, var(--tool-guide-color) 34%, transparent);
}

html[data-theme] .doc-content .tool-guide > h2::after {
  background: var(--tool-guide-color);
}

html[data-theme] .doc-content .tool-guide > h3 {
  color: var(--tool-guide-color);
}

html[data-theme="light"] .doc-content .tool-guide-codex {
  --tool-guide-color: #0284c7;
}

html[data-theme="light"] .doc-content .tool-guide-desktop {
  --tool-guide-color: #7c3aed;
}

html[data-theme="light"] .doc-content .tool-guide-terminal {
  --tool-guide-color: #d97706;
}

html[data-theme="light"] .doc-content .tool-guide {
  background: color-mix(in srgb, var(--tool-guide-color) 7%, #ffffff);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--tool-guide-color) 20%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--tool-guide-color) 16%, transparent);
}

html[data-theme="light"] .doc-content .tool-guide > h2,
html[data-theme="light"] .doc-content .tool-guide > h3 {
  color: var(--tool-guide-color);
}

@media (max-width: 768px) {
  .doc-content .tool-guide {
    margin: 36px 0 44px;
    padding: 20px 14px 24px;
    border-left-width: 3px;
  }
}

.tutorial-shot-placeholder {
  margin: 14px 0 22px;
  padding: 22px;
  border: 1px dashed rgba(245, 194, 66, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(245, 194, 66, 0.08), rgba(56, 213, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  color: var(--color-text-secondary);
}

.tutorial-shot-placeholder span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 194, 66, 0.14);
  color: #f5c242;
  font-size: 13px;
  font-weight: 700;
}

.tutorial-shot-placeholder strong {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-primary);
  font-size: 16px;
}

.tutorial-shot-placeholder p {
  margin: 0;
}

/* Tutorial sub-step with yellow left border */
.tutorial-substep {
  margin: 16px 0 0 0;
  padding-left: 14px;
  border-left: 2px solid #F5C242;
}

.tutorial-substep-title {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 6px;
}

.tutorial-substep p {
  font-size: 15px;
  line-height: 1.7;
  color: #EDE6F5;
  margin: 6px 0;
}

/* Tutorial checklist with green checks */
.tutorial-checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.tutorial-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #EDE6F5;
  margin-bottom: 6px;
}

.tutorial-checklist li svg {
  flex-shrink: 0;
  margin-top: 3px;
}

/* Visual refresh */
body {
  background:
    radial-gradient(circle at 20% -10%, rgba(79, 140, 255, 0.14), transparent 34rem),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 18rem),
    var(--color-bg);
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 20% -10%, rgba(37, 99, 235, 0.10), transparent 34rem),
    var(--color-bg);
}

.header {
  background: rgba(11, 16, 32, 0.88);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

[data-theme="light"] .header {
  background: rgba(255,255,255,0.90);
}

.header-inner {
  max-width: none;
  padding: 0 24px;
  gap: 20px;
}

.logo,
.header-nav a,
.header-login {
  color: var(--color-text);
}

.header-nav {
  gap: 18px;
}

.header-nav a,
.header-login {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.88;
}

.header-nav a:hover,
.header-login:hover {
  color: var(--color-accent);
  opacity: 1;
}

.header-nav a.nav-highlight {
  background: rgba(246,195,67,0.12);
  border: 1px solid rgba(246,195,67,0.34);
  color: #ffd977;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
}

.header-nav a.nav-highlight:hover {
  background: rgba(246,195,67,0.18);
  color: #ffe39a;
}

[data-theme="light"] .header-nav a.nav-highlight {
  color: #7a5200;
  background: rgba(246,195,67,0.18);
}

.header-register {
  border-radius: 8px;
  background: var(--color-accent);
  color: #151a26;
  box-shadow: 0 8px 20px rgba(246,195,67,0.18);
}

.theme-toggle {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.sidebar {
  background: linear-gradient(180deg, var(--color-bg-sidebar) 0%, #0b1222 100%);
  border-right: 1px solid var(--color-border-light);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.sidebar-nav {
  padding: 14px 8px 24px;
}

.nav-section-title {
  margin: 1px 0;
  padding: 8px 10px;
  border-radius: 7px;
  letter-spacing: 0;
}

.nav-children::before {
  left: 18px;
  opacity: 0.65;
}

.nav-item {
  margin: 1px 0;
  padding: 7px 10px 7px 30px;
  border-left: 0;
  border-radius: 7px;
}

.nav-item::before {
  left: 11px;
  width: 10px;
  opacity: 0.7;
}

.nav-item:hover {
  transform: none;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79,140,255,0.28), rgba(79,140,255,0.13));
  box-shadow: inset 0 0 0 1px rgba(79,140,255,0.28);
}

[data-theme="light"] .nav-item.active {
  color: #153c86;
}

.nav-method {
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 15px;
}

.content {
  width: min(calc(100vw - var(--sidebar-width)), calc(var(--content-max-width) + 96px));
  max-width: none;
  padding: 38px 48px 72px;
}

.doc-content {
  max-width: var(--content-max-width);
}

.breadcrumb {
  margin-bottom: 22px;
}

.doc-content h1 {
  font-size: 32px;
  margin-bottom: 18px;
  letter-spacing: 0;
}

.doc-content h2 {
  font-size: 23px;
  margin: 40px 0 14px;
  border-bottom-color: var(--color-border);
}

.doc-content h3 {
  margin-top: 30px;
}

.doc-content p,
.doc-content li {
  color: var(--color-text-secondary);
}

.doc-content strong,
.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.breadcrumb-current {
  color: var(--color-text);
}

.doc-content table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.doc-content th,
.doc-content td {
  border-width: 0 0 1px 1px;
  padding: 10px 12px;
}

.doc-content th:first-child,
.doc-content td:first-child {
  border-left: 0;
}

.doc-content tr:last-child td {
  border-bottom: 0;
}

.doc-content pre,
.code-tabs,
.param-card,
.auth-section {
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
}

.doc-content pre {
  border-color: var(--color-border-light);
  padding: 18px;
}

.doc-content code {
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
}

.copy-btn {
  border-radius: 6px;
  background: var(--color-bg-elevated);
}

.api-endpoint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(79,140,255,0.12), rgba(16,24,43,0.92));
  border-color: var(--color-border-light);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.16);
}

[data-theme="light"] .api-endpoint {
  background: linear-gradient(135deg, rgba(37,99,235,0.07), #ffffff);
}

.api-method {
  border-radius: 7px;
}

.api-url {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--color-code-text);
}

[data-theme="light"] .api-url {
  color: var(--color-text);
}

.api-debug-btn {
  margin-left: 0;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(79,140,255,0.20);
}

.param-card,
.auth-section,
.code-tabs {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-light);
}

.param-card-header,
.code-tabs-header,
.auth-header {
  background: rgba(255,255,255,0.025);
}

[data-theme="light"] .param-card-header,
[data-theme="light"] .code-tabs-header,
[data-theme="light"] .auth-header {
  background: #f8fafc;
}

.param-row {
  transition: background 0.15s;
}

.param-row:hover {
  background: rgba(255,255,255,0.025);
}

[data-theme="light"] .param-row:hover {
  background: #f8fafc;
}

.param-name,
.auth-tag {
  color: var(--color-link);
}

.page-nav a {
  border-radius: 8px;
  background: var(--color-bg-elevated);
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 14px;
    gap: 12px;
  }

  .content {
    width: 100%;
    padding: 24px 16px 48px;
  }

  .doc-content h1 {
    font-size: 24px;
  }

  .doc-content h2 {
    font-size: 19px;
    margin-top: 32px;
  }

  .api-endpoint {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .api-method {
    width: max-content;
  }

  .api-debug-btn {
    width: 100%;
    text-align: center;
  }

  .param-row-header,
  .auth-example {
    align-items: flex-start;
  }

  .param-divider {
    display: none;
  }
}

/* Professional light theme */
html[data-theme="light"] {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #60a5fa;
  --color-secondary: #10b981;
  --color-bg: #f5f7fb;
  --color-bg-elevated: #ffffff;
  --color-bg-sidebar: #ffffff;
  --color-bg-code: #0f172a;
  --color-text: #111827;
  --color-text-secondary: #4b5c73;
  --color-text-muted: #7a8798;
  --color-text-sidebar: #334155;
  --color-border: #dbe3ef;
  --color-border-light: #edf2f7;
  --color-hover: #eef4ff;
  --color-active: #e8f1ff;
  --color-link: #1d4ed8;
  --color-table-header: #f8fafc;
  --color-inline-code-bg: #eef2f7;
  --color-code-text: #e5edf8;
  --header-height: 72px;
  --content-max-width: 1060px;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(37,99,235,0.10), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(16,185,129,0.09), transparent 26rem),
    #f5f7fb;
  color: var(--color-text);
}

html[data-theme="light"] .header {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid rgba(219,227,239,0.95);
  box-shadow: 0 10px 32px rgba(15,23,42,0.06);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .header-inner {
  max-width: 1680px;
  padding: 0 30px;
}

html[data-theme="light"] .logo {
  color: #0f172a;
}

html[data-theme="light"] .logo-text {
  letter-spacing: 0;
}

html[data-theme="light"] .header-nav a {
  color: #475569;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
}

html[data-theme="light"] .header-nav a:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

html[data-theme="light"] .register-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 0 !important;
  box-shadow: 0 12px 24px rgba(37,99,235,0.24);
}

html[data-theme="light"] .theme-toggle {
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

html[data-theme="light"] .sidebar {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  background: rgba(255,255,255,0.96);
  border-right: 1px solid rgba(219,227,239,0.95);
  box-shadow: 16px 0 44px rgba(15,23,42,0.06);
}

html[data-theme="light"] .sidebar-nav {
  padding: 18px 12px 32px;
}

html[data-theme="light"] .nav-section-title {
  color: #64748b;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
}

html[data-theme="light"] .nav-section-title:hover {
  color: #0f172a;
  background: #f8fafc;
}

html[data-theme="light"] .nav-item {
  color: #475569;
  border-radius: 9px;
  padding: 8px 10px 8px 31px;
}

html[data-theme="light"] .nav-item:hover {
  color: #0f172a;
  background: #f3f7ff;
}

html[data-theme="light"] .nav-item.active {
  color: #1d4ed8;
  background: linear-gradient(135deg, #eaf2ff, #f7fbff);
  /* left accent bar provided by ::after in the refined sidebar block */
  box-shadow: 0 8px 18px rgba(37,99,235,0.10);
}

html[data-theme="light"] .nav-item::before {
  background: #94a3b8;
}

html[data-theme="light"] .nav-item.active::before {
  background: #2563eb;
}

html[data-theme="light"] .nav-children::before {
  background: #e2e8f0;
}

html[data-theme="light"] .nav-method {
  background: #eef2ff;
  border: 1px solid #dbeafe;
}

html[data-theme="light"] .content {
  width: min(calc(100vw - var(--sidebar-width)), 1180px);
  padding: 34px 56px 80px;
}

html[data-theme="light"] .breadcrumb {
  margin: 0 0 16px 4px;
  color: #64748b;
}

html[data-theme="light"] .breadcrumb a {
  color: #64748b;
}

html[data-theme="light"] .breadcrumb-current {
  color: #0f172a;
}

html[data-theme="light"] .doc-content {
  max-width: var(--content-max-width);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(226,232,240,0.95);
  border-radius: 22px;
  padding: 44px 50px 50px;
  box-shadow: 0 28px 80px rgba(15,23,42,0.09);
}

html[data-theme="light"] .doc-content h1 {
  color: #0f172a;
  font-size: 36px;
  line-height: 1.18;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

html[data-theme="light"] .intro-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 28px;
  overflow: hidden;
  margin: 4px 0 30px;
  padding: 34px;
  border: 1px solid rgba(191,219,254,0.9);
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 12%, rgba(244,114,182,0.24), transparent 28%),
    radial-gradient(circle at 72% 82%, rgba(34,211,238,0.22), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef6ff 46%, #fff7ed 100%);
  box-shadow: 0 24px 54px rgba(37,99,235,0.10);
}

html[data-theme="light"] .intro-hero::before {
  content: "";
  position: absolute;
  inset: -60px auto auto -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, rgba(37,99,235,0.22), rgba(14,165,233,0.10), rgba(249,115,22,0.20), rgba(37,99,235,0.22));
  animation: introSpin 13s linear infinite;
}

html[data-theme="light"] .intro-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 12px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(191,219,254,0.95);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(37,99,235,0.08);
}

html[data-theme="light"] .intro-hero h2 {
  position: relative;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: 0;
}

html[data-theme="light"] .intro-hero p {
  position: relative;
  max-width: 610px;
  margin: 0;
  color: #334155;
  font-size: 16px;
}

html[data-theme="light"] .intro-orbit {
  position: relative;
  min-height: 196px;
}

html[data-theme="light"] .intro-orbit span {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 40px;
  padding: 0 13px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(226,232,240,0.95);
  border-radius: 999px;
  box-shadow: 0 16px 30px rgba(15,23,42,0.10);
  animation: introFloat 5.5s ease-in-out infinite;
}

html[data-theme="light"] .intro-orbit span:nth-child(1) {
  top: 10px;
  left: 10px;
  color: #1d4ed8;
}

html[data-theme="light"] .intro-orbit span:nth-child(2) {
  top: 62px;
  right: 0;
  color: #c2410c;
  animation-delay: -1.4s;
}

html[data-theme="light"] .intro-orbit span:nth-child(3) {
  left: 0;
  bottom: 38px;
  color: #047857;
  animation-delay: -2.6s;
}

html[data-theme="light"] .intro-orbit span:nth-child(4) {
  right: 26px;
  bottom: 0;
  color: #7c3aed;
  animation-delay: -3.8s;
}

html[data-theme="light"] .intro-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 26px;
}

html[data-theme="light"] .intro-stats div,
html[data-theme="light"] .intro-card-grid section {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(15,23,42,0.06);
}

html[data-theme="light"] .intro-stats div {
  padding: 18px 20px;
}

html[data-theme="light"] .intro-stats div::before,
html[data-theme="light"] .intro-card-grid section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #f97316);
}

html[data-theme="light"] .intro-stats strong {
  display: block;
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
}

html[data-theme="light"] .intro-stats span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="light"] .intro-lead {
  padding: 18px 20px;
  color: #334155;
  background: linear-gradient(135deg, #fff7ed, #f8fbff);
  border: 1px solid #fed7aa;
  border-radius: 14px;
}

html[data-theme="light"] .intro-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 34px;
}

html[data-theme="light"] .intro-card-grid section {
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html[data-theme="light"] .intro-card-grid section:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: 0 24px 46px rgba(37,99,235,0.12);
}

html[data-theme="light"] .intro-card-grid strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  margin-bottom: 10px;
}

html[data-theme="light"] .intro-card-grid p {
  margin: 0;
  color: #52647a;
  font-size: 14px;
}

@keyframes introFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

@keyframes introSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] .intro-hero::before,
  html[data-theme="light"] .intro-orbit span {
    animation: none;
  }
}

html[data-theme="light"] .doc-content h2 {
  color: #0f172a;
  font-size: 24px;
  margin-top: 44px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

html[data-theme="light"] .doc-content h3,
html[data-theme="light"] .doc-content h4 {
  color: #182235;
}

html[data-theme="light"] .doc-content p,
html[data-theme="light"] .doc-content li {
  color: #4b5c73;
}

html[data-theme="light"] .doc-content a {
  color: #1d4ed8;
  text-decoration-color: rgba(37,99,235,0.28);
}

html[data-theme="light"] .doc-content blockquote {
  background: #f8fbff;
  border-left-color: #2563eb;
}

html[data-theme="light"] .doc-content table {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 30px rgba(15,23,42,0.04);
}

html[data-theme="light"] .doc-content th {
  color: #334155;
  background: #f8fafc;
}

html[data-theme="light"] .doc-content td {
  color: #4b5c73;
  background: #ffffff;
}

html[data-theme="light"] .doc-content tr:hover td {
  background: #fbfdff;
}

html[data-theme="light"] .doc-content pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: 0 18px 42px rgba(15,23,42,0.20);
}

html[data-theme="light"] .doc-content code {
  color: #1e40af;
  background: #eef2f7;
  border-color: #dbe3ef;
}

html[data-theme="light"] .doc-content pre code {
  color: #e5edf8;
  background: transparent;
  border: 0;
}

html[data-theme="light"] .api-endpoint {
  background: linear-gradient(135deg, #0f172a, #172554);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 22px 48px rgba(15,23,42,0.22);
}

html[data-theme="light"] .api-url {
  color: #f8fafc;
}

html[data-theme="light"] .api-method {
  box-shadow: 0 8px 16px rgba(0,0,0,0.16);
}

html[data-theme="light"] .api-debug-btn {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 12px 24px rgba(59,130,246,0.28);
}

html[data-theme="light"] .api-debug-btn:hover {
  background: #2563eb;
}

html[data-theme="light"] .param-card,
html[data-theme="light"] .auth-section,
html[data-theme="light"] .code-tabs {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15,23,42,0.06);
}

html[data-theme="light"] .param-card-header,
html[data-theme="light"] .code-tabs-header,
html[data-theme="light"] .auth-header {
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .param-row {
  border-top-color: #edf2f7;
}

html[data-theme="light"] .param-row:hover {
  background: #f8fbff;
}

html[data-theme="light"] .param-name,
html[data-theme="light"] .auth-tag {
  color: #1d4ed8;
}

html[data-theme="light"] .code-tab {
  color: #64748b;
}

html[data-theme="light"] .code-tab.active {
  color: #1d4ed8;
  background: #eff6ff;
}

html[data-theme="light"] .copy-btn {
  color: #cbd5e1;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

html[data-theme="light"] .page-nav a {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 28px rgba(15,23,42,0.05);
}

html[data-theme="light"] .page-nav a:hover {
  background: #f8fbff;
  border-color: #bfdbfe;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

@media (max-width: 768px) {
  html[data-theme="light"] .header-inner {
    padding: 0 14px;
  }

  html[data-theme="light"] .content {
    width: 100%;
    padding: 18px 12px 46px;
  }

  html[data-theme="light"] .doc-content {
    border-radius: 16px;
    padding: 24px 18px 30px;
  }

  html[data-theme="light"] .doc-content h1 {
    font-size: 26px;
    margin-bottom: 22px;
  }

  html[data-theme="light"] .intro-hero,
  html[data-theme="light"] .intro-card-grid,
  html[data-theme="light"] .intro-stats {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .intro-hero {
    padding: 24px 20px;
  }

  html[data-theme="light"] .intro-hero h2 {
    font-size: 24px;
  }

  html[data-theme="light"] .intro-orbit {
    min-height: 150px;
  }

  html[data-theme="light"] .doc-content h2 {
    font-size: 20px;
  }

  html[data-theme="light"] .sidebar {
    max-width: 340px;
    box-shadow: 20px 0 48px rgba(15,23,42,0.16);
  }
}

/* Futuristic visual layer */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 4%, rgba(37,99,235,0.30), transparent 28%),
    radial-gradient(circle at 86% 6%, rgba(168,85,247,0.24), transparent 26%),
    radial-gradient(circle at 80% 78%, rgba(6,182,212,0.18), transparent 28%),
    linear-gradient(135deg, #050816 0%, #0b1020 42%, #111827 100%);
}

html[data-theme="dark"] .header {
  background:
    linear-gradient(135deg, rgba(3,7,18,0.92), rgba(22,10,45,0.88)),
    radial-gradient(circle at 32% 0%, rgba(56,189,248,0.26), transparent 36%);
  border-bottom: 1px solid rgba(56,189,248,0.30);
  box-shadow: 0 20px 60px rgba(0,0,0,0.42);
}

html[data-theme="dark"] .header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a78bfa, #f59e0b, transparent);
}

html[data-theme="dark"] .logo-text {
  background: linear-gradient(90deg, #ffffff, #7dd3fc 46%, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="dark"] .header-nav a.nav-highlight,
html[data-theme="dark"] .header-register {
  background: linear-gradient(135deg, #2563eb, #06b6d4 48%, #f97316);
  color: #fff;
  box-shadow: 0 0 26px rgba(14,165,233,0.34);
}

html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(37,99,235,0.18), transparent 34%),
    linear-gradient(180deg, rgba(7,12,28,0.96), rgba(15,23,42,0.94));
  border-right: 1px solid rgba(56,189,248,0.22);
  box-shadow: 18px 0 60px rgba(0,0,0,0.30);
}

html[data-theme="dark"] .nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.24), rgba(6,182,212,0.16), rgba(168,85,247,0.14));
  color: #93c5fd;
  border-color: rgba(56,189,248,0.36);
  /* left accent bar provided by ::after in the refined sidebar block */
  box-shadow: 0 0 26px rgba(14,165,233,0.14);
}

html[data-theme="dark"] .doc-content {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(37,99,235,0.14), transparent 32%),
    linear-gradient(180deg, rgba(15,23,42,0.94), rgba(8,13,28,0.94));
  border: 1px solid rgba(56,189,248,0.28);
  border-radius: 22px;
  padding: 44px 50px 50px;
  box-shadow:
    0 32px 92px rgba(0,0,0,0.36),
    0 0 0 1px rgba(125,211,252,0.12) inset,
    0 0 42px rgba(14,165,233,0.10);
}

html[data-theme="dark"] .doc-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a78bfa, #f97316, transparent);
  border-radius: 999px;
}

html[data-theme="dark"] .doc-content h1 {
  font-size: 36px;
  line-height: 1.18;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(56,189,248,0.18);
  background: linear-gradient(90deg, #ffffff, #7dd3fc 48%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="dark"] .doc-content h2 {
  border-bottom-color: rgba(56,189,248,0.18);
}

html[data-theme="dark"] .doc-content h2::after {
  content: "";
  display: block;
  width: 84px;
  height: 3px;
  margin-top: 10px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #f97316);
  border-radius: 999px;
}

html[data-theme="dark"] .doc-content .markdown-child-root p {
  margin: 8px 0;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(15,23,42,0.86), rgba(30,41,59,0.68));
  border: 1px solid rgba(56,189,248,0.22);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.20), 0 0 18px rgba(14,165,233,0.08);
}

html[data-theme="dark"] .doc-content table {
  overflow: hidden;
  border-color: rgba(56,189,248,0.26);
  border-radius: 14px;
  box-shadow: 0 20px 54px rgba(0,0,0,0.30);
}

html[data-theme="dark"] .doc-content th {
  color: #e0f2fe;
  background: linear-gradient(135deg, #020617, #172554 58%, #164e63);
}

html[data-theme="dark"] .doc-content pre,
html[data-theme="dark"] .api-endpoint {
  background:
    radial-gradient(circle at 12% 0%, rgba(34,211,238,0.18), transparent 30%),
    linear-gradient(135deg, #020617, #0f172a 48%, #172554);
  border: 1px solid rgba(56,189,248,0.34);
  box-shadow: 0 24px 58px rgba(0,0,0,0.34), 0 0 30px rgba(14,165,233,0.14);
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(37,99,235,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.035) 1px, transparent 1px),
    radial-gradient(circle at 16% 6%, rgba(37,99,235,0.22), transparent 28%),
    radial-gradient(circle at 82% 2%, rgba(168,85,247,0.18), transparent 26%),
    radial-gradient(circle at 88% 76%, rgba(6,182,212,0.16), transparent 26%),
    linear-gradient(135deg, #f8fbff 0%, #eef6ff 46%, #fff7ed 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto, auto;
}

html[data-theme="light"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.36) 44%, transparent 52%),
    radial-gradient(circle at 50% 0%, rgba(59,130,246,0.08), transparent 42%);
  animation: qrLightSweep 12s ease-in-out infinite;
}

html[data-theme="light"] .header {
  background:
    linear-gradient(135deg, rgba(10,18,38,0.92), rgba(25,18,55,0.88)),
    radial-gradient(circle at 28% 0%, rgba(59,130,246,0.28), transparent 34%);
  border-bottom: 1px solid rgba(125,211,252,0.26);
  box-shadow: 0 18px 54px rgba(15,23,42,0.28);
}

html[data-theme="light"] .header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a78bfa, #f59e0b, transparent);
  opacity: 0.88;
}

html[data-theme="light"] .logo-text {
  background: linear-gradient(90deg, #ffffff, #bfdbfe 42%, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .header-nav a.nav-highlight,
html[data-theme="light"] .header-register {
  background: linear-gradient(135deg, #2563eb, #06b6d4 48%, #f97316);
  color: #fff;
  box-shadow: 0 10px 24px rgba(14,165,233,0.26);
}

html[data-theme="light"] .header-nav a.nav-highlight:hover,
html[data-theme="light"] .header-register:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(239,246,255,0.88)),
    radial-gradient(circle at 28% 0%, rgba(59,130,246,0.16), transparent 34%);
  border-right: 1px solid rgba(125,211,252,0.36);
  box-shadow: 18px 0 58px rgba(15,23,42,0.08);
}

html[data-theme="light"] .nav-section-title {
  color: #64748b;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

html[data-theme="light"] .nav-item {
  border: 1px solid transparent;
}

html[data-theme="light"] .nav-item:hover {
  background: linear-gradient(135deg, rgba(239,246,255,0.98), rgba(236,254,255,0.88));
  border-color: rgba(147,197,253,0.52);
}

html[data-theme="light"] .nav-item.active {
  background: linear-gradient(135deg, rgba(219,234,254,0.96), rgba(224,242,254,0.94), rgba(255,247,237,0.86));
  color: #1d4ed8;
  border-color: rgba(96,165,250,0.55);
  /* left accent bar provided by ::after in the refined sidebar block */
  box-shadow: 0 12px 28px rgba(37,99,235,0.16);
}

html[data-theme="light"] .doc-content {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.96)),
    radial-gradient(circle at 100% 0%, rgba(37,99,235,0.08), transparent 30%);
  border: 1px solid rgba(147,197,253,0.44);
  box-shadow:
    0 30px 90px rgba(15,23,42,0.12),
    0 0 0 1px rgba(255,255,255,0.72) inset;
}

html[data-theme="light"] .doc-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2563eb, #06b6d4, #a855f7, #f97316, transparent);
  border-radius: 999px;
}

html[data-theme="light"] .doc-content h1 {
  background: linear-gradient(90deg, #0f172a, #1d4ed8 44%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .doc-content h2 {
  border-bottom: 1px solid rgba(191,219,254,0.8);
}

html[data-theme="light"] .doc-content h2::after {
  content: "";
  display: block;
  width: 84px;
  height: 3px;
  margin-top: 10px;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #f97316);
  border-radius: 999px;
}

html[data-theme="light"] .doc-content .markdown-child-root p {
  margin: 8px 0;
  padding: 10px 14px;
  color: #334155;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(239,246,255,0.88));
  border: 1px solid rgba(191,219,254,0.72);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(37,99,235,0.07);
}

html[data-theme="light"] .doc-content table {
  overflow: hidden;
  border-color: rgba(147,197,253,0.56);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(37,99,235,0.10);
}

html[data-theme="light"] .doc-content th {
  color: #e0f2fe;
  background: linear-gradient(135deg, #0f172a, #1e3a8a 58%, #164e63);
}

html[data-theme="light"] .doc-content tr:hover td {
  background: linear-gradient(90deg, #f8fbff, #ecfeff);
}

html[data-theme="light"] .doc-content pre,
html[data-theme="light"] .api-endpoint {
  background:
    radial-gradient(circle at 12% 0%, rgba(34,211,238,0.16), transparent 30%),
    linear-gradient(135deg, #08111f, #0f172a 48%, #172554);
  border: 1px solid rgba(56,189,248,0.34);
  box-shadow: 0 24px 58px rgba(15,23,42,0.28), 0 0 30px rgba(14,165,233,0.12);
}

html[data-theme="light"] .api-debug-btn,
html[data-theme="light"] .code-tab.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
}

html[data-theme="light"] .param-card,
html[data-theme="light"] .auth-section,
html[data-theme="light"] .code-tabs {
  border-color: rgba(147,197,253,0.54);
  box-shadow: 0 20px 46px rgba(37,99,235,0.10);
}

@keyframes qrLightSweep {
  0%, 100% { opacity: 0.38; transform: translateX(-8%); }
  50% { opacity: 0.72; transform: translateX(8%); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] body::before {
    animation: none;
  }
}

/* 巨蓝鲸AI 主站 palette alignment */
:root {
  --qr-purple-980: #0c0516;
  --qr-purple-950: #12071f;
  --qr-purple-900: #1a1033;
  --qr-purple-850: #24103f;
  --qr-purple-800: #2d1350;
  --qr-gold: #f5c242;
  --qr-gold-light: #ffd76a;
  --qr-gold-soft: rgba(245, 194, 66, 0.14);
  --qr-cyan: #38d5ff;
  --qr-pink: #ff5da8;
  --qr-text-on-dark: #efe9ff;
  --qr-muted-on-dark: #b9aacd;
}

html[data-theme="dark"] {
  --color-primary: var(--qr-gold);
  --color-primary-dark: var(--qr-gold-light);
  --color-accent: var(--qr-gold);
  --color-bg: var(--qr-purple-950);
  --color-bg-elevated: rgba(25, 9, 45, 0.92);
  --color-bg-sidebar: rgba(16, 5, 30, 0.94);
  --color-bg-code: #07020f;
  --color-text: var(--qr-text-on-dark);
  --color-text-secondary: var(--qr-muted-on-dark);
  --color-text-sidebar: #d9cdf0;
  --color-border: rgba(245, 194, 66, 0.22);
  --color-border-light: rgba(255, 215, 106, 0.12);
  --color-hover: rgba(245, 194, 66, 0.10);
  --color-active: rgba(245, 194, 66, 0.15);
  --color-link: var(--qr-gold);
  --color-table-header: #1a0a2e;
}

html[data-theme="light"] {
  --color-primary: #b57d00;
  --color-primary-dark: #7c4f00;
  --color-accent: #d09300;
  --color-link: #8a5b00;
  --color-active: rgba(245, 194, 66, 0.18);
  --color-hover: rgba(245, 194, 66, 0.11);
  --color-border: rgba(92, 54, 130, 0.18);
  --color-border-light: rgba(245, 194, 66, 0.22);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% -8%, rgba(245, 194, 66, 0.20), transparent 20%),
    radial-gradient(circle at 12% 10%, rgba(255, 93, 168, 0.16), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(56, 213, 255, 0.14), transparent 28%),
    linear-gradient(180deg, var(--qr-purple-900) 0%, var(--qr-purple-950) 38%, #07020f 100%);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(245, 194, 66, 0.22), transparent 24%),
    radial-gradient(circle at 88% 4%, rgba(92, 54, 130, 0.14), transparent 28%),
    linear-gradient(180deg, #fffaf0 0%, #fbf7ff 42%, #f7f2ff 100%);
}

body::after {
  background:
    linear-gradient(115deg, transparent 0%, rgba(245, 194, 66, 0.12) 44%, transparent 52%),
    repeating-linear-gradient(90deg, transparent 0 82px, rgba(245, 194, 66, 0.045) 82px 83px),
    repeating-linear-gradient(0deg, transparent 0 82px, rgba(56, 213, 255, 0.035) 82px 83px);
  opacity: 0.62;
}

.header,
html[data-theme="light"] .header,
html[data-theme="dark"] .header {
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 194, 66, 0.10), transparent 34%),
    rgba(12, 5, 22, 0.88);
  border-bottom: 1px solid rgba(245, 194, 66, 0.22);
  box-shadow: 0 18px 54px rgba(4, 1, 10, 0.44);
}

.header::after,
html[data-theme="light"] .header::after,
html[data-theme="dark"] .header::after {
  background: linear-gradient(90deg, transparent, var(--qr-gold), var(--qr-cyan), var(--qr-pink), transparent);
  opacity: 0.78;
}

.logo-text,
html[data-theme="light"] .logo-text,
html[data-theme="dark"] .logo-text {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #ffffff !important;
}

.header-nav a,
html[data-theme="light"] .header-nav a {
  color: #e3d8f5;
}

.header-nav a:hover,
.header-login:hover,
html[data-theme="light"] .header-nav a:hover {
  color: var(--qr-gold);
}

.header-nav a.nav-highlight,
html[data-theme="dark"] .header-nav a.nav-highlight,
html[data-theme="light"] .header-nav a.nav-highlight {
  padding: 0;
  color: var(--qr-gold);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 0 16px rgba(245, 194, 66, 0.26);
}

.header-nav a.nav-highlight:hover,
html[data-theme="dark"] .header-nav a.nav-highlight:hover,
html[data-theme="light"] .header-nav a.nav-highlight:hover {
  color: var(--qr-gold-light);
  background: transparent;
  transform: translateY(-1px);
}

.header-register,
html[data-theme="dark"] .header-register,
html[data-theme="light"] .header-register,
.api-debug-btn,
html[data-theme="light"] .api-debug-btn,
html[data-theme="dark"] .api-debug-btn,
.copy-btn.copied,
.code-tab.active,
html[data-theme="light"] .code-tab.active {
  color: var(--qr-purple-900);
  background: linear-gradient(180deg, var(--qr-gold-light) 0%, var(--qr-gold) 100%);
  border: 1px solid rgba(255, 230, 142, 0.70);
  box-shadow: 0 12px 28px rgba(245, 194, 66, 0.24), 0 0 22px rgba(245, 194, 66, 0.16);
}

.header-register {
  border-radius: 8px;
  font-weight: 700;
}

.header-register:hover,
html[data-theme="dark"] .header-register:hover,
html[data-theme="light"] .header-register:hover,
.api-debug-btn:hover,
html[data-theme="light"] .api-debug-btn:hover {
  color: var(--qr-purple-900);
  background: linear-gradient(180deg, #ffe28a 0%, #f5c242 100%);
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.theme-toggle,
html[data-theme="light"] .theme-toggle {
  color: var(--qr-gold);
  background: rgba(245, 194, 66, 0.08);
  border: 1px solid rgba(245, 194, 66, 0.28);
  box-shadow: 0 0 18px rgba(245, 194, 66, 0.10);
}

.theme-toggle:hover {
  background: rgba(245, 194, 66, 0.16);
  border-color: rgba(255, 215, 106, 0.58);
}

html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 194, 66, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(18, 7, 31, 0.96), rgba(8, 2, 17, 0.96));
  border-right: 1px solid rgba(245, 194, 66, 0.18);
}

html[data-theme="light"] .sidebar {
  background:
    radial-gradient(circle at 34% 0%, rgba(245, 194, 66, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 245, 0.94), rgba(249, 244, 255, 0.94));
  border-right: 1px solid rgba(92, 54, 130, 0.15);
}

.nav-item.active,
html[data-theme="dark"] .nav-item.active,
html[data-theme="light"] .nav-item.active {
  color: var(--qr-gold);
  background: linear-gradient(135deg, rgba(245, 194, 66, 0.16), rgba(56, 213, 255, 0.08));
  border-color: rgba(245, 194, 66, 0.32);
  /* left accent bar provided by ::after in the refined sidebar block */
  box-shadow: 0 12px 28px rgba(245, 194, 66, 0.10);
}

html[data-theme="dark"] .doc-content {
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 194, 66, 0.13), transparent 30%),
    radial-gradient(circle at 0% 8%, rgba(56, 213, 255, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(28, 10, 51, 0.94), rgba(10, 3, 22, 0.94));
  border: 1px solid rgba(245, 194, 66, 0.24);
  box-shadow: 0 34px 96px rgba(0, 0, 0, 0.40), 0 0 42px rgba(245, 194, 66, 0.08);
}

html[data-theme="light"] .doc-content {
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 194, 66, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 242, 0.95));
  border: 1px solid rgba(92, 54, 130, 0.16);
  box-shadow: 0 30px 90px rgba(38, 16, 70, 0.12);
}

.doc-content::before,
html[data-theme="dark"] .doc-content::before,
html[data-theme="light"] .doc-content::before {
  background: linear-gradient(90deg, transparent, var(--qr-gold), var(--qr-pink), var(--qr-cyan), transparent);
}

.doc-content h1,
html[data-theme="dark"] .doc-content h1,
html[data-theme="light"] .doc-content h1 {
  background: linear-gradient(90deg, #ffffff 0%, var(--qr-gold-light) 44%, var(--qr-cyan) 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom-color: rgba(245, 194, 66, 0.18);
}

html[data-theme="light"] .doc-content h1 {
  background: linear-gradient(90deg, var(--qr-purple-900) 0%, #9b6400 48%, #255e86 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.doc-content h2::after,
html[data-theme="dark"] .doc-content h2::after,
html[data-theme="light"] .doc-content h2::after {
  background: linear-gradient(90deg, var(--qr-gold), var(--qr-pink), var(--qr-cyan));
}

html[data-theme="dark"] .doc-content .markdown-child-root p {
  background: linear-gradient(135deg, rgba(31, 10, 55, 0.86), rgba(13, 4, 27, 0.72));
  border-color: rgba(245, 194, 66, 0.20);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.20), 0 0 20px rgba(245, 194, 66, 0.08);
}

html[data-theme="light"] .doc-content .markdown-child-root p {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 226, 0.82));
  border-color: rgba(245, 194, 66, 0.30);
  box-shadow: 0 10px 24px rgba(146, 93, 0, 0.06);
}

.doc-content th,
html[data-theme="dark"] .doc-content th,
html[data-theme="light"] .doc-content th {
  color: var(--qr-gold-light);
  background: linear-gradient(135deg, #160624, #24103f 58%, #32124d);
}

.doc-content pre,
.api-endpoint,
html[data-theme="dark"] .doc-content pre,
html[data-theme="dark"] .api-endpoint,
html[data-theme="light"] .doc-content pre,
html[data-theme="light"] .api-endpoint {
  background:
    radial-gradient(circle at 12% 0%, rgba(245, 194, 66, 0.13), transparent 30%),
    linear-gradient(135deg, #07020f, #160624 50%, #24103f);
  border: 1px solid rgba(245, 194, 66, 0.30);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.32), 0 0 30px rgba(245, 194, 66, 0.10);
}

.param-name,
.auth-tag {
  color: var(--qr-gold);
}

.page-nav a,
html[data-theme="light"] .page-nav a {
  border-color: rgba(245, 194, 66, 0.24);
  box-shadow: 0 14px 32px rgba(38, 16, 70, 0.10);
}

.page-nav a:hover,
html[data-theme="light"] .page-nav a:hover {
  color: var(--qr-purple-900);
  background: linear-gradient(180deg, var(--qr-gold-light), var(--qr-gold));
  border-color: rgba(255, 230, 142, 0.74);
}

/* Dark theme: blue-tech document surface */
html[data-theme="dark"] {
  --color-primary: #38d5ff;
  --color-primary-dark: #7dd3fc;
  --color-accent: #f6c33b;
  --color-bg: #070d1a;
  --color-bg-elevated: rgba(9, 20, 39, 0.94);
  --color-bg-sidebar: rgba(5, 11, 22, 0.96);
  --color-bg-code: #050a14;
  --color-text: #eef5ff;
  --color-text-secondary: #9fb0c8;
  --color-text-sidebar: #b9c7dc;
  --color-border: rgba(56, 213, 255, 0.24);
  --color-border-light: rgba(96, 165, 250, 0.16);
  --color-hover: rgba(56, 213, 255, 0.09);
  --color-active: rgba(56, 213, 255, 0.15);
  --color-link: #7dd3fc;
  --color-table-header: #0b1730;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.22), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(168, 85, 247, 0.18), transparent 30%),
    radial-gradient(circle at 76% 12%, rgba(251, 146, 60, 0.12), transparent 24%),
    linear-gradient(135deg, #071225 0%, #080d1d 42%, #140920 100%);
}

html[data-theme="dark"] .header {
  background:
    radial-gradient(circle at 34% 0%, rgba(56, 213, 255, 0.14), transparent 34%),
    rgba(5, 10, 20, 0.88);
  border-bottom: 1px solid rgba(56, 213, 255, 0.24);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .header::after {
  background: linear-gradient(90deg, #22d3ee, #60a5fa, #a78bfa, #fb923c, #eab308);
  opacity: 0.88;
}

html[data-theme="dark"] .logo-text {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #ffffff !important;
}

html[data-theme="dark"] .header-nav a {
  color: #cbd8ec;
}

html[data-theme="dark"] .header-nav a:hover,
html[data-theme="dark"] .header-login:hover {
  color: #7dd3fc;
}

html[data-theme="dark"] .header-nav a.nav-highlight {
  color: #f6c33b;
  text-shadow: 0 0 16px rgba(246, 195, 59, 0.28);
}

html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 100% 0%, rgba(56, 213, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(7, 14, 29, 0.98), rgba(4, 8, 18, 0.98));
  border-right: 1px solid rgba(56, 213, 255, 0.20);
  box-shadow: 18px 0 58px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .nav-section-title {
  color: #a9b8cf;
}

html[data-theme="dark"] .nav-item:hover {
  background: linear-gradient(90deg, rgba(56, 213, 255, 0.08), rgba(96, 165, 250, 0.06), rgba(168, 85, 247, 0.06));
}

html[data-theme="dark"] .nav-item.active {
  color: #bfeaff;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.22), rgba(96, 165, 250, 0.14), rgba(168, 85, 247, 0.16));
  border-color: rgba(56, 213, 255, 0.34);
  /* the left accent bar is now drawn by ::after (refined sidebar) */
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.10);
}

html[data-theme="dark"] .doc-content {
  background:
    radial-gradient(circle at 96% 0%, rgba(96, 165, 250, 0.16), transparent 32%),
    radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(10, 22, 44, 0.96), rgba(7, 14, 29, 0.96));
  border: 1px solid rgba(56, 213, 255, 0.28);
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.40),
    0 0 0 1px rgba(96, 165, 250, 0.12) inset,
    0 0 42px rgba(34, 211, 238, 0.10);
}

html[data-theme="dark"] .doc-content::before {
  background: linear-gradient(90deg, #22d3ee, #60a5fa, #a78bfa, #fb923c, #eab308);
}

html[data-theme="dark"] .doc-content h1 {
  background: linear-gradient(90deg, #f8fbff 0%, #8be3ff 48%, #a8c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom-color: rgba(56, 213, 255, 0.18);
}

html[data-theme="dark"] .doc-content h2 {
  color: #eef5ff;
  border-bottom-color: rgba(56, 213, 255, 0.18);
}

html[data-theme="dark"] .doc-content h2::after {
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #fb923c);
}

html[data-theme="dark"] .doc-content .markdown-child-root p {
  background: linear-gradient(135deg, rgba(13, 23, 43, 0.86), rgba(16, 22, 43, 0.72));
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), 0 0 20px rgba(34, 211, 238, 0.08);
}

html[data-theme="dark"] .doc-content table {
  border-color: rgba(56, 213, 255, 0.28);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .doc-content th {
  color: #eef5ff;
  background: linear-gradient(90deg, #101a3d, #11445d 52%, #101a3d);
}

html[data-theme="dark"] .doc-content tr:hover td {
  background: rgba(56, 213, 255, 0.055);
}

html[data-theme="dark"] .doc-content pre,
html[data-theme="dark"] .api-endpoint {
  background:
    radial-gradient(circle at 14% 0%, rgba(34, 211, 238, 0.16), transparent 32%),
    linear-gradient(135deg, #050a14, #0b1730 50%, #111827);
  border: 1px solid rgba(56, 213, 255, 0.32);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.34), 0 0 30px rgba(34, 211, 238, 0.12);
}

html[data-theme="dark"] .param-name,
html[data-theme="dark"] .auth-tag {
  color: #f6c33b;
}

html[data-theme="dark"] .theme-toggle {
  color: #7dd3fc;
  background: rgba(56, 213, 255, 0.08);
  border-color: rgba(56, 213, 255, 0.28);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.10);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(56, 213, 255, 0.14);
  border-color: rgba(125, 211, 252, 0.56);
}

html[data-theme="dark"] .header-register,
html[data-theme="dark"] .api-debug-btn,
html[data-theme="dark"] .code-tab.active,
html[data-theme="dark"] .copy-btn.copied {
  color: #101827;
  background: linear-gradient(180deg, #ffd766 0%, #f6c33b 100%);
  border-color: rgba(255, 220, 112, 0.72);
  box-shadow: 0 12px 28px rgba(246, 195, 59, 0.24), 0 0 22px rgba(246, 195, 59, 0.14);
}

/* 邀请返现按钮 — 复刻主页金色胶囊样式 */
.header-nav a.nav-invite,
html[data-theme="dark"] .header-nav a.nav-invite,
html[data-theme="light"] .header-nav a.nav-invite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 9999px;
  border: 1px solid rgba(245, 194, 66, 0.6);
  background: transparent;
  color: #f5c242;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.header-nav a.nav-invite svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  animation: nav-invite-shake 1.6s ease-in-out infinite;
}

.header-nav a.nav-workbench,
html[data-theme="dark"] .header-nav a.nav-workbench,
html[data-theme="light"] .header-nav a.nav-workbench {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: #f5c242;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 14px rgba(245, 194, 66, 0.16);
}

.header-nav a.nav-workbench svg {
  color: #f5c242;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-nav a.nav-workbench em {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(245, 194, 66, 0.16);
  border: 1px solid rgba(245, 194, 66, 0.28);
  color: #ffd76a;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
}

.header-nav a.nav-workbench:hover,
html[data-theme="dark"] .header-nav a.nav-workbench:hover,
html[data-theme="light"] .header-nav a.nav-workbench:hover {
  color: #ffd76a;
  background: rgba(245, 194, 66, 0.08);
  filter: none;
  transform: translateY(-1px);
}

@keyframes nav-invite-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}

.header-nav a.nav-invite:hover,
html[data-theme="dark"] .header-nav a.nav-invite:hover,
html[data-theme="light"] .header-nav a.nav-invite:hover {
  color: #ffd76a;
  border-color: #f5c242;
  background: rgba(245, 194, 66, 0.1);
}

/* 浅色主题下保持金色可见度 */
html[data-theme="light"] .header-nav a.nav-invite {
  color: #9a6a00;
  border-color: rgba(245, 194, 66, 0.7);
}

/* =========================================================================
   REFINED MULTI-LEVEL SIDEBAR MENU
   - stronger group separation (top-level sections read as chapters)
   - clean dot tree nodes replace the heavy L-shaped stubs
   - SVG chevron, child-count badge, contains-active parent chain
   - tighter indent so deep Chinese labels breathe in 280px
   ========================================================================= */

/* --- Chevron (replaces ▼ glyph) --- */
.nav-section-title .nav-chevron {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  opacity: 0.55;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.nav-section:not(.collapsed) .nav-section-title .nav-chevron {
  transform: rotate(0deg);
  opacity: 0.75;
}
.nav-section.collapsed .nav-section-title .nav-chevron {
  transform: rotate(-90deg);
  opacity: 0.5;
}
/* hide the old glyph arrow if any */
.nav-section-title .arrow { display: none; }

/* --- Child-count badge on group titles --- */
.nav-count {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  min-width: 20px;
  text-align: center;
  border-radius: 999px;
  letter-spacing: 0.3px;
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  border: 1px solid var(--color-border-light);
  margin-left: auto;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
  transition: all 0.2s ease;
}

/* --- Top-level section titles: the "chapters" --- */
.sidebar-nav > .nav-section { margin-bottom: 2px; }

.sidebar-nav > .nav-section > .nav-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 13px 12px 9px;
  margin: 4px 6px 2px;
  color: var(--color-text-secondary);
  border-radius: 0;
  border-top: none;
  position: relative;
}
/* a soft rule above each chapter except the first, to separate the 20 sections */
.sidebar-nav > .nav-section + .nav-section > .nav-section-title {
  margin-top: 16px;
  padding-top: 17px;
}
.sidebar-nav > .nav-section + .nav-section > .nav-section-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border) 18%, var(--color-border) 82%, transparent);
  opacity: 0.7;
}

/* title row becomes a proper flex container: label | count | chevron */
.nav-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-section-label {
  flex: 1;
  min-width: 0;
  /* allow wrap up to 2 lines — never truncate Chinese/English mixed labels */
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* expand hit target to full width, keep text padded */
.nav-section-title { cursor: pointer; }

/* --- Nested group titles (sub-chapters) --- */
.nav-subsection > .nav-section-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 10px;
  color: var(--color-text);
  border-radius: 8px;
  margin: 2px 6px;
}
.nav-subsection .nav-count {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}

/* =========================================================================
   TREE GUIDE LINES — clean, continuous trunks + elbow connectors
   No per-item dots. Active item shows NO left bar (removed on request);
   active state is background fill + bold accent text only.
   ========================================================================= */
/* reset old stubs entirely (keep ::after for the active accent bar) */
.nav-item::before { content: none !important; }
.nav-item:not(.active)::after { content: none !important; }

/* Trunk line color: brighter, clearly visible per theme */
:root { --nav-trunk: #4a5b7d; }
html[data-theme="light"] { --nav-trunk: #b4c0d4; }
html[data-theme="dark"]  { --nav-trunk: #5b7194; }

/* Continuous vertical trunk on each children column (no fade) */
.nav-children::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--nav-trunk);
  pointer-events: none;
}
.nav-subsection > .nav-children::before { left: 22px; }
.nav-subsection .nav-subsection > .nav-children::before { left: 30px; }
/* branch containing the active page lights up toward the accent */
.nav-section.contains-active > .nav-children::before,
.nav-subsection.contains-active > .nav-children::before {
  background: color-mix(in srgb, var(--color-primary) 65%, var(--nav-trunk));
}

/* --- Leaf item: clean, dot-free. Indent alone expresses depth. --- */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 22px !important;
  margin: 1px 4px !important;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 8px !important;
  border-left: 0 !important;
}
.nav-item-label {
  flex: 1;
  min-width: 0;
  /* allow up to 2 lines; long mixed CJK/EN labels must stay readable */
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* keep the method badge pinned to the top-right of the row when labels wrap */
.nav-method { align-self: flex-start; margin-top: 1px; }

/* depth via indent only — slightly tighter now that dots/lines are gone */
.nav-subsection .nav-item { padding-left: 30px !important; }
.nav-subsection .nav-subsection .nav-item { padding-left: 38px !important; }

.nav-item:hover {
  transform: none;
}

/* active leaf: bright accent bar on the trunk + strong fill + bold accent text */
.nav-item.active {
  position: relative;
  border-left: 0 !important;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-primary) 50%, transparent);
}
.nav-subsection .nav-item.active::after { left: 21px; }
.nav-subsection .nav-subsection .nav-item.active::after { left: 29px; }

/* --- Parent chain highlight (contains-active) --- */
.nav-section.contains-active > .nav-section-title .nav-chevron {
  color: var(--color-primary);
  opacity: 0.9;
}
.nav-section.contains-active > .nav-section-title .nav-count {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
}
.nav-subsection.contains-active > .nav-section-title {
  color: var(--color-primary);
}

/* --- Method badges: calmer, monospace pill that doesn't fight the label --- */
.nav-method {
  font-size: 9px !important;
  font-weight: 700;
  padding: 1px 5px !important;
  border-radius: 5px !important;
  letter-spacing: 0.4px;
  line-height: 1.4;
  flex-shrink: 0;
}
.nav-method.post   { background: rgba(249, 115, 22, 0.13); color: #fb923c; border: 1px solid rgba(249,115,22,0.22); }
.nav-method.get    { background: rgba(59, 130, 246, 0.13); color: #60a5fa; border: 1px solid rgba(59,130,246,0.22); }
.nav-method.put    { background: rgba(245, 158, 11, 0.13); color: #fbbf24; border: 1px solid rgba(245,158,11,0.22); }
.nav-method.delete { background: rgba(239, 68, 68, 0.13);  color: #f87171; border: 1px solid rgba(239,68,68,0.22); }
.nav-item.active .nav-method.post   { background:#fb923c; color:#1a0f00; border-color:#fb923c; }
.nav-item.active .nav-method.get    { background:#60a5fa; color:#06121f; border-color:#60a5fa; }
.nav-item.active .nav-method.put    { background:#fbbf24; color:#1a1200; border-color:#fbbf24; }
.nav-item.active .nav-method.delete { background:#f87171; color:#1a0606; border-color:#f87171; }

/* --- Hover state for group titles --- */
.sidebar-nav > .nav-section > .nav-section-title:hover {
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  color: var(--color-text);
}
.nav-subsection > .nav-section-title:hover {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  color: var(--color-text);
}

/* --- Theme-specific accents for the refined menu --- */

/* DARK (blue-tech default) */
html[data-theme="dark"] .sidebar-nav > .nav-section > .nav-section-title {
  color: #8aa0bd;
}
html[data-theme="dark"] .sidebar-nav > .nav-section > .nav-section-title:hover {
  color: #cfe3ff;
}
html[data-theme="dark"] .nav-section.contains-active > .nav-section-title {
  color: #7dd3fc;
}
html[data-theme="dark"] .nav-count {
  color: #6b8095;
  background: rgba(125, 211, 252, 0.06);
  border-color: rgba(125, 211, 252, 0.14);
}
html[data-theme="dark"] .nav-item {
  color: #aec1d6;
}
html[data-theme="dark"] .nav-item:hover {
  color: #eaf4ff;
  background: linear-gradient(90deg, rgba(56, 213, 255, 0.10), rgba(96, 165, 250, 0.05) 60%, transparent);
}
html[data-theme="dark"] .nav-item.active {
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.28), rgba(96, 165, 250, 0.12) 65%, transparent);
}
html[data-theme="dark"] .nav-item.active::after {
  background: #22d3ee;
}
html[data-theme="dark"] .nav-subsection > .nav-section-title {
  color: #c4d4ea;
}
html[data-theme="dark"] .nav-subsection.contains-active > .nav-section-title {
  color: #7dd3fc;
}

/* LIGHT */
html[data-theme="light"] .sidebar-nav > .nav-section > .nav-section-title {
  color: #6b7686;
}
html[data-theme="light"] .sidebar-nav > .nav-section > .nav-section-title:hover {
  color: #1e293b;
}
html[data-theme="light"] .nav-section.contains-active > .nav-section-title {
  color: #0369a1;
}
html[data-theme="light"] .nav-count {
  color: #64748b;
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .nav-section.contains-active > .nav-section-title .nav-count {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.22);
}
html[data-theme="light"] .nav-item {
  color: #475569;
}
html[data-theme="light"] .nav-item:hover {
  color: #0f172a;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.10), rgba(59, 130, 246, 0.05) 60%, transparent);
}
html[data-theme="light"] .nav-item.active {
  color: #082f49;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.22), rgba(59, 130, 246, 0.09) 65%, transparent);
}
html[data-theme="light"] .nav-item.active::after {
  background: #0891b2;
}
html[data-theme="light"] .nav-subsection > .nav-section-title {
  color: #334155;
}
html[data-theme="light"] .nav-subsection.contains-active > .nav-section-title {
  color: #0369a1;
}
html[data-theme="light"] .nav-method.post   { color: #c2410c; }
html[data-theme="light"] .nav-method.get    { color: #1d4ed8; }
html[data-theme="light"] .nav-method.put    { color: #b45309; }
html[data-theme="light"] .nav-method.delete { color: #b91c1c; }

/* --- Collapse handled via .collapsed > display:none (defined earlier, reliable) --- */
/* The chevron rotation (above) carries the motion for collapse/expand. */

/* --- Mobile: keep the refined look, slightly larger touch targets --- */
@media (max-width: 768px) {
  .nav-item { padding: 9px 12px 9px 24px !important; font-size: 14px; }
  .nav-subsection .nav-item { padding-left: 32px !important; }
  .nav-subsection .nav-subsection .nav-item { padding-left: 40px !important; }
  /* trunk lines nudge to match the larger indent */
  .nav-children::before { left: 16px; }
  .nav-subsection > .nav-children::before { left: 24px; }
  .nav-subsection .nav-subsection > .nav-children::before { left: 32px; }
  .sidebar-nav > .nav-section + .nav-section > .nav-section-title { margin-top: 12px; padding-top: 14px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-section-title .nav-chevron,
  .nav-children,
  .nav-item::after { transition: none !important; }
}

/* =========================================================================
   CONTENT PAGE REFINEMENT + VS CODE-STYLE SYNTAX HIGHLIGHTING
   - custom highlight.js token colors (dark default + light variant)
   - language chip, refined code block + tabs chrome
   - content typography polish, callouts, tables
   ========================================================================= */

/* --- Code block base (more VS Code-like) --- */
.doc-content pre {
  padding: 18px 20px 18px 20px !important;
  padding-top: 30px !important;            /* room for the lang chip + copy btn */
  font-size: 13px;
  line-height: 1.7;
  border-radius: 12px !important;
  tab-size: 2;
}
.doc-content pre code,
.doc-content pre code.hljs {
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* Language chip (top-left) + copy button sits top-right (existing) */
.code-lang-chip {
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
  border: 1px solid var(--color-border-light);
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
/* when a copy button is also present, nudge chip so they never overlap */
.doc-content pre .copy-btn { z-index: 2; }

/* --- Refined code-tabs chrome --- */
.code-tabs { border-radius: 12px !important; overflow: hidden; }
.code-tabs-header {
  padding: 0 6px;
  gap: 2px;
}
.code-tab {
  padding: 9px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  position: relative;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.code-tab:hover { border-bottom-color: color-mix(in srgb, var(--color-primary) 40%, transparent); }
.code-tab.active {
  border-bottom-width: 3px;
  border-bottom-style: solid;
  font-weight: 700;
}
.code-tab-panel > pre { margin: 0 !important; border-radius: 0 !important; border: none !important; }

/* --- Content typography polish --- */
.doc-content h1 { text-wrap: balance; }
.doc-content h2 { text-wrap: balance; scroll-margin-top: calc(var(--header-height) + 16px); }
.doc-content h3, .doc-content h4 { scroll-margin-top: calc(var(--header-height) + 16px); }
.doc-content p { text-wrap: pretty; }
.doc-content ul, .doc-content ol { text-wrap: pretty; }
.doc-content li { margin-bottom: 6px; }
.doc-content a code { color: inherit; }

/* inline code — a touch more refined */
.doc-content :not(pre) > code {
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
}

/* callouts: calmer, consistent */
.doc-content .tip,
.doc-content .warning,
.doc-content .info {
  border-radius: 10px !important;
  border-left-width: 4px !important;
  border-left-style: solid;
}

/* tables: comfortable padding + header already styled */
.doc-content th { letter-spacing: 0.2px; }

/* =========================================================================
   highlight.js TOKEN COLORS
   DARK = VS Code Dark+ inspired, harmonized with the gold/cyan brand
   ========================================================================= */
html[data-theme="dark"] .hljs {
  color: #d4d4d4;
  background: transparent;
}
html[data-theme="dark"] .hljs-comment,
html[data-theme="dark"] .hljs-quote        { color: #6a7a92; font-style: italic; }
html[data-theme="dark"] .hljs-keyword,
html[data-theme="dark"] .hljs-selector-tag,
html[data-theme="dark"] .hljs-built_in,
html[data-theme="dark"] .hljs-name,
html[data-theme="dark"] .hljs-literal      { color: #4fc3f7; }   /* cyan keywords */
html[data-theme="dark"] .hljs-string,
html[data-theme="dark"] .hljs-regexp,
html[data-theme="dark"] .hljs-addition     { color: #ce9178; }   /* warm strings */
html[data-theme="dark"] .hljs-number,
html[data-theme="dark"] .hljs-symbol,
html[data-theme="dark"] .hljs-bullet,
html[data-theme="dark"] .hljs-link         { color: #f6c33b; }   /* gold numbers */
html[data-theme="dark"] .hljs-title,
html[data-theme="dark"] .hljs-title.function_,
html[data-theme="dark"] .hljs-section,
html[data-theme="dark"] .hljs-selector-id  { color: #f5c242; }   /* gold fn names */
html[data-theme="dark"] .hljs-title.class_,
html[data-theme="dark"] .hljs-type,
html[data-theme="dark"] .hljs-class .hljs-title,
html[data-theme="dark"] .hljs-params       { color: #4ec9b0; }   /* teal types */
html[data-theme="dark"] .hljs-attr,
html[data-theme="dark"] .hljs-attribute,
html[data-theme="dark"] .hljs-variable,
html[data-theme="dark"] .hljs-property     { color: #9cdcfe; }   /* light-blue props */
html[data-theme="dark"] .hljs-meta,
html[data-theme="dark"] .hljs-meta .hljs-keyword { color: #c586c0; } /* purple meta/control */
html[data-theme="dark"] .hljs-tag          { color: #569cd6; }
html[data-theme="dark"] .hljs-tag .hljs-name { color: #569cd6; }
html[data-theme="dark"] .hljs-tag .hljs-attr { color: #9cdcfe; }
html[data-theme="dark"] .hljs-deletion     { color: #f87171; background: rgba(248,113,113,0.10); }
html[data-theme="dark"] .hljs-addition     { background: rgba(78,201,176,0.10); }
html[data-theme="dark"] .hljs-emphasis     { font-style: italic; }
html[data-theme="dark"] .hljs-strong       { font-weight: 700; }

/* JSON-specific: keys pop in cyan, strings warm — very VS Code */
html[data-theme="dark"] .language-json .hljs-attr,
html[data-theme="dark"] .language-json .hljs-property { color: #4fc3f7; }
html[data-theme="dark"] .language-json .hljs-string   { color: #ce9178; }

/* =========================================================================
   highlight.js TOKEN COLORS — LIGHT (GitHub Light inspired, brand-harmonized)
   ========================================================================= */
html[data-theme="light"] .hljs {
  color: #24292e;
  background: transparent;
}
html[data-theme="light"] .hljs-comment,
html[data-theme="light"] .hljs-quote       { color: #8c93a0; font-style: italic; }
html[data-theme="light"] .hljs-keyword,
html[data-theme="light"] .hljs-selector-tag,
html[data-theme="light"] .hljs-built_in,
html[data-theme="light"] .hljs-name,
html[data-theme="light"] .hljs-literal     { color: #0550ae; }   /* blue keywords */
html[data-theme="light"] .hljs-string,
html[data-theme="light"] .hljs-regexp,
html[data-theme="light"] .hljs-addition    { color: #0a7d4d; }   /* green strings */
html[data-theme="light"] .hljs-number,
html[data-theme="light"] .hljs-symbol,
html[data-theme="light"] .hljs-bullet,
html[data-theme="light"] .hljs-link        { color: #9a6a00; }   /* gold numbers */
html[data-theme="light"] .hljs-title,
html[data-theme="light"] .hljs-title.function_,
html[data-theme="light"] .hljs-section,
html[data-theme="light"] .hljs-selector-id { color: #8250df; }   /* purple fn */
html[data-theme="light"] .hljs-title.class_,
html[data-theme="light"] .hljs-type,
html[data-theme="light"] .hljs-class .hljs-title,
html[data-theme="light"] .hljs-params      { color: #957300; }   /* gold types */
html[data-theme="light"] .hljs-attr,
html[data-theme="light"] .hljs-attribute,
html[data-theme="light"] .hljs-variable,
html[data-theme="light"] .hljs-property    { color: #0550ae; }
html[data-theme="light"] .hljs-meta,
html[data-theme="light"] .hljs-meta .hljs-keyword { color: #b27701; }
html[data-theme="light"] .hljs-tag         { color: #116329; }
html[data-theme="light"] .hljs-tag .hljs-name { color: #116329; }
html[data-theme="light"] .hljs-tag .hljs-attr { color: #0550ae; }
html[data-theme="light"] .hljs-deletion    { color: #cf222e; background: rgba(207,34,46,0.08); }
html[data-theme="light"] .hljs-addition    { background: rgba(10,125,77,0.08); }
html[data-theme="light"] .hljs-emphasis    { font-style: italic; }
html[data-theme="light"] .hljs-strong      { font-weight: 700; }
html[data-theme="light"] .language-json .hljs-attr,
html[data-theme="light"] .language-json .hljs-property { color: #0550ae; }
html[data-theme="light"] .language-json .hljs-string   { color: #0a7d4d; }

/* --- Code chip color per theme --- */
html[data-theme="light"] .code-lang-chip {
  color: #6b7686;
  background: rgba(15,23,42,0.05);
  border-color: rgba(15,23,42,0.10);
}

/* --- Mobile: code stays readable --- */
@media (max-width: 768px) {
  .doc-content pre { font-size: 12px; padding: 16px 14px !important; padding-top: 30px !important; }
  .code-tab { padding: 8px 11px !important; font-size: 12px !important; }
}

/* =========================================================================
   OVERALL UI POLISH — header, content/API, cards, footer/page-nav
   Refines existing surfaces without removing prior structure.
   ========================================================================= */

/* ---------- 1. TOP NAVIGATION ---------- */
.header-inner { gap: 18px; }
.header-nav { gap: 20px; }
.header-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 9px;
  transition: color .2s ease, background .2s ease;
}
.header-nav a:hover { text-decoration: none; }
.header-login {
  position: relative;
  padding: 8px 14px;
  border-radius: 9px;
  transition: color .2s ease, background .2s ease;
}
.header-login:hover { text-decoration: none; }
/* register / theme buttons: consistent tactile feel */
.header-register {
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.header-register:hover { transform: translateY(-1px); }
.header-register:active { transform: translateY(0); }
.theme-toggle { transition: background .2s ease, border-color .2s ease, transform .18s ease; }
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }


/* ---------- 2. CONTENT & API AREA ---------- */
/* breadcrumb: tidier chip-like separators */
.breadcrumb { font-weight: 500; letter-spacing: 0.1px; }
.breadcrumb a {
  padding: 3px 8px;
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.breadcrumb a:hover { text-decoration: none; }
.breadcrumb-sep { opacity: 0.5; }

/* H1: more breathing room + refined underline */
.doc-content h1 { margin-bottom: 22px !important; }

/* API endpoint bar: clearer separation between method / url / debug */
.api-endpoint { gap: 16px !important; padding: 18px 22px !important; }
.api-method {
  border-radius: 8px !important;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.api-url { font-weight: 500; }
.api-debug-btn {
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.api-debug-btn:hover { transform: translateY(-1px); text-decoration: none; }
.api-debug-btn:active { transform: translateY(0); }

/* paragraphs & lists: more generous, readable rhythm */
.doc-content p { line-height: 1.75; }
.doc-content ul, .doc-content ol { line-height: 1.75; }
.doc-content li { margin-bottom: 7px; }

/* ---------- 3. CARDS (param / auth / code-tabs) ---------- */
/* unified premium surface */
.param-card,
.auth-section,
.code-tabs {
  transition: border-color .25s ease, box-shadow .25s ease;
}
/* card headers: subtle gradient + better divider */
.param-card-header,
.code-tabs-header,
.auth-header {
  padding: 13px 18px !important;
  letter-spacing: 0.1px;
}
.param-card-title { letter-spacing: 0.1px; }

/* param rows: comfortable spacing, clean hover */
.param-row { padding: 12px 18px !important; transition: background .15s ease; }
.param-name { letter-spacing: 0.2px; }
.param-type-label { letter-spacing: 0.1px; }
.param-desc { line-height: 1.7 !important; }

/* code tabs: bolder active state */
.code-tab { transition: color .18s ease, background .18s ease, border-color .18s ease; }
.code-tab.active { letter-spacing: 0.2px; }

/* auth section arrow / title polish */
.auth-title { letter-spacing: 0.1px; }

/* ---------- 4. FOOTER & PAGE NAV ---------- */
/* page-nav buttons: clearer hover + consistent cards */
.page-nav { gap: 14px !important; }
.page-nav a {
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.page-nav a:hover { transform: translateY(-2px); text-decoration: none; }
.page-nav a:active { transform: translateY(0); }

/* footer: structured, readable, branded separator */
.doc-footer {
  padding-top: 26px !important;
  margin-top: 52px !important;
  position: relative;
}
.doc-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border) 15%, var(--color-border) 85%, transparent);
  opacity: 0.7;
}
.doc-footer p { line-height: 1.8; }
.doc-footer a {
  padding: 2px 6px;
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.doc-footer a:hover { text-decoration: none; }
.footer-disclaimer {
  margin-top: 14px !important;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border-light);
  line-height: 1.7;
  opacity: 0.85;
}

/* ---------- Theme-aware polish colors ---------- */
/* DARK */
html[data-theme="dark"] .header-nav a:hover,
html[data-theme="dark"] .header-login:hover {
  background: rgba(125, 211, 252, 0.10);
}
html[data-theme="dark"] .breadcrumb a:hover { background: rgba(125,211,252,0.08); }
html[data-theme="dark"] .breadcrumb-sep { color: #5b7194; }
html[data-theme="dark"] .doc-footer a:hover { background: rgba(125,211,252,0.08); }

/* LIGHT */
html[data-theme="light"] .header-nav a:hover,
html[data-theme="light"] .header-login:hover {
  background: rgba(14, 165, 233, 0.10);
}
html[data-theme="light"] .breadcrumb a:hover { background: rgba(14,165,233,0.08); }
html[data-theme="light"] .breadcrumb-sep { color: #94a3b8; }
html[data-theme="light"] .doc-footer a:hover { background: rgba(14,165,233,0.08); }

/* ---------- Mobile polish ---------- */
@media (max-width: 768px) {
  .api-endpoint { gap: 10px !important; padding: 14px !important; }
  .param-card-header, .code-tabs-header, .auth-header { padding: 11px 14px !important; }
  .param-row { padding: 10px 14px !important; }
  .doc-footer { padding-top: 20px !important; margin-top: 40px !important; }
}

/* ============================================================
   Scheme B: TOC sidebar + docs search + nav de-noising
   ============================================================ */

/* ---------- Right-side TOC ---------- */
.toc-sidebar {
  width: 224px;
  flex-shrink: 0;
  display: none;
}
@media (min-width: 1200px) {
  .toc-sidebar { display: block; }
}
.toc-inner {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  padding: 8px 20px 24px 0;
  scrollbar-width: thin;
}
.toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  padding-left: 12px;
}
.toc-nav {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border-light);
}
.toc-link {
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-link.toc-level-3 {
  padding-left: 26px;
  font-size: 12.5px;
}
.toc-link:hover {
  color: var(--color-text);
  text-decoration: none;
}
.toc-link.active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}
[data-theme="light"] .toc-link.active { color: #1d4ed8; }

/* ---------- Sidebar search ---------- */
.sidebar-search {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 4px;
  padding: 8px 10px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-search:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
.sidebar-search .search-icon {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.sidebar-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 13.5px;
}
.sidebar-search input::placeholder { color: var(--color-text-secondary); }
.search-kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--color-bg);
  flex-shrink: 0;
}

.search-results {
  position: fixed;
  top: calc(var(--header-height) + 58px);
  left: 12px;
  width: calc(var(--sidebar-width) - 24px);
  z-index: 60;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 6px;
}
@media (max-width: 768px) {
  .search-results {
    top: 62px;
    left: 12px;
    width: min(calc(85vw - 24px), 296px);
  }
}
[data-theme="light"] .search-results {
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 7px;
  text-decoration: none;
}
.search-result-item:hover { text-decoration: none; background: var(--color-hover); }
.search-result-item.active { background: var(--color-active); }
.search-result-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}
.search-result-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-item mark {
  background: rgba(246, 195, 67, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.search-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---------- Header: hide optional links on narrower screens ---------- */
@media (max-width: 1160px) {
  .header-nav a.nav-optional,
  .header-nav a.nav-workbench { display: none; }
}

/* ---------- Header: globally hide a specific nav item ---------- */
.header-nav a.nav-hide { display: none; }

/* ---------- Sidebar de-noising ---------- */
/* count badges stay visible at all times (no hover/expand gating) */
.nav-section-title .nav-count {
  opacity: 1;
}
.nav-method {
  opacity: 0.75;
}
.nav-item:hover .nav-method,
.nav-item.active .nav-method {
  opacity: 1;
}

/* ---------- Content width rebalance when TOC is visible ---------- */
@media (min-width: 1200px) {
  .content {
    padding-right: 32px;
  }
}

/* =========================================================================
   SIDEBAR NAV — CLEAN PASS (v3)
   - remove tree trunk lines: indent alone expresses depth
   - chevron moves to the left of group titles (flex order, no HTML change)
   - count badges become quiet plain text, hidden on subsections
   - unified row rhythm; active accent bar hugs the row edge
   ========================================================================= */

/* kill trunk guide lines everywhere */
.nav-children::before { display: none !important; }

/* group title row: chevron first, then label, then count */
.nav-section-title { gap: 4px; }
.nav-section-title .nav-chevron { order: -1; margin-right: 2px; }

/* top-level chapter: chevron sits near the leaf text edge */
.sidebar-nav > .nav-section > .nav-section-title {
  padding: 12px 10px 8px 4px;
  letter-spacing: 1px;
}
/* subsection titles: label aligns with its leaf items */
.nav-subsection > .nav-section-title {
  padding: 7px 10px 7px 11px;
}

/* counts: quiet plain text instead of pills; only kept on chapters */
.nav-count,
html[data-theme="dark"] .nav-count,
html[data-theme="light"] .nav-count,
.nav-section.contains-active > .nav-section-title .nav-count,
html[data-theme="light"] .nav-section.contains-active > .nav-section-title .nav-count {
  background: none !important;
  border: none !important;
  padding: 0;
  min-width: 0;
  margin-right: 4px;
  font-weight: 600;
}
.nav-subsection .nav-count { display: none; }

/* leaf rows: consistent rhythm */
.nav-item { min-height: 30px; }

/* active accent bar hugs the row edge now that no trunk exists */
.nav-item.active::after,
.nav-subsection .nav-item.active::after,
.nav-subsection .nav-subsection .nav-item.active::after {
  left: 4px;
  top: 6px;
  bottom: 6px;
}

/* =========================================================================
   SIDEBAR NAV — STRUCTURED TREE (v4)
   - restore count pills on ALL group titles (chapters + subsections)
   - restore tree guides: trunk aligned under each parent's chevron center,
     with a short horizontal tick connecting the trunk to every leaf item
   - active branch: trunk + its leaf tick light up in accent color
   ========================================================================= */

/* --- counts: visible quiet pill on every group title --- */
.nav-count,
html[data-theme="dark"] .nav-count,
html[data-theme="light"] .nav-count,
.nav-section.contains-active > .nav-section-title .nav-count,
html[data-theme="light"] .nav-section.contains-active > .nav-section-title .nav-count {
  background: color-mix(in srgb, var(--color-text) 8%, transparent) !important;
  border: 1px solid var(--color-border-light) !important;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}
.nav-subsection .nav-count { display: inline-block; }
.nav-section.contains-active > .nav-section-title .nav-count,
html[data-theme="light"] .nav-section.contains-active > .nav-section-title .nav-count {
  background: color-mix(in srgb, var(--color-primary) 14%, transparent) !important;
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent) !important;
  color: var(--color-primary);
}

/* --- trunk lines: aligned under each parent's chevron center --- */
.nav-children::before {
  display: block !important;
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 6px;
  width: 1px;
  background: var(--nav-trunk);
  pointer-events: none;
}
.nav-subsection > .nav-children::before { left: 24px; }
.nav-subsection .nav-subsection > .nav-children::before { left: 32px; }

/* --- tick from trunk to each leaf item --- */
.nav-item::before {
  content: "" !important;
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--nav-trunk);
  pointer-events: none;
}
.nav-subsection .nav-item::before { left: 24px; }
.nav-subsection .nav-subsection .nav-item::before { left: 32px; }

/* --- indents matching the trunk positions --- */
.nav-item { padding-left: 30px !important; }
.nav-subsection .nav-item { padding-left: 38px !important; }
.nav-subsection .nav-subsection .nav-item { padding-left: 46px !important; }
/* depth-2 group titles: chevron center aligns with their children's trunk */
.nav-subsection .nav-subsection > .nav-section-title { padding-left: 19px; }

/* --- active branch: trunk + leaf tick light up --- */
.nav-section.contains-active > .nav-children::before,
.nav-subsection.contains-active > .nav-children::before {
  background: color-mix(in srgb, var(--color-primary) 55%, var(--nav-trunk));
}
.nav-item.active::before { background: var(--color-primary); }
.nav-item:hover::before {
  background: color-mix(in srgb, var(--color-primary) 60%, var(--nav-trunk));
}

/* --- mobile: shallower indents, shorter ticks --- */
@media (max-width: 768px) {
  .nav-item { padding-left: 24px !important; }
  .nav-subsection .nav-item { padding-left: 32px !important; }
  .nav-subsection .nav-subsection .nav-item { padding-left: 40px !important; }
  .nav-item::before { width: 5px; }
}

/* =========================================================================
   TUTORIAL READING SYSTEM
   Scoped to the plugin/software tutorial section.
   ========================================================================= */

html[data-theme="dark"] body.tutorial-page {
  background: #081321;
}

html[data-theme="light"] body.tutorial-page {
  background: #f3f6fa;
}

body.tutorial-page::before,
body.tutorial-page::after {
  display: none;
  animation: none;
}

html[data-theme="dark"] .tutorial-content,
html[data-theme="light"] .tutorial-content {
  max-width: 980px;
  padding: 38px 42px 48px;
  overflow: visible;
  border-radius: 8px;
  box-shadow: none;
}

html[data-theme="dark"] .tutorial-content {
  background: #0d1728;
  border: 1px solid #26364e;
}

html[data-theme="light"] .tutorial-content {
  background: #ffffff;
  border: 1px solid #dce5ef;
}

html[data-theme] .tutorial-content::before {
  display: none;
}

html[data-theme="dark"] .tutorial-content > h1,
html[data-theme="light"] .tutorial-content > h1 {
  margin: 0 0 22px;
  padding: 2px 0 16px 16px;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: 0;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  border: 0;
  border-left: 5px solid #22b8e6;
  color: inherit;
}

html[data-theme="dark"] .tutorial-content > h1 {
  color: #f4f8fc;
}

html[data-theme="light"] .tutorial-content > h1 {
  color: #12233b;
}

html[data-theme] .tutorial-content > h2 {
  margin: 42px 0 18px;
  padding: 12px 15px;
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: 0;
  border-radius: 6px;
  border: 1px solid;
}

html[data-theme] .tutorial-content > h2::after {
  display: none;
}

html[data-theme="dark"] .tutorial-content > h2 {
  color: #bfeaff;
  background: #12263b;
  border-color: #285271;
}

html[data-theme="light"] .tutorial-content > h2 {
  color: #164e73;
  background: #eff8fc;
  border-color: #c8e5f1;
}

html[data-theme] .tutorial-content h3 {
  margin: 30px 0 12px;
  padding-left: 12px;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0;
  border-left: 3px solid #38bdf8;
}

html[data-theme="dark"] .tutorial-content h3 {
  color: #e6eef8;
}

html[data-theme="light"] .tutorial-content h3 {
  color: #203a59;
}

html[data-theme] .tutorial-content h4 {
  margin: 24px 0 10px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

html[data-theme="dark"] .tutorial-content h4 {
  color: #d7e4f2;
}

html[data-theme="light"] .tutorial-content h4 {
  color: #29435f;
}

html[data-theme] .tutorial-content p,
html[data-theme] .tutorial-content li {
  font-size: 15px;
  line-height: 1.85;
}

html[data-theme="dark"] .tutorial-content p,
html[data-theme="dark"] .tutorial-content li {
  color: #b7c6d8;
}

html[data-theme="light"] .tutorial-content p,
html[data-theme="light"] .tutorial-content li {
  color: #40536a;
}

.tutorial-content p {
  margin-bottom: 14px;
}

.tutorial-content ul,
.tutorial-content ol {
  margin: 10px 0 18px;
  padding-left: 24px;
}

.tutorial-content li {
  margin-bottom: 7px;
}

.tutorial-content li::marker {
  color: #38bdf8;
  font-weight: 700;
}

html[data-theme] .tutorial-content strong {
  color: inherit;
  font-weight: 700;
}

.tutorial-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
}

html[data-theme="dark"] .tutorial-content a {
  color: #7dd3fc;
}

html[data-theme="light"] .tutorial-content a {
  color: #0369a1;
}

html[data-theme] .tutorial-content table {
  width: 100%;
  margin: 16px 0 24px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 6px;
  box-shadow: none;
}

html[data-theme="dark"] .tutorial-content table {
  background: #101c2d;
  border-color: #2b3d55;
}

html[data-theme="light"] .tutorial-content table {
  background: #ffffff;
  border-color: #d8e2ec;
}

html[data-theme] .tutorial-content th,
html[data-theme] .tutorial-content td {
  padding: 11px 13px;
  line-height: 1.65;
  vertical-align: top;
}

html[data-theme="dark"] .tutorial-content th {
  color: #dcecff;
  background: #17273c;
  border-color: #30445e;
}

html[data-theme="dark"] .tutorial-content td {
  color: #b9c8d9;
  background: #101c2d;
  border-color: #263950;
}

html[data-theme="dark"] .tutorial-content tbody tr:nth-child(even) td {
  background: #132033;
}

html[data-theme="light"] .tutorial-content th {
  color: #243b55;
  background: #edf4f8;
  border-color: #d3e0ea;
}

html[data-theme="light"] .tutorial-content td {
  color: #43566c;
  background: #ffffff;
  border-color: #e0e8ef;
}

html[data-theme="light"] .tutorial-content tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

html[data-theme] .tutorial-content pre,
html[data-theme] .tutorial-content .terminal-block {
  margin: 16px 0 24px;
  border-radius: 6px;
  box-shadow: none;
}

html[data-theme="dark"] .tutorial-content pre,
html[data-theme="dark"] .tutorial-content .terminal-block {
  background: #08111f;
  border-color: #2a3c54;
}

html[data-theme="light"] .tutorial-content pre,
html[data-theme="light"] .tutorial-content .terminal-block {
  background: #172033;
  border-color: #24334a;
}

.tutorial-content pre {
  padding: 17px 18px;
  overflow-x: auto;
}

html[data-theme] .tutorial-content code {
  border-radius: 4px;
}

html[data-theme="dark"] .tutorial-content :not(pre) > code {
  color: #bae6fd;
  background: #17273c;
  border-color: #2b465f;
}

html[data-theme="light"] .tutorial-content :not(pre) > code {
  color: #075985;
  background: #edf5f9;
  border-color: #d2e3ec;
}

html[data-theme] .tutorial-content img {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  height: auto;
  margin: 18px auto 26px;
  border-radius: 6px !important;
  background: #ffffff;
  border: 1px solid;
}

html[data-theme="dark"] .tutorial-content img {
  border-color: #30435c !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .tutorial-content img {
  border-color: #d4dee8 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme] .tutorial-content .tutorial-intro {
  margin: 0 0 26px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.8;
  border-left: 4px solid #38bdf8;
  border-radius: 0 6px 6px 0;
}

html[data-theme="dark"] .tutorial-content .tutorial-intro {
  color: #c6d6e8;
  background: #12243a;
}

html[data-theme="light"] .tutorial-content .tutorial-intro {
  color: #365069;
  background: #eff7fb;
}

html[data-theme] .tutorial-content .tip,
html[data-theme] .tutorial-content .info,
html[data-theme] .tutorial-content .warning,
html[data-theme] .tutorial-content .tip-box,
html[data-theme] .tutorial-content .tutorial-warning,
html[data-theme] .tutorial-content blockquote {
  margin: 16px 0 22px;
  padding: 13px 15px;
  border-radius: 6px;
  box-shadow: none;
}

html[data-theme="dark"] .tutorial-content .tip,
html[data-theme="dark"] .tutorial-content .info,
html[data-theme="dark"] .tutorial-content .tip-box,
html[data-theme="dark"] .tutorial-content blockquote {
  color: #c9e9f5;
  background: #102837;
  border-color: #246078;
}

html[data-theme="light"] .tutorial-content .tip,
html[data-theme="light"] .tutorial-content .info,
html[data-theme="light"] .tutorial-content .tip-box,
html[data-theme="light"] .tutorial-content blockquote {
  color: #285268;
  background: #eef8fa;
  border-color: #b9dde5;
}

html[data-theme="dark"] .tutorial-content .warning,
html[data-theme="dark"] .tutorial-content .tutorial-warning {
  color: #f8dc94;
  background: #2d2515;
  border-color: #765d22;
}

html[data-theme="light"] .tutorial-content .warning,
html[data-theme="light"] .tutorial-content .tutorial-warning {
  color: #754d0c;
  background: #fff8e7;
  border-color: #efd48a;
}

html[data-theme] .tutorial-content .tutorial-card {
  margin: 18px 0 28px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: none;
}

html[data-theme="dark"] .tutorial-content .tutorial-card {
  background: #111e31;
  border-color: #2d425b;
}

html[data-theme="light"] .tutorial-content .tutorial-card {
  background: #f7fafc;
  border-color: #d7e2ec;
}

html[data-theme="dark"] .tutorial-content .tutorial-card-title,
html[data-theme="light"] .tutorial-content .tutorial-card-title {
  color: inherit;
  font-size: 18px;
}

.tutorial-content .install-step {
  gap: 13px;
  margin: 18px 0 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.tutorial-content .step-number {
  width: 30px;
  height: 30px;
  background: #0ea5e9;
  color: #ffffff;
}

.tutorial-content .step-body p {
  margin-top: 4px;
}

.tutorial-page .toc-sidebar .toc-title {
  color: #d7e5f5;
}

.tutorial-page .toc-sidebar .toc-link {
  line-height: 1.45;
}

html[data-theme="light"] .tutorial-page .toc-sidebar .toc-title {
  color: #334155;
}

@media (max-width: 768px) {
  html[data-theme="dark"] .tutorial-content,
  html[data-theme="light"] .tutorial-content {
    padding: 24px 17px 34px;
    overflow: hidden;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  html[data-theme="dark"] .tutorial-content > h1,
  html[data-theme="light"] .tutorial-content > h1 {
    padding-left: 12px;
    font-size: 26px;
  }

  html[data-theme] .tutorial-content > h2 {
    margin-top: 34px;
    padding: 10px 12px;
    font-size: 19px;
  }

  html[data-theme] .tutorial-content h3 {
    margin-top: 25px;
    font-size: 17px;
  }

  html[data-theme] .tutorial-content p,
  html[data-theme] .tutorial-content li {
    font-size: 14px;
    line-height: 1.8;
  }

  html[data-theme] .tutorial-content th,
  html[data-theme] .tutorial-content td {
    min-width: 130px;
    padding: 9px 10px;
  }

  html[data-theme] .tutorial-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  html[data-theme] .tutorial-content pre,
  html[data-theme] .tutorial-content .terminal-block,
  html[data-theme] .tutorial-content .tutorial-card {
    max-width: 100%;
    overflow-x: auto;
    contain: inline-size;
  }

  html[data-theme] .tutorial-content pre code {
    display: block;
    min-width: max-content;
  }

  html[data-theme] .tutorial-content :not(pre) > code {
    overflow-wrap: anywhere;
  }

  .tutorial-content .install-step {
    gap: 10px;
  }
}

/* Tutorial section color rhythm: blue, violet, teal, amber. */
html[data-theme="dark"] .tutorial-content > h2:nth-of-type(4n + 1) {
  color: #bfeaff;
  background: #12263b;
  border-color: #285271;
}

html[data-theme="dark"] .tutorial-content > h2:nth-of-type(4n + 2) {
  color: #d8ccff;
  background: #211b35;
  border-color: #51446f;
}

html[data-theme="dark"] .tutorial-content > h2:nth-of-type(4n + 3) {
  color: #9af2e4;
  background: #102b2b;
  border-color: #28605b;
}

html[data-theme="dark"] .tutorial-content > h2:nth-of-type(4n) {
  color: #f8dc83;
  background: #302712;
  border-color: #6f5a24;
}

html[data-theme="light"] .tutorial-content > h2:nth-of-type(4n + 1) {
  color: #075985;
  background: #edf8fd;
  border-color: #b9dfef;
}

html[data-theme="light"] .tutorial-content > h2:nth-of-type(4n + 2) {
  color: #6d28d9;
  background: #f5f1ff;
  border-color: #d9ccf7;
}

html[data-theme="light"] .tutorial-content > h2:nth-of-type(4n + 3) {
  color: #0f766e;
  background: #edfbf8;
  border-color: #bce8df;
}

html[data-theme="light"] .tutorial-content > h2:nth-of-type(4n) {
  color: #925b08;
  background: #fff8e7;
  border-color: #ecd594;
}

html[data-theme] .tutorial-content h3:nth-of-type(4n + 1) {
  border-left-color: #38bdf8;
}

html[data-theme] .tutorial-content h3:nth-of-type(4n + 2) {
  border-left-color: #a78bfa;
}

html[data-theme] .tutorial-content h3:nth-of-type(4n + 3) {
  border-left-color: #2dd4bf;
}

html[data-theme] .tutorial-content h3:nth-of-type(4n) {
  border-left-color: #f59e0b;
}

html[data-theme="dark"] .tutorial-content h4 {
  color: #c9bcf5;
}

html[data-theme="light"] .tutorial-content h4 {
  color: #6941b8;
}

.tutorial-content li::marker {
  color: #2dd4bf;
}

html[data-theme] .tutorial-content .tutorial-card {
  border-top: 3px solid #8b5cf6;
}

.tutorial-content .install-step:nth-of-type(3n + 2) .step-number {
  background: #8b5cf6;
}

.tutorial-content .install-step:nth-of-type(3n) .step-number {
  background: #0f9f8f;
}

.doc-content .guide-start,
.doc-content .guide-checks { margin: 24px 0; padding: 20px 0; border-top: 2px solid #169b87; }
.doc-content .guide-meta,
.doc-content .guide-version { font-size: 14px; line-height: 1.8; }
.doc-content .guide-table-wrap { overflow-x: auto; max-width: 100%; }
.doc-content .guide-table-wrap table { width: 100%; min-width: 0; table-layout: fixed; }
.doc-content .guide-table-wrap th,
.doc-content .guide-table-wrap td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.doc-content .guide-table-wrap code { white-space: normal; overflow-wrap: anywhere; }
.doc-content .guide-key-entry { border-left: 3px solid #169b87; padding: 10px 14px; }
.doc-content img { max-width: 100%; height: auto; }
@media (max-width: 640px) {
  .doc-content .guide-table-wrap th,
  .doc-content .guide-table-wrap td { padding: 8px; font-size: 14px; }
}
