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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f5f6fa;
}

/* Header */
.site-header {
    background: #1a1f2e;
    padding: 14px 24px;
    display: flex;
    align-items: center;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}
.logo { height: 40px; width: auto; display: block; }
.logo-link { display: flex; align-items: center; }
.site-tagline {
    color: #a0aec0;
    font-size: 14px;
    border-left: 1px solid #2d3748;
    padding-left: 16px;
}

/* Layout */
.layout {
    display: flex;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
    gap: 32px;
    align-items: flex-start;
}

/* Sidebar nav */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: sticky;
    top: 24px;
}
.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.sidebar li { margin: 0; }
.sidebar a {
    display: block;
    padding: 9px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.sidebar a:hover {
    background: #f7fafc;
    color: #2d3748;
}
.sidebar a.active {
    background: #ebf4ff;
    color: #2b6cb0;
    border-left-color: #3182ce;
    font-weight: 500;
}

/* Main content */
.content {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 36px 40px;
}
.content h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1f2e;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.content h2 { font-size: 20px; color: #2d3748; margin-top: 32px; }
.content h3 { font-size: 17px; color: #4a5568; margin-top: 24px; }
.content p  { margin: 0 0 16px; color: #4a5568; }
.content ul, .content ol { padding-left: 24px; color: #4a5568; margin: 0 0 16px; }
.content li { margin-bottom: 6px; }
.content a  { color: #3182ce; text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin: 8px 0;
    display: block;
}
.content code {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.content pre {
    background: #1a1f2e;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 14px;
}
.content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}
.content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 15px;
}
.content th, .content td {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    text-align: left;
}
.content th { background: #f7fafc; font-weight: 600; color: #2d3748; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px;
    color: #a0aec0;
    font-size: 13px;
    border-top: 1px solid #e2e8f0;
    margin-top: 32px;
}

/* Homepage */
.home-intro {
    font-size: 16px;
    color: #4a5568;
    margin: 0 0 28px;
}
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.article-group {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
}
.article-group h2 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #718096;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.article-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-group li { margin-bottom: 8px; }
.article-group a {
    color: #2b6cb0;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-group a::before {
    content: '→';
    color: #a0aec0;
    font-size: 12px;
    flex-shrink: 0;
}
.article-group a:hover { color: #2c5282; text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .layout { flex-direction: column; padding: 0 16px; }
    .sidebar { width: 100%; position: static; }
    .content { padding: 24px 20px; }
}
