hr {
    margin-bottom: 0.5em;
}

table {
    border-collapse: collapse;
    border: none;
    margin: -10px auto 10px auto;
    width: auto;
    max-width: 100%;
}

th,
td {
    border: 2px solid white;
    font-size: 1.2rem;
    padding: 2px 8px;
    font-weight: normal;
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.2);
}

tr:first-child th,
tr:first-child td {
    border-top: none;
}

thead+tbody tr:first-child td {
    border-top: 2px solid white;
}

tr:last-child th,
tr:last-child td {
    border-bottom: none;
}

th:first-child,
td:first-child {
    border-left: none;
}

th:last-child,
td:last-child {
    border-right: none;
}

#blog-container {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
}

#blog-sidebar {
    width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    border-right: 1px solid var(--Purple-color);
    transition: transform 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

#blog-sidebar.collapsed {
    width: 0;
    overflow: hidden;
    transform: translateX(-250px);
    border-right: none;
}

.sidebar-header {
    padding: 15px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid var(--Purple-color);
}

#article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.article-item {
    padding: 15px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
    color: #ddd;
}

.article-item:hover {
    background-color: rgb(from var(--Orange-color) r g b / 0.2);
    color: var(--Orange-color);
}

.article-item.active {
    background-color: rgb(from var(--Purple-color) r g b / 0.4);
    border-left: 4px solid var(--Orange-color);
    color: white;
}

#sidebar-toggle {
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--Purple-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: left 0.3s ease;
    font-size: 1.2rem;
    outline: none;
    align-self: flex-start;
    z-index: 2;
    margin: 0;
}

#blog-content {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#blog-scroll-container {
    flex: 1;
    width: 100%;
    position: relative;
    padding-top: 45px;
}

#blog-content-inner {
    max-width: 900px;
    margin: 0 auto;
    padding-left: 45px;
    margin-top: -50px;
}

#blog-content-inner h1,
#blog-content-inner h2,
#blog-content-inner h3 {
    text-shadow: none;
    margin-bottom: 10px;
}

#blog-content-inner h2 {
    font-size: 2rem;
}

#blog-content-inner h3 {
    font-size: 1.5rem;
    padding: 10px 0 10px 0;
}

#blog-content-inner h4 {
    font-size: 1.2rem;
    margin-top: -5px;
}

#blog-content-inner h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--Purple-color);
    padding-bottom: 5px;
    padding-top: 10px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 20px;
    font-style: italic;
}

.article-author {
    font-weight: 500;
}


#blog-content-inner p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.2em;
    color: #eee;
}

#blog-content-inner a {
    color: var(--SAP-color);
    text-decoration: underline;
}

#blog-content-inner code {
    background-color: #333;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--Orange-color);
}

#blog-content-inner pre {
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 15px;
}

#blog-content-inner pre code {
    background-color: transparent;
    padding: 0;
    color: #ddd;
}

#blog-content-inner ul,
#blog-content-inner ol {
    margin-bottom: 0.5em;
    padding-left: 40px;
}

#blog-content-inner li {
    margin-bottom: 0.5em;
    font-size: 1.1rem;
}

#blog-content-inner li p {
    margin-bottom: 0.2rem;
}

#blog-content-inner img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#blog-content-inner blockquote {
    border-left: 5px solid var(--Purple-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #aaa;
}

.back-to-list-btn {
    display: none !important;
}

@media (max-width: 912px) {
    #blog-scroll-container {
        padding-right: 10px;
    }
}

@media (max-width: 768px) {
    #blog-scroll-container {
        padding-right: unset;
    }

    .back-to-list-btn.visible {
        display: block !important;
        width: calc(100% - 30px);
        margin: 0 0 10px 0;
        padding: 15px;
        background: linear-gradient(135deg, var(--Purple-color), var(--Blue-color));
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1.1rem;
        font-weight: bold;
        cursor: pointer;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    footer {
        margin: 2px 0 0 0;
    }

    #blog-content {
        margin-bottom: -15px;
    }

    #blog-content-inner h1 {
        padding-top: 0;
    }

    #blog-content-inner p {
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #blog-content-inner ul,
    #blog-content-inner ol {
        padding-left: 20px;
    }

    #blog-content-inner code {
        padding: 0 5px;
    }

    #blog-container {
        flex-direction: column;
        height: auto;
    }

    #blog-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--Purple-color);
        transform: none;
    }

    #blog-sidebar.collapsed {
        height: 54px;
        width: 100%;
        transform: none;
    }

    #blog-content-inner {
        padding: 15px;
    }

    #blog-content {
        position: static;
    }

    #sidebar-toggle {
        border-radius: 5px 5px 0 0;
        right: 0;
        left: unset;
        margin: 0 5px 0 0;
        top: 52px;
        transform: translateY(-100%);
    }

    .back-to-list-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .back-to-list-btn:active {
        transform: translateY(0);
    }
}