/* QuickRouter API Docs - Main Stylesheet */

/* Default: Dark Mode */
:root {
  --color-primary: #3b82f6;
  --color-primary-dark: #60a5fa;
  --color-bg: #12071f;
  --color-bg-sidebar: #160d28;
  --color-bg-code: #1a0f30;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-sidebar: #cbd5e1;
  --color-border: #2d2048;
  --color-border-light: #1e1535;
  --color-hover: #1e1535;
  --color-active: #2a1555;
  --color-link: #60a5fa;
  --color-table-header: #1a0f30;
  --color-inline-code-bg: #2d2048;
  --color-code-text: #f1f5f9;
  --sidebar-width: 280px;
  --header-height: 74px;
  --content-max-width: 900px;
}

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

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

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

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-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

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

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

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

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

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

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

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

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 50;
}

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

.sidebar-title {
  font-weight: 600;
  font-size: 14px;
}

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

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

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

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  border-radius: 6px;
  margin: 0 6px;
}

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

.nav-section-title .arrow {
  font-size: 9px;
  transition: transform 0.25s ease;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

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

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

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

.nav-children::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 4px;
  width: 1.5px;
  background: var(--color-text-secondary);
  border-radius: 1px;
  opacity: 0.15;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 5px 12px 5px 32px;
  font-size: 13px;
  color: var(--color-text-sidebar);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.5;
  border-radius: 4px;
  margin: 0 6px;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 12px;
  height: 1.5px;
  background: var(--color-text-secondary);
  opacity: 0.15;
}

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

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

.nav-method {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: auto;
  letter-spacing: 0.3px;
  line-height: 15px;
  vertical-align: middle;
  font-family: "SF Mono", "Fira Code", monospace;
  flex-shrink: 0;
}

.nav-method.post {
  background: #f9731630;
  color: #f97316;
  border: 1px solid #f9731660;
}

.nav-method.get {
  background: #3b82f630;
  color: #3b82f6;
  border: 1px solid #3b82f660;
}

.nav-method.put {
  background: #f59e0b30;
  color: #f59e0b;
  border: 1px solid #f59e0b60;
}

.nav-method.delete {
  background: #ef444430;
  color: #ef4444;
  border: 1px solid #ef444460;
}

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

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

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

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

.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;
    height: 100vh;
    z-index: 200;
    transition: left 0.25s ease;
    padding-top: 0;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-header {
    display: flex;
  }

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

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

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

  .header-nav {
    display: none;
  }

  .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: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.param-children {
  overflow: hidden;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Tutorial step layout (quickrouter.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 */
[data-theme="light"] .tutorial-card {
  background: linear-gradient(180deg, #f8f6ff 0%, #f0ecfa 100%);
  border: 1px solid rgba(37,99,235,0.15);
}

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

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

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

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

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

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

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

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

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

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

/* 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;
}
