/* TimRouter API Docs - Main Stylesheet */

/* Default: Dark Mode */
:root {
  --color-primary: #d0240f;
  --color-primary-dark: #ae453f;
  --color-accent: #ff9931;
  --color-bg: #f7f7f7;
  --color-bg-elevated: #ffffff;
  --color-bg-sidebar: #efefef;
  --color-bg-code: #121212;
  --color-text: #121212;
  --color-text-secondary: #525252;
  --color-text-sidebar: #525252;
  --color-border: #dcdcdc;
  --color-border-light: #f0f0f0;
  --color-hover: #ffe8dd;
  --color-active: #fbeede;
  --color-link: #ae453f;
  --color-table-header: #efefef;
  --color-inline-code-bg: #f0f0f0;
  --color-code-text: #f7f7f7;
  --sidebar-width: 280px;
  --header-height: 74px;
  --content-max-width: 1040px;
}

/* Light Mode */
{
  --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: #d0240f;
  --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: var(--color-bg-elevated);
  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;
}

.sidebar {
  background: linear-gradient(180deg, var(--color-bg-sidebar) 0%, var(--color-border-light) 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.04);
    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; }

.theme-icon-dark { display: none; }
.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;
}

.doc-content .tip {
  background: #f0fdf4;
}
.doc-content .warning {
  background: #fefce8;
}
.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.06);
  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.04);
}

.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(208, 36, 15, 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; }
.dj-key { color: #0369a1; }
.dj-str { color: #c2410c; }
.dj-num { color: #15803d; }
.dj-bool { color: #9a3b25; }

/* 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 (timrouter.ai style) */
.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 */
.tutorial-card {
  background: linear-gradient(180deg, #f8f6ff 0%, #f0ecfa 100%);
  border: 1px solid rgba(208, 36, 15,0.15);
}

.tutorial-card-title {
  color: #1a1033;
}

.tutorial-card-subtitle {
  color: #555;
}

.step-body h4 {
  color: #1a1033;
}

.step-body p,
.step-body ul {
  color: #555;
}

.step-body p a {
  color: var(--color-primary);
}

.terminal-block {
  background: #1e1e2e;
}

.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;
}

/* 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(208, 36, 15, 0.14), transparent 34rem),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 18rem),
    var(--color-bg);
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(208, 36, 15, 0.10), transparent 34rem),
    var(--color-bg);
}

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

.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;
}

.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);
}

.sidebar {
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg-sidebar) 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(208, 36, 15,0.28), rgba(208, 36, 15,0.13));
  box-shadow: inset 0 0 0 1px rgba(208, 36, 15,0.28);
}

.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(208, 36, 15,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);
}

.api-endpoint {
  background: linear-gradient(135deg, rgba(208,36,15,0.07), var(--color-bg-elevated)), #ffffff);
}

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

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

.api-url {
  color: var(--color-text);
}

.api-debug-btn {
  margin-left: 0;
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(208, 36, 15,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);
}

.param-card-header,
.code-tabs-header,
.auth-header {
  background: var(--color-bg-sidebar);
}

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

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

.param-row:hover {
  background: var(--color-bg-sidebar);
}

.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{
  --color-primary: #d0240f;
  --color-primary-dark: #ae453f;
  --color-primary-light: #60a5fa;
  --color-secondary: #10b981;
  --color-bg: #f5f7fb;
  --color-bg-elevated: #ffffff;
  --color-bg-sidebar: #ffffff;
  --color-bg-code: var(--color-bg-sidebar);
  --color-text: #111827;
  --color-text-secondary: #4b5c73;
  --color-text-muted: #7a8798;
  --color-text-sidebar: #334155;
  --color-border: #dbe3ef;
  --color-border-light: #edf2f7;
  --color-hover: #121212;
  --color-active: #e8f1ff;
  --color-link: #ae453f;
  --color-table-header: #f8fafc;
  --color-inline-code-bg: #eef2f7;
  --color-code-text: #e5edf8;
  --header-height: 72px;
  --content-max-width: 1060px;
}

htmlbody {
  background:
    radial-gradient(circle at 18% 0%, rgba(208, 36, 15,0.10), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(16,185,129,0.09), transparent 26rem),
    #f5f7fb;
  color: var(--color-text);
}

html.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.header-inner {
  max-width: 1680px;
  padding: 0 30px;
}

html.logo {
  color: var(--color-bg-sidebar);
}

html.logo-text {
  letter-spacing: 0;
}

html.header-nav a {
  color: #475569;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
}

html.header-nav a:hover {
  color: var(--color-bg-sidebar);
  background: #f1f5f9;
  border-color: #e2e8f0;
}

html.register-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #d0240f, #ae453f);
  border: 0 !important;
  box-shadow: 0 12px 24px rgba(208, 36, 15,0.24);
}

html.theme-toggle {
  color: #334155;
  background: var(--color-bg-sidebar);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

html.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.sidebar-nav {
  padding: 18px 12px 32px;
}

html.nav-section-title {
  color: #64748b;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
}

html.nav-section-title:hover {
  color: var(--color-bg-sidebar);
  background: var(--color-bg-sidebar);
}

html.nav-item {
  color: #475569;
  border-radius: 9px;
  padding: 8px 10px 8px 31px;
}

html.nav-item:hover {
  color: var(--color-bg-sidebar);
  background: #f3f7ff;
}

html.nav-item.active {
  color: #ae453f;
  background: linear-gradient(135deg, #eaf2ff, #f7fbff);
  box-shadow: inset 3px 0 0 #d0240f, 0 8px 18px rgba(208, 36, 15,0.10);
}

html.nav-item::before {
  background: #94a3b8;
}

html.nav-item.active::before {
  background: #d0240f;
}

html.nav-children::before {
  background: #e2e8f0;
}

html.nav-method {
  background: #eef2ff;
  border: 1px solid #dbeafe;
}

html.content {
  width: min(calc(100vw - var(--sidebar-width)), 1180px);
  padding: 34px 56px 80px;
}

html.breadcrumb {
  margin: 0 0 16px 4px;
  color: #64748b;
}

html.breadcrumb a {
  color: #64748b;
}

html.breadcrumb-current {
  color: var(--color-bg-sidebar);
}

html.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.doc-content h1 {
  color: var(--color-bg-sidebar);
  font-size: 36px;
  line-height: 1.18;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

html.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(208, 36, 15,0.10);
}

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

html.intro-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 12px;
  color: #ae453f;
  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(208, 36, 15,0.08);
}

html.intro-hero h2 {
  position: relative;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: 0;
}

html.intro-hero p {
  position: relative;
  max-width: 610px;
  margin: 0;
  color: #334155;
  font-size: 16px;
}

html.intro-orbit {
  position: relative;
  min-height: 196px;
}

html.intro-orbit span {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 40px;
  padding: 0 13px;
  color: var(--color-bg-sidebar);
  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.intro-orbit span:nth-child(1) {
  top: 10px;
  left: 10px;
  color: #ae453f;
}

html.intro-orbit span:nth-child(2) {
  top: 62px;
  right: 0;
  color: #c2410c;
  animation-delay: -1.4s;
}

html.intro-orbit span:nth-child(3) {
  left: 0;
  bottom: 38px;
  color: #047857;
  animation-delay: -2.6s;
}

html.intro-orbit span:nth-child(4) {
  right: 26px;
  bottom: 0;
  color: #9a3b25;
  animation-delay: -3.8s;
}

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

html.intro-stats div,
html.intro-card-grid section {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(15,23,42,0.06);
}

html.intro-stats div {
  padding: 18px 20px;
}

html.intro-stats div::before,
html.intro-card-grid section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #d0240f, #ff9931, #f97316);
}

html.intro-stats strong {
  display: block;
  color: var(--color-bg-sidebar);
  font-size: 26px;
  line-height: 1;
}

html.intro-stats span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

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

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

html.intro-card-grid section {
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

html.intro-card-grid section:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: 0 24px 46px rgba(208, 36, 15,0.12);
}

html.intro-card-grid strong {
  display: block;
  color: var(--color-bg-sidebar);
  font-size: 17px;
  margin-bottom: 10px;
}

html.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.intro-hero::before,
  html.intro-orbit span {
    animation: none;
  }
}

html.doc-content h2 {
  color: var(--color-bg-sidebar);
  font-size: 24px;
  margin-top: 44px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

html.doc-content h3,
html.doc-content h4 {
  color: #182235;
}

html.doc-content p,
html.doc-content li {
  color: #4b5c73;
}

html.doc-content a {
  color: #ae453f;
  text-decoration-color: rgba(208, 36, 15,0.28);
}

html.doc-content blockquote {
  background: #f8fbff;
  border-left-color: var(--color-primary);
}

html.doc-content table {
  background: var(--color-bg-elevated);
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 30px rgba(15,23,42,0.04);
}

html.doc-content th {
  color: #334155;
  background: var(--color-bg-sidebar);
}

html.doc-content td {
  color: #4b5c73;
  background: var(--color-bg-elevated);
}

html.doc-content tr:hover td {
  background: #fbfdff;
}

html.doc-content pre {
  background: var(--color-bg-sidebar);
  border: 1px solid #1e293b;
  box-shadow: 0 18px 42px rgba(15,23,42,0.20);
}

html.doc-content code {
  color: #1e40af;
  background: #eef2f7;
  border-color: #dbe3ef;
}

html.doc-content pre code {
  color: #e5edf8;
  background: transparent;
  border: 0;
}

html.api-endpoint {
  background: linear-gradient(135deg, var(--color-bg-sidebar), var(--color-bg-elevated));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 22px 48px rgba(15,23,42,0.22);
}

html.api-url {
  color: #f8fafc;
}

html.api-method {
  box-shadow: 0 8px 16px rgba(0,0,0,0.16);
}

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

html.api-debug-btn:hover {
  background: #d0240f;
}

html.param-card,
html.auth-section,
html.code-tabs {
  background: var(--color-bg-elevated);
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15,23,42,0.06);
}

html.param-card-header,
html.code-tabs-header,
html.auth-header {
  background: linear-gradient(180deg, var(--color-bg-sidebar) 0%, var(--color-border-light) 100%);
  border-bottom-color: #e2e8f0;
}

html.param-row {
  border-top-color: #edf2f7;
}

html.param-row:hover {
  background: #f8fbff;
}

html.param-name,
html.auth-tag {
  color: #ae453f;
}

html.code-tab {
  color: #64748b;
}

html.code-tab.active {
  color: #ae453f;
  background: #eff6ff;
}

html.copy-btn {
  color: #cbd5e1;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

html.page-nav a {
  background: var(--color-bg-elevated);
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 28px rgba(15,23,42,0.05);
}

html.page-nav a:hover {
  background: #f8fbff;
  border-color: #bfdbfe;
}

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

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

  html.content {
    width: 100%;
    padding: 18px 12px 46px;
  }

  html.doc-content {
    border-radius: 16px;
    padding: 24px 18px 30px;
  }

  html.doc-content h1 {
    font-size: 26px;
    margin-bottom: 22px;
  }

  html.intro-hero,
  html.intro-card-grid,
  html.intro-stats {
    grid-template-columns: 1fr;
  }

  html.intro-hero {
    padding: 24px 20px;
  }

  html.intro-hero h2 {
    font-size: 24px;
  }

  html.intro-orbit {
    min-height: 150px;
  }

  html.doc-content h2 {
    font-size: 20px;
  }

  html.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(208, 36, 15,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, #d0240f, #ff9931 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(208, 36, 15,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(208,36,15,0.07), var(--color-bg-elevated)), rgba(6,182,212,0.16), rgba(168,85,247,0.14));
  color: #93c5fd;
  border-color: rgba(56,189,248,0.36);
  box-shadow: inset 3px 0 0 #22d3ee, 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(208, 36, 15,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, var(--color-bg-elevated) 58%, #ff9931);
}

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, var(--color-bg-sidebar) 48%, var(--color-bg-elevated));
  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);
}

htmlbody {
  background:
    linear-gradient(rgba(208, 36, 15,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.035) 1px, transparent 1px),
    radial-gradient(circle at 16% 6%, rgba(208, 36, 15,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;
}

htmlbody::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.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.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.logo-text {
  background: linear-gradient(90deg, #ffffff, #bfdbfe 42%, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.header-nav a.nav-highlight,
html.header-register {
  background: linear-gradient(135deg, #d0240f, #ff9931 48%, #f97316);
  color: #fff;
  box-shadow: 0 10px 24px rgba(14,165,233,0.26);
}

html.header-nav a.nav-highlight:hover,
html.header-register:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

html.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.nav-section-title {
  color: #64748b;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

html.nav-item {
  border: 1px solid transparent;
}

html.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.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: #ae453f;
  border-color: rgba(96,165,250,0.55);
  box-shadow: inset 3px 0 0 #ff9931, 0 12px 28px rgba(208, 36, 15,0.16);
}

html.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(208, 36, 15,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.doc-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d0240f, #ff9931, #ff9931, #f97316, transparent);
  border-radius: 999px;
}

html.doc-content h1 {
  background: linear-gradient(90deg, var(--color-bg-sidebar), #ae453f 44%, #9a3b25);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.doc-content h2 {
  border-bottom: 1px solid rgba(191,219,254,0.8);
}

html.doc-content h2::after {
  content: "";
  display: block;
  width: 84px;
  height: 3px;
  margin-top: 10px;
  background: linear-gradient(90deg, #d0240f, #ff9931, #f97316);
  border-radius: 999px;
}

html.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(208, 36, 15,0.07);
}

html.doc-content table {
  overflow: hidden;
  border-color: rgba(147,197,253,0.56);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(208, 36, 15,0.10);
}

html.doc-content th {
  color: #e0f2fe;
  background: linear-gradient(135deg, var(--color-bg-sidebar), #ae453f 58%, #ff9931);
}

html.doc-content tr:hover td {
  background: linear-gradient(90deg, #f8fbff, #ecfeff);
}

html.doc-content pre,
html.api-endpoint {
  background:
    radial-gradient(circle at 12% 0%, rgba(34,211,238,0.16), transparent 30%),
    linear-gradient(135deg, #08111f, var(--color-bg-sidebar) 48%, var(--color-bg-elevated));
  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.api-debug-btn,
html.code-tab.active {
  background: linear-gradient(135deg, #d0240f, #ff9931);
  color: #fff;
}

html.param-card,
html.auth-section,
html.code-tabs {
  border-color: rgba(147,197,253,0.54);
  box-shadow: 0 20px 46px rgba(208, 36, 15,0.10);
}

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

@media (prefers-reduced-motion: reduce) {
  htmlbody::before {
    animation: none;
  }
}

/* TimRouter main-site palette alignment */
:root {
  --qr-purple-980: #0c0516;
  --qr-purple-950: #12071f;
  --qr-purple-900: #1a1033;
  --qr-purple-850: #24103f;
  --qr-purple-800: #3d2920;
  --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{
  --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%);
}

htmlbody {
  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.header,
html[data-theme="dark"] .header {
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 194, 66, 0.10), transparent 34%),
    rgba(247, 247, 247, 0.92);
  border-bottom: 1px solid rgba(245, 194, 66, 0.22);
  box-shadow: 0 18px 54px rgba(4, 1, 10, 0.44);
}

.header::after,
html.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.logo-text,
html[data-theme="dark"] .logo-text {
  background: linear-gradient(90deg, #ffffff, var(--qr-gold-light) 54%, var(--qr-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-nav a,
html.header-nav a {
  color: #e3d8f5;
}

.header-nav a:hover,
.header-login:hover,
html.header-nav a:hover {
  color: var(--qr-gold);
}

.header-nav a.nav-highlight,
html[data-theme="dark"] .header-nav a.nav-highlight,
html.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.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.header-register,
.api-debug-btn,
html.api-debug-btn,
html[data-theme="dark"] .api-debug-btn,
.copy-btn.copied,
.code-tab.active,
html.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.header-register:hover,
.api-debug-btn:hover,
html.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.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.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.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);
  box-shadow: inset 3px 0 0 var(--qr-gold), 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.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.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.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.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.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.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.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.doc-content pre,
html.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.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.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: #525252;
  --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(247, 247, 247, 0.92);
  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: linear-gradient(90deg, #ffffff, #7dd3fc 52%, #f6c33b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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);
  box-shadow: inset 3px 0 0 #22d3ee, 0 0 26px rgba(34, 211, 238, 0.14);
}

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.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;
}

@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.header-nav a.nav-invite:hover {
  color: #ffd76a;
  border-color: #f5c242;
  background: rgba(245, 194, 66, 0.1);
}

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

/* ============================================================
   TimRouter theme override — replaces QuickRouter's blue/purple
   palette with the TimRouter red-orange brand system.
   Light theme: warm white canvas + #d0240f/#ae453f/#ff9931 accents.
   ============================================================ */
:root {
  /* Brand primary → red-orange */
  --color-primary: #d0240f;
  --color-primary-dark: #ae453f;
  --color-primary-light: #ff9931;
  --color-link: #ae453f;
  --color-accent: #ff9931;
  --color-secondary: #16a34a;
  /* Light surfaces (warm white, matching the main site) */
  --color-bg: #f7f7f7;
  --color-bg-elevated: #ffffff;
  --color-bg-sidebar: #efefef;
  --color-bg-code: #121212;
  --color-text: #121212;
  --color-text-secondary: #525252;
  --color-text-sidebar: #525252;
  --color-border: #dcdcdc;
  --color-border-light: #f0f0f0;
  --color-hover: #ffe8dd;
  --color-active: #fbeede;
  --color-table-header: #efefef;
  --color-inline-code-bg: #f0f0f0;
  --color-code-text: #f7f7f7;
  /* QR brand vars → red-orange */
  --qr-purple-980: #221612;
  --qr-purple-950: #221612;
  --qr-purple-900: #221612;
  --qr-purple-850: #2e1d17;
  --qr-purple-800: #3d2920;
  --qr-gold: #ff9931;
  --qr-gold-light: #ffb05e;
  --qr-gold-soft: rgba(255, 153, 49, 0.14);
  --qr-cyan: #ff9931;
  --qr-pink: #d0240f;
  --qr-text-on-dark: #f7f7f7;
  --qr-muted-on-dark: #c4a89a;
}

/* Logo text & wordmark */
.logo-text { font-weight: 700; letter-spacing: -0.04em; }

/* Links inherit brand color */
a { color: #ae453f; }
a:hover { color: #d0240f; }

/* Buttons use brand red */
.btn-primary, .btn, button.btn-primary {
  background: #d0240f !important;
  color: #f7f7f7 !important;
  border-color: #d0240f !important;
}
.btn-primary:hover {
  background: #bb2009 !important;
}

/* Header active nav + brand gradient */
.header-nav a:hover, .nav-section-title:hover {
  color: #d0240f;
}
.nav-section-title {
  font-weight: 600;
}
.nav-section > a:hover {
  background: rgba(208, 36, 15, 0.06);
  color: #d0240f;
}

/* Inline code chips */
code, .inline-code {
  background: #f0f0f0;
  color: #9a3b25;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.875em;
}

/* Code blocks: dark terminal */
pre {
  background: #121212 !important;
  color: #f7f7f7 !important;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
}
pre code {
  background: transparent;
  color: #f7f7f7;
}

/* Table headers */
th, .table-header {
  background: #efefef;
  color: #525252;
}

/* Sidebar active link */
.sidebar .nav-section > a.active,
.sidebar a[aria-current="page"] {
  color: #d0240f;
  background: rgba(208, 36, 15, 0.06);
}

/* Headings get a subtle brand accent on the left border */
h2, h3 { color: #121212; }

/* Badges / tags */
.badge, .tag {
  background: rgba(208, 36, 15, 0.08);
  color: #d0240f;
  border-color: rgba(208, 36, 15, 0.22);
}

/* Copy button on code blocks */
.copy-btn {
  background: rgba(255,255,255,0.1);
  color: #f7f7f7;
  border: 1px solid rgba(255,255,255,0.15);
}
.copy-btn:hover {
  background: #d0240f;
  color: #f7f7f7;
}

/* ============================================================
   TimRouter forced light theme — override any dark-mode residue
   ============================================================ */
html, body { background: #f7f7f7 !important; color: #121212 !important; }
.doc-content, .doc-content h1, .doc-content h2, .doc-content h3,
.doc-content h4, .doc-content h5, .doc-content p, .doc-content li,
.doc-content td, .doc-content th { color: #121212 !important; }
.doc-content h1 { color: #121212 !important; }
.header { background: rgba(247,247,247,0.92) !important; border-bottom: 1px solid #dcdcdc !important; box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important; }
.header-nav a, .logo-text { color: #525252 !important; }
.header-nav a:hover { color: #d0240f !important; }
.sidebar { background: #efefef !important; }
.sidebar .nav-section-title { color: #525252 !important; }
.sidebar .nav-section > a { color: #525252 !important; }
.sidebar .nav-section > a:hover { color: #d0240f !important; background: rgba(208,36,15,0.06) !important; }
.register-btn, .btn-register { background: #d0240f !important; color: #f7f7f7 !important; }
.register-btn:hover { background: #bb2009 !important; }
.theme-toggle { color: #525252 !important; }
.logo-text { color: #121212 !important; font-weight: 700; }

/* ============================================================
   TimRouter docs — full visual alignment with the main site.
   Applies the brand's Space Grotesk type, warm-white canvas,
   soft shadows, red-orange gradient CTAs, and 2xl radii.
   ============================================================ */

/* ---- Typography: use the site's font stack ---- */
body, .doc-content, .doc-content h1, .doc-content h2, .doc-content h3,
.doc-content h4, .doc-content p, .doc-content li, .doc-content td,
.doc-content th, .sidebar, .header, .header-nav a, .logo-text,
.nav-section-title, .nav-section > a {
  font-family: "Space Grotesk", "IBM Plex Sans", "Noto Sans SC", "PingFang SC", sans-serif !important;
}

/* ---- Wordmark ---- */
.logo-text {
  letter-spacing: -0.04em !important;
}

/* ---- Canvas & surfaces (warm white #f7f7f7, matching site) ---- */
html, body { background: #f7f7f7 !important; color: #121212 !important; }
.doc-content { background: transparent !important; color: #121212 !important; }

/* ---- Header: matches site (fixed, border-bottom-subtle, canvas/95) ---- */
.header {
  background: rgba(247, 247, 247, 0.95) !important;
  border-bottom: 1px solid #dcdcdc !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px) !important;
}
.header-nav a, .logo-text { color: #525252 !important; }
.header-nav a:hover { color: #d0240f !important; }
.register-btn {
  background: #222222 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: opacity 0.18s ease !important;
}
.register-btn:hover { opacity: 0.9 !important; }

/* ---- Sidebar: warm surface #efefef ---- */
.sidebar {
  background: #efefef !important;
  border-right: 1px solid #dcdcdc !important;
}
.sidebar-header { border-bottom: 1px solid #dcdcdc !important; }
.nav-section-title {
  color: #525252 !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
}
.nav-section > a {
  color: #525252 !important;
  border-radius: 8px !important;
  transition: all 0.18s ease !important;
}
.nav-section > a:hover {
  color: #d0240f !important;
  background: rgba(208, 36, 15, 0.06) !important;
}

/* ---- Doc content headings ---- */
.doc-content h1 {
  color: #121212 !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 1rem !important;
}
.doc-content h2 {
  color: #121212 !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  border-bottom: 1px solid #dcdcdc !important;
  padding-bottom: 0.5rem !important;
}
.doc-content h3 { color: #121212 !important; font-weight: 600 !important; }
.doc-content h4 { color: #525252 !important; font-weight: 600 !important; }
.doc-content p, .doc-content li { color: #525252 !important; line-height: 1.7 !important; }
.doc-content a { color: #ae453f !important; text-decoration: none !important; }
.doc-content a:hover { color: #d0240f !important; }

/* ---- Cards / callout boxes: soft shadow + 2xl radius ---- */
.doc-content .tip, .doc-content .warning, .doc-content .info,
.doc-content blockquote, .doc-content .callout {
  border-radius: 16px !important;
  border: 1px solid #dcdcdc !important;
  box-shadow: 0 10px 32px rgba(18, 18, 18, 0.08) !important;
  background: #ffffff !important;
}

/* ---- Code: dark terminal blocks (matching site) ---- */
.doc-content pre {
  background: #121212 !important;
  border: 1px solid #dcdcdc !important;
  border-radius: 12px !important;
  padding: 1rem 1.25rem !important;
}
.doc-content pre code { color: #f7f7f7 !important; background: transparent !important; }
.doc-content code, .doc-content .inline-code {
  background: #f0f0f0 !important;
  color: #9a3b25 !important;
  border-radius: 4px !important;
  padding: 0.1em 0.35em !important;
  font-size: 0.875em !important;
}

/* ---- Tables ---- */
.doc-content table {
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid #dcdcdc !important;
}
.doc-content th {
  background: #efefef !important;
  color: #525252 !important;
  font-weight: 600 !important;
}
.doc-content td { border-color: #dcdcdc !important; }

/* ---- Buttons / CTA: brand gradient ---- */
.doc-content .btn-primary, .doc-content .btn, .doc-content button.btn-primary {
  background: #d0240f !important;
  color: #f7f7f7 !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  transition: background 0.18s ease, transform 0.18s ease !important;
}
.doc-content .btn-primary:hover {
  background: #bb2009 !important;
  transform: translateY(-1px) !important;
}

/* ---- Copy button on code blocks ---- */
.copy-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f7f7f7 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
}
.copy-btn:hover { background: #d0240f !important; color: #f7f7f7 !important; }

/* ---- Badges / tags ---- */
.badge, .tag {
  background: rgba(208, 36, 15, 0.08) !important;
  color: #d0240f !important;
  border: 1px solid rgba(208, 36, 15, 0.22) !important;
  border-radius: 9999px !important;
  font-weight: 500 !important;
}

/* ---- Theme toggle: subtle gray icon ---- */
.theme-toggle { color: #737373 !important; }

/* ---- Scrollbar (subtle, matching site) ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Layout container: match site's max-width feel ---- */
.layout { background: #f7f7f7 !important; }
main.content { background: transparent !important; }

/* ============================================================
   TimRouter docs header — matches the main site dark aurora theme.
   Fixed top, 76px height, canvas/55 + blur, Space Grotesk.
   ============================================================ */
.tr-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  background: rgba(5, 8, 7, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(36, 53, 48, 0.4);
}
.tr-header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 7.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .tr-header-inner { padding: 0 1rem; }
  .tr-header { height: 60px; }
}

/* Logo */
.tr-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.tr-logo-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
}
.tr-logo-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Nav links */
.tr-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.tr-nav a {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.875rem;
  color: #d4f0e0;
  text-decoration: none;
  padding: 0.5rem 0;
  border-radius: 0;
  transition: color 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.tr-nav a:hover {
  background: transparent;
  color: #00ff9d;
}
@media (max-width: 768px) {
  .tr-nav { display: none; }
}

/* Sign in button */
.tr-actions { display: flex; align-items: center; gap: 0.5rem; }
.tr-signin {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d4f0e0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.tr-signin:hover {
  color: #ffffff;
}

/* Offset body for fixed header (doc pages already have their own layout,
   add top padding so content doesn't hide under the fixed header) */
.layout { padding-top: 76px; }
@media (max-width: 768px) {
  .layout { padding-top: 60px; }
}

/* Logo icon as image (matches main site /logo.png) */
img.tr-logo-icon {
  width: 26px !important;
  height: 26px !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

/* ---- Refer & Earn pill (matches main site dark aurora) ---- */
.tr-refer {
  font-family: "Space Grotesk", sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #00ff9d !important;
  background: transparent !important;
  border: 1px solid rgba(0, 255, 157, 0.3) !important;
  border-radius: 0 !important;
  padding: 0.375rem 0.75rem !important;
  text-decoration: none !important;
  transition: background 0.2s ease !important;
  white-space: nowrap !important;
}
.tr-refer:hover {
  background: rgba(0, 255, 157, 0.08) !important;
}

/* ---- Sign in button (matches main site dark aurora) ---- */
.tr-signin {
  font-family: "Space Grotesk", sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #d4f0e0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.5rem 0.75rem !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
  white-space: nowrap !important;
}
.tr-signin:hover {
  color: #ffffff !important;
}

/* ---- Actions cluster ---- */
.tr-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* ---- Active nav link ---- */
.tr-nav a.active {
  color: #00ff9d !important;
  font-weight: 600 !important;
}

/* ---- Mobile toggle ---- */
.tr-mobile-toggle {
  display: none !important;
  background: none !important;
  border: none !important;
  font-size: 1.5rem !important;
  color: #ffffff !important;
  cursor: pointer !important;
}
@media (max-width: 768px) {
  .tr-nav { display: none !important; }
  .tr-refer { display: none !important; }
  .tr-mobile-toggle { display: block !important; }
}

/* ---- Nav link hover (underline animation like site) ---- */
.tr-nav a {
  position: relative !important;
}
.tr-nav a:hover {
  background: transparent !important;
  color: #00ff9d !important;
}
