:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --text: #000000;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --bg: #ffffff;
  --code-bg: #f8f9fa;
}

[data-theme="dark"] {
  --primary: #66b3ff;
  --primary-dark: #4d9fff;
  --text: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border: #404040;
  --bg: #1a1a1a;
  --code-bg: #2d2d2d;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

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

nav a:hover,
nav a.active {
  color: var(--primary);
}

.github-link {
  color: var(--text);
  padding: 0.4rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.github-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
}

.theme-toggle:hover {
  transform: scale(1.1);
  opacity: 1;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  transition: stroke 0.3s ease;
}

.theme-toggle:hover svg {
  stroke: var(--primary);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* Hero Section */
.hero {
  padding: 1rem 0 0.75rem;
  max-width: 800px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.3;
}

.hero .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.badges {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

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

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

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

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

/* Feature Grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.feature-card {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.feature-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
}

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

/* Section */
.section {
  margin: 1.5rem 0 1rem;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.section p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

/* Code Blocks */
.code-block {
  margin: 1rem 0;
}

.code-block pre,
.quick-start pre,
pre {
  background: var(--code-bg);
  color: var(--text);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}

.code-block pre code,
.quick-start pre code,
pre code {
  color: var(--text);
  background: transparent;
  padding: 0;
}

code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--code-bg);
  color: var(--text);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.5rem 0;
}

/* Structure List */
.structure ul {
  list-style: none;
  padding: 0;
}

.structure li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.structure li:last-child {
  border-bottom: none;
}

/* Architecture Table */
.architecture table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.architecture th,
.architecture td,
th, td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
}

.architecture th,
th {
  background: var(--code-bg);
  font-weight: 600;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Page Content */
.page-content h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: var(--text);
}

.page-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: var(--text);
}

.page-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}

/* Footer */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-container a {
  color: var(--text);
  text-decoration: none;
}

.footer-container a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  main {
    padding: 1rem;
  }
  
  .header-container {
    padding: 0 1rem;
  }
}
