:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #fafafa;
  --primary: #166534;
  --primary-2: #22c55e;
  --soft-primary: rgba(22, 101, 52, 0.1);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a,
.sidebar-link,
.nav-link,
.header-nav a,
.header-nav-link {
  color: inherit;
  text-decoration: none !important;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-text span { color: var(--primary); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  padding: 8px 16px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  color: var(--muted) !important;
}

.header-nav a:hover {
  background: #f3f4f6 !important;
  color: var(--text) !important;
}

.header-nav a.active {
  color: var(--primary) !important;
  background: var(--soft-primary) !important;
}

.header-nav-link {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
}

.header-nav-link:hover {
  background: #f3f4f6;
  color: var(--text);
}

.header-nav-link.active {
  color: var(--primary);
  background: var(--soft-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.try-free-btn,
.try-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  border: none !important;
}

.main-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link,
.sidebar-link {
  display: block;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  border: 0;
  text-decoration: none;
  border-left: 0 !important;
  box-shadow: none !important;
}

.nav-link:hover,
.sidebar-link:hover {
  background: #f3f4f6;
  color: var(--text);
}

.nav-link.active,
.sidebar-link.active {
  color: var(--primary);
  background: var(--soft-primary);
  font-weight: 600;
  border-left: 0 !important;
}

.content {
  flex: 1;
  max-width: 900px;
  padding: 40px 64px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a { color: var(--primary); }

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.page-description {
  font-size: 1.125rem;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 32px;
}

.section { margin-bottom: 32px; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.section-content p,
.section-content ul,
.section-content table { margin-bottom: 14px; }

.section-content ul { padding-left: 22px; }

.section-card,
.feature-card,
.voice-card,
.step-card,
.endpoint-card,
.info-box,
.warning-box,
.code-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.section-card,
.step-card,
.endpoint-card,
.info-box,
.warning-box { padding: 18px; }

.feature-grid,
.voice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.voice-card {
  padding: 18px;
  min-height: 150px;
}

.home-links-grid {
  margin-top: 16px;
}

.home-link-card {
  display: block;
  min-height: 120px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-link-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.home-link-title {
  color: #3b82f6;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.2;
}

.home-link-subtitle {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
}

.voice-card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.voice-card-gender { color: var(--muted); margin-bottom: 10px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary:hover { border-color: #d1d5db; background: #f9fafb; }

.code-block { overflow: hidden; background: #111827; border-color: #111827; }

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: #9ca3af;
  font-size: 12px;
  border-bottom: 1px solid #374151;
}

.code-content { padding: 14px; overflow-x: auto; }

.code-content code,
pre code,
code {
  font-family: Consolas, Monaco, monospace;
}

pre code { color: #e5e7eb; font-size: 12.5px; line-height: 1.6; }

.api-table,
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.api-table th,
.api-table td,
table th,
table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.api-table th,
table th { background: #f9fafb; font-size: 13px; }

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 30px;
}

.page-nav-link {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.page-nav-link:hover { background: #f9fafb; }

.page-nav-label { font-size: 12px; color: var(--muted); }
.page-nav-title { font-size: 14px; color: var(--primary); font-weight: 600; }

.toc { display: none !important; }

@media (max-width: 980px) {
  .header-nav,
  .search-box { display: none; }

  .sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-layout { display: block; }
  .content { max-width: 100%; padding: 24px; }
  .feature-grid, .voice-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 2rem; }
}
