/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0e1117;
  color: #c9d1d9;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: 'Fira Code', 'Consolas', monospace;
  background: #161b22;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #e6edf3;
}
hr.section-divider {
  border: none;
  border-top: 1px solid #21262d;
  margin: 48px 0;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100vh;
  background: #0d1117;
  border-right: 1px solid #21262d;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 24px 20px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #21262d;
  padding-bottom: 16px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.version-badge {
  font-size: 0.7rem;
  background: #21262d;
  color: #8b949e;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid #21262d;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}
.sidebar-search input:focus { border-color: #58a6ff; }
.sidebar-search input::placeholder { color: #484f58; }

.nav-list {
  list-style: none;
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}
.nav-section {
  padding: 16px 20px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8b949e;
}
.nav-link {
  display: block;
  padding: 6px 20px 6px 28px;
  color: #8b949e;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}
.nav-link:hover {
  color: #c9d1d9;
  background: #161b22;
  text-decoration: none;
}
.nav-link.active {
  color: #58a6ff;
  border-left-color: #58a6ff;
  background: rgba(56, 139, 253, 0.08);
}

/* ===== Mobile Header ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  z-index: 90;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.menu-btn {
  background: none;
  border: none;
  color: #c9d1d9;
  cursor: pointer;
  padding: 4px;
}
.mobile-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Content ===== */
.content {
  margin-left: 280px;
  flex: 1;
  max-width: 900px;
  padding: 48px 48px 80px;
}

h1 { font-size: 2.2rem; font-weight: 700; color: #e6edf3; margin-bottom: 16px; }
h2 { font-size: 1.6rem; font-weight: 700; color: #e6edf3; margin-bottom: 12px; }
h3 { font-size: 1.25rem; font-weight: 600; color: #e6edf3; margin-bottom: 10px; margin-top: 8px; }
h4 { font-size: 0.95rem; font-weight: 600; color: #8b949e; margin-bottom: 8px; }
.text-muted { color: #8b949e; font-weight: 400; }
.lead {
  font-size: 1.1rem;
  color: #8b949e;
  max-width: 640px;
  margin-bottom: 32px;
}
p { margin-bottom: 12px; }

/* ===== Feature Grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.feature-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: #30363d; }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.83rem; color: #8b949e; margin-bottom: 0; }

/* ===== URL Anatomy ===== */
.url-anatomy { margin: 20px 0 24px; }
.url-bar {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 14px 18px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: nowrap;
  line-height: 1.8;
}
.url-base { color: #8b949e; }
.url-transform { color: #d2a8ff; }
.url-sep { color: #484f58; }
.url-source { color: #7ee787; }
.url-labels {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.url-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #8b949e;
}
.label-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.base-dot { background: #8b949e; }
.transform-dot { background: #d2a8ff; }
.source-dot { background: #7ee787; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  vertical-align: middle;
  margin-right: 6px;
}
.transform-badge {
  background: rgba(210, 168, 255, 0.15);
  color: #d2a8ff;
}

/* ===== Tables ===== */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 0.875rem;
}
.param-table thead th {
  text-align: left;
  padding: 10px 14px;
  background: #161b22;
  border: 1px solid #21262d;
  font-weight: 600;
  color: #e6edf3;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.param-table tbody td {
  padding: 10px 14px;
  border: 1px solid #21262d;
  vertical-align: top;
}
.param-table tbody tr:hover { background: rgba(56, 139, 253, 0.04); }

/* ===== Info Box ===== */
.info-box {
  background: rgba(56, 139, 253, 0.08);
  border: 1px solid rgba(56, 139, 253, 0.25);
  border-left: 3px solid #58a6ff;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0 20px;
  font-size: 0.875rem;
}
.info-box ul { margin: 8px 0 0 18px; }
.info-box li { margin-bottom: 4px; }

/* ===== Example Blocks ===== */
.example-block {
  margin: 16px 0 24px;
  border: 1px solid #21262d;
  border-radius: 8px;
  overflow: hidden;
}
.example-block h4 {
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  margin: 0;
  font-size: 0.82rem;
}
.code-block {
  padding: 12px 16px;
  background: #0d1117;
  overflow-x: auto;
  position: relative;
  transition: background 0.15s;
}
.code-block:hover { background: #111820; }
.code-block.copied::after {
  content: 'Copied!';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #238636;
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.code-block code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  word-break: break-all;
  white-space: pre-wrap;
  color: #7ee787;
}
.example-preview {
  padding: 20px;
  background: #161b22;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}
.example-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ===== Footer ===== */
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid #21262d;
  text-align: center;
  color: #484f58;
  font-size: 0.83rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
  .mobile-header { display: flex; }
  .content { margin-left: 0; padding: 72px 20px 60px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .feature-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
