:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --link-color: #38bdf8;
    --link-hover: #7dd3fc;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-color);
  margin: 0;
  padding: 2rem 1rem;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

h1 {
  color: var(--text-primary);
  font-size: 2.25rem;
  margin: 0 0 0.5rem 0;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin: 0;
}

.sticky-bar {
  position: sticky;
  top: 0;
  background-color: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem 0;
  z-index: 100;
  margin-bottom: 2rem;
}

@media (prefers-color-scheme: dark) {
  .sticky-bar {
    background-color: rgba(15, 23, 42, 0.9);
  }
}

.search-container {
  margin-bottom: 1rem;
}

#search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-primary);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#search-input:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (prefers-color-scheme: dark) {
  #search-input:focus {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  }
}

.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

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

.nav-count {
  font-size: 0.75rem;
  background-color: var(--bg-color);
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.375rem;
  display: inline-block;
  transition: all 0.2s;
}

.nav-link:hover .nav-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.interface-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  transition: padding-bottom 0.2s;
}

.interface-section.collapsed {
  padding-bottom: 1.5rem;
}

.interface-section.collapsed .interface-header {
  margin-bottom: 0;
}

.interface-header {
  margin-top: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.interface-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.interface-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.interface-title a:hover {
  color: var(--link-color);
}

.interface-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-color);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.chevron {
  transition: transform 0.2s;
  transform: rotate(0deg);
}

.interface-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.interface-content {
  transition:
    max-height 0.3s ease-out,
    opacity 0.3s ease-out;
  max-height: 10000px;
  opacity: 1;
  overflow: hidden;
}

.interface-section.collapsed .interface-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.interface-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.api-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.api-item {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.api-item:first-child {
  border-top: none;
  padding-top: 0;
}

.api-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.api-name a {
  color: var(--link-color);
  text-decoration: none;
}

.api-name a:hover {
  text-decoration: underline;
}

.api-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

footer {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}
