:root {
    --bg-gradient: linear-gradient(135deg, #0b0f17 0%, #1a202c 100%);
    --bg-color: #0b0f17;
    --card-bg: rgba(26, 32, 44, 0.65);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
    --accent-glow: rgba(139, 92, 246, 0.2);
    --code-bg: #1e1e2e;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Header */
.header {
    height: var(--header-height);
    background: rgba(11, 15, 23, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--text-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main {
    margin-top: calc(var(--header-height) + 3rem);
    flex: 1;
    margin-bottom: 4rem;
}

/* Post Layout */
.post {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 3rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.post-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 2rem;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.post-summary {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.badge-category {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-category:hover {
    background: rgba(6, 182, 212, 0.25);
}

.badge-tag {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-tag:hover {
    background: rgba(139, 92, 246, 0.25);
}

/* TOC */
.toc-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-title::before {
    content: "☰";
    color: var(--accent-primary);
}

#TableOfContents ul {
    list-style: none;
    padding-left: 1.25rem;
}

#TableOfContents > ul {
    padding-left: 0;
}

#TableOfContents a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
    padding: 0.2rem 0;
}

#TableOfContents a:hover {
    color: var(--accent-secondary);
    transform: translateX(3px);
}

/* Post Content Formatting */
.post-content {
    font-size: 1.05rem;
    color: #e2e8f0;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    background: linear-gradient(90deg, #ffffff, var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-left: 4px solid var(--accent-primary);
    padding-left: 0.75rem;
}

.post-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    background: rgba(139, 92, 246, 0.08);
    border-left: 4px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #cbd5e1;
}

/* Code and syntax highlighting */
.post-content pre {
    background: var(--code-bg) !important;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
}

.post-content code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    background: rgba(30, 30, 46, 0.8);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #f43f5e;
}

.post-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* List/Home Page */
.list-header {
    margin-bottom: 3rem;
    text-align: center;
}

.list-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.list-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.post-card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.post-card-title a:hover {
    color: var(--accent-secondary);
}

.post-card-summary {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.post-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--card-border);
    background: rgba(11, 15, 23, 0.8);
    backdrop-filter: blur(12px);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-powered {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .post {
        padding: 2rem 1.25rem;
    }
    
    .post-title {
        font-size: 1.85rem;
    }
}

/* Mermaid Diagrams */
.mermaid {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
}
