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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #2a2d26;
    color: #faf8ed;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

.left-box {
    width: 30%;
    background-color: #44473c;
    border: 2px solid #faf8ed;
    border-radius: 20px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.right-box {
    width: 70%;
    background-color: #44473c;
    border: 2px solid #faf8ed;
    border-radius: 20px;
    padding: 40px;
    overflow-y: auto;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #faf8ed;
}

.bio {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #faf8ed;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: auto;
}

.social-links a {
    color: #a773c9;
    font-size: 1.5em;
    transition: transform 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    transform: scale(1.2);
}

.friends-section {
    margin-bottom: 20px;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #faf8ed;
    font-size: 1.1em;
    cursor: pointer;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: color 0.2s;
}

.dropdown-toggle:hover {
    color: #a773c9;
}

.arrow {
    display: inline-block;
    transition: transform 0.3s;
    font-size: 0.8em;
}

.arrow.rotated {
    transform: rotate(90deg);
}

.friends-list {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 24px;
}

.friends-list.show {
    max-height: 300px;
}

.friends-list li {
    margin: 8px 0;
}

.friends-list a {
    color: #a773c9;
    text-decoration: none;
    transition: opacity 0.2s;
}

.friends-list a:hover {
    opacity: 0.7;
}

.blog-list {
    list-style: none;
}

.blog-item {
    background-color: rgba(250, 248, 237, 0.05);
    border-left: 4px solid #a773c9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: background-color 0.2s;
    position: relative;
}

.tag {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75em;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.tag-blog {
    background-color: #4a9eff;
    color: #faf8ed;
}

.tag-project {
    background-color: #ff6b6b;
    color: #faf8ed;
}

.tag-tutorial {
    background-color: #51cf66;
    color: #faf8ed;
}

.blog-item:hover {
    background-color: rgba(250, 248, 237, 0.1);
}

.blog-item h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #faf8ed;
}

.blog-item a {
    color: #a773c9;
    text-decoration: none;
    font-weight: 500;
}

.blog-item a:hover {
    text-decoration: underline;
}

.blog-item p {
    color: #faf8ed;
    opacity: 0.8;
    margin-top: 10px;
    line-height: 1.6;
}

.blog-date {
    font-size: 0.9em;
    opacity: 0.6;
    margin-top: 10px;
}

/* Custom scrollbar */
.right-box::-webkit-scrollbar {
    width: 10px;
}

.right-box::-webkit-scrollbar-track {
    background: rgba(250, 248, 237, 0.1);
    border-radius: 10px;
}

.right-box::-webkit-scrollbar-thumb {
    background: #a773c9;
    border-radius: 10px;
}

.right-box::-webkit-scrollbar-thumb:hover {
    background: #8e5db0;
}

/* Blog page specific styles */
.blog-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 40px;
    position: relative;
}

.blog-content {
    flex: 1;
    max-width: 800px;
}

.blog-article {
    margin-top: 20px;
}

.toc-wrapper {
    width: 280px;
    order: 2;
    position: relative;
}

.toc-sticky {
    position: fixed;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 200px;
    padding: 40px 0;
}

.toc-sticky h3 {
    position: absolute;
    top: 40px;
    left: 0;
    color: #faf8ed;
    font-size: 1em;
}

.toc-sticky ul {
    list-style: none;
    position: relative;
    height: 100%;
    padding-top: 80px;
}

.toc-sticky ul::before {
    content: '';
    position: absolute;
    left: 0;
    top: 80px;
    bottom: 0;
    width: 1px;
    background-color: #a773c9;
}

.toc-sticky li {
    position: absolute;
    line-height: 1.3;
    transition: all 0.3s ease;
    left: 0;
    width: 100%;
}

.toc-sticky li.h2 {
    padding-left: 0;
}

.toc-sticky li.h3 {
    padding-left: 15px;
    font-size: 0.8em;
}

.toc-sticky a {
    color: #a773c9;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    padding: 4px 0;
    opacity: 0.6;
    font-size: 0.85em;
    max-width: 100%;
    word-wrap: break-word;
}

.toc-sticky a:hover {
    opacity: 1;
}

.toc-sticky a.active {
    color: #faf8ed;
    font-weight: bold;
    opacity: 1;
    border-left: 3px solid #a773c9;
    padding-left: 8px;
    margin-left: -3px;
}

.toc-sticky li.h3 a.active {
    padding-left: 20px;
    margin-left: -3px;
}

/* Custom scrollbar for body */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: #2a2d26;
}

body::-webkit-scrollbar-thumb {
    background: #a773c9;
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: #8e5db0;
}

.blog-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-content h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.blog-content .blog-date {
    font-size: 1em;
    opacity: 0.6;
    margin-bottom: 30px;
    display: block;
}

.blog-content h2 {
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #faf8ed;
}

.blog-content p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #faf8ed;
}

.math-block {
    font-size: 1.2em;
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(250, 248, 237, 0.05);
    border-radius: 8px;
    overflow-x: auto;
}

.blog-content a {
    color: #a773c9;
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content code {
    background-color: rgba(250, 248, 237, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.blog-content pre {
    background-color: rgba(250, 248, 237, 0.1);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #a773c9;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .left-box {
        width: 100%;
        height: auto;
    }

    .right-box {
        width: 100%;
        height: auto;
        overflow-y: visible;
    }

    h1 {
        font-size: 2em;
    }

    .bio {
        font-size: 1em;
    }

    .social-links {
        margin-top: 20px;
    }

    .blog-container {
        flex-direction: column;
        padding: 20px 15px;
    }

    .toc-wrapper {
        order: -1;
        width: 100%;
        margin-bottom: 30px;
    }

    .toc-sticky {
        position: relative;
        right: auto;
        top: 0;
        width: 100%;
        padding: 20px;
        background-color: #44473c;
        border: 2px solid #faf8ed;
        border-radius: 12px;
    }

    .toc-sticky h3 {
        position: relative;
        top: 0;
        margin-bottom: 15px;
    }

    .toc-sticky ul {
        padding-top: 0;
        height: auto;
    }

    .toc-sticky li {
        position: relative !important;
        top: auto !important;
        margin: 8px 0;
    }

    .blog-content {
        padding: 20px 15px;
        max-width: 100%;
    }

    .blog-content h1 {
        font-size: 2em;
    }

    .blog-content h2 {
        font-size: 1.5em;
    }

    .blog-content p {
        font-size: 1em;
    }

    .math-block {
        font-size: 1em;
        padding: 15px;
        margin: 20px 0;
    }
}