:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #171717;
  --bg-tertiary: #1f1f1f;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --text-muted: #666666;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #60a5fa;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #ebebeb;
  --bg-card: #ffffff;
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-muted: #a3a3a3;
  --border: #e5e5e5;
  --border-hover: #d4d4d4;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-lg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.icon-logo {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

.header {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.4rem;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle .icon {
  color: inherit;
}

.hero {
  text-align: center;
  padding: 80px 0 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.gradient-text {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.search-container {
  max-width: 480px;
  margin: 0 auto 32px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-icon {
  margin-right: 12px;
  opacity: 0.5;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  box-shadow: var(--shadow);
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-tertiary);
}

.search-result-item .name {
  font-weight: 500;
}

.search-result-item .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.search-result-item .version {
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 32px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon .icon {
  color: inherit;
}

.btn-try {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-try:hover {
  color: var(--accent-hover);
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  transition: all 0.2s;
}

.feature:hover {
  border-color: var(--accent);
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.feature-icon {
  font-size: 1.5rem;
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.endpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}

.endpoint-card:hover {
  border-color: var(--accent);
}

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

.method {
  background: var(--success);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.endpoint-header code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
}

.endpoint-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.explorer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.explorer-controls {
  padding: 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-row+.filter-row {
  margin-top: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-group select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-width: 140px;
  cursor: pointer;
}

.filter-group select:hover,
.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-width: 140px;
}

.filter-input:hover,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 0;
  font-size: 0.85rem;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.explorer-url {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.url-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.url-box {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  gap: 10px;
}

.url-box code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
}

.filter-params {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-param {
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
}

.results-count {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.results-body {
  max-height: 350px;
  overflow: auto;
}

.results-body pre {
  margin: 0;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.tabs-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  gap: 4px;
}

.tab {
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab.active {
  background: var(--accent);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tab-content pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.tab-content code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
  justify-content: center;
}

.category-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.category-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.software-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.software-card:hover {
  border-color: var(--accent);
}

.software-card.skeleton {
  height: 76px;
  background: var(--bg-tertiary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.software-logo {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  object-fit: contain;
}

.search-result-logo {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
  object-fit: contain;
}

.software-info {
  display: flex;
  align-items: center;
}

.software-info h3 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.software-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.software-version {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-secondary);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-stats {
    flex-wrap: wrap;
  }

  .stat {
    flex: 1 1 120px;
    padding: 16px 20px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-group select {
    width: 100%;
  }

  .section {
    padding: 60px 0;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}