.article-header-box {}

.custom-tooltip {
    color: #5f5f5f;
    background: ghostwhite;
}

.article-header-box .article-title {
    text-align: center;
}

.article-header-box .article-bar {
    font-size: 12px;
    color: #808080;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.article-header-box .article-bar .article-bar-item {
    padding: 3px 6px;
    border-radius: 3px;
    background: ghostwhite;
    opacity: 0.9;
}

.article-header-box .article-bar .article-bar-item.original {
    color: #fff;
    background: #16baaac3 !important;
    font-weight: bolder;
}

.article-header-box .article-bar .article-bar-item.reprinted {
    color: #fff;
    background: #ffb800c3 !important;
    font-weight: bolder;
}

.article-header-box .article-bar .article-bar-item.hover {
    cursor: pointer;
}

.article-header-box .article-bar .article-bar-item a:hover {
    text-decoration: underline;
}

.theme-dark-mode .article-header-box .article-bar {
    color: #ccc;
}

.theme-dark-mode .article-header-box .article-bar .article-bar-item {
    background: #404040;
}

.article-header-box .article-bar .article-bar-item i {
    font-size: 12px;
}

.post-copyright {
    margin: 40px 0;
    padding: 20px;
    border-left: 4px solid #4a90e2;
    background-color: #f8f9fa;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.post-copyright .copyright-meta {
    font-weight: bold;
    color: #333;
    margin: 0 0 8px;
}

.post-copyright .copyright-info,
.post-copyright .copyright-notice {
    margin: 4px 0;
}

.theme-dark-mode .post-copyright {
    background-color: #2d2d2d;
    color: #ccc;
    border-left-color: #4a76a8;
}

.theme-dark-mode .post-copyright .copyright-meta {
    color: #e0e0e0;
}

@media (max-width:600px) {
    .post-copyright {
        padding: 16px;
        font-size: 13px;
    }
}

.toc {
    display: none;
    max-width: 180px;
    position: fixed;
    top: 60px;
    left: 20px;
    align-self: flex-start;
    background: #fdfdfdf2;
    border: 1px solid #eee;
    padding: 15px 0 15px 20px;
    border-radius: 8px;
    z-index: 2;
}

.toc.visible {
    display: block;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

.hidden-by-scroll {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.toc.manually-hidden {
    display: none !important;
}

.toggle-toc-btn {
    z-index: 1;
    position: absolute;
    right: 0px;
    top: 10px;
    width: 28px;
    height: 28px;
    border: 1px solid #eee;
    background: #fafafae6;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.toggle-toc-btn:hover {
    background: #fff;
    color: #16baaa;
}

#show-toc.toggle-toc-btn {
    position: fixed;
    left: 10px;
    top: 70px;
    display: none;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    width: 100%;
    margin-right: 20px;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    text-decoration: none;
    color: #333;
    white-space: nowrap;
}

.toc a:hover,
.toc a.active {
    color: #16b777;
    font-weight: bold;
}

.theme-dark-mode .toc {
    background: #333333f2;
    border-color: #444;
}

.theme-dark-mode .toc a {
    color: #f5f5f5;
}

.theme-dark-mode .toc a:hover,
.theme-dark-mode .toc a.active {
    color: #16b777;
}

.theme-dark-mode .toggle-toc-btn {
    border-color: #505050;
    background: #444444e6;
    color: #c2c2c2;
}

.theme-dark-mode .toggle-toc-btn:hover {
    background: #555;
    color: #16b777;
}

.md-main {
    font-size: 15px;
}

.md-main .line-numbers .line-numbers-rows {
    border-color: #555;
}

.md-main pre[class*=language-].line-numbers {
    position: unset;
}

.md-main ul,
.md-main ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.md-main li {
    margin-bottom: 8px;
    list-style: inherit;
}

.md-main blockquote {
    border-left: 4px solid #4CAF50;
    padding: 10px 20px;
    margin: 15px 0;
    background-color: #e8f5e9;
    color: #388e3c;
    border-radius: 4px;
    font-style: italic;
}

.md-main code:not([class*="language-"]) {
    background-color: #eef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    color: #c7254e;
    line-height: 1.5;
    cursor: pointer;
}

.md-main h2 {
    color: #2980b9;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 8px;
}

.md-main h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 5px;
}

.code-block-wrapper {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.code-block-header {
    background-color: #e0e0e0;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    position: relative;
    user-select: none;
}

.theme-dark-mode .code-block-header {
    background-color: #333333;
}

.code-block-header .filename {
    flex-grow: 1;
    text-align: right;
    font-size: 0.9em;
    color: #808080;
}

.traffic-lights {
    display: flex;
    gap: 6px;
}

.traffic-lights .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.traffic-lights .red {
    background-color: #ff5f56;
}

.traffic-lights .yellow {
    background-color: #ffbd2e;
}

.traffic-lights .green {
    background-color: #27c93f;
}

.traffic-lights .dot:hover {
    filter: brightness(0.9);
}

.traffic-lights .red:hover {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.traffic-lights .yellow:hover {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.traffic-lights .green:hover {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.code-block-wrapper pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    line-height: 1.5;
    background-color: #2d2d2d;
}

.code-block-wrapper pre[class*="language-"] {
    background: #272822;
    margin: 0;
    border-radius: 0;
}

.code-block-wrapper pre[class*="language-"].line-numbers {
    padding-left: 3.8em;
}

.code-block-wrapper code[class*="language-"] {
    background-color: transparent;
}

.code-block-wrapper pre::-webkit-scrollbar {
    height: 6px;
}

.code-block-wrapper pre {
    --scrollbar-track-color: transparent;
    --scrollbar-thumb-color: #555;
    --scrollbar-thumb-hover-color: #808080;
}

.md-main .copy-btn {
    position: absolute;
    right: 8px;
    top: 36px;
    padding: 5px 12px;
    background: #444;
    font-size: 12px;
    border: 0;
    border-radius: 3px;
    color: #e2e2e2;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.md-main .copy-btn::before {
    content: "📋";
}

.md-main pre:hover .copy-btn {
    opacity: 0.8;
}

.md-main pre:hover .copy-btn:hover {
    opacity: 1;
    background: #475569;
}

.md-main ul li input[type="checkbox"] {
    position: relative;
    left: 0;
    top: 0.3em;
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.theme-dark-mode .md-main ul li input[type="checkbox"] {
    accent-color: #4CAF50;
}

.md-main blockquote p:first-child {
    margin-bottom: 0;
}

.md-main blockquote p:last-child {
    margin-top: 0;
}

.md-main blockquote p {
    line-height: 1.5;
}

.md-main code:not([class*="language-"]) {
    background-color: #f9f9f9;
    color: #dd4a68;
    font-size: 0.95em;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid #eee;
    box-shadow: none;
    overflow-wrap: anywhere;
}

.md-main code:not([class*="language-"]):hover {
    background-color: #eeeeeea6;
    transition: background-color 0.2s ease;
}

.theme-dark-mode .md-main code:not([class*="language-"]) {
    background-color: #2d2d2d;
    color: #ff8a80;
    border-color: #444;
}

.md-main img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.md-main img:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.theme-dark-mode .md-main img {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.theme-dark-mode .md-main img:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.md-main p {
    margin: 1em 0;
    line-height: 1.7;
    color: #333;
}

.md-main a,
.post-copyright a {
    color: #2980b9;
    text-decoration: none;
    border-bottom: 1px dotted #2980b9;
    transition: all 0.2s ease;
}

.md-main a:hover,
.post-copyright a:hover {
    color: #1f90d9;
    border-bottom-style: solid;
}

#article-main hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc, transparent);
    margin: 30px 0;
}

.theme-dark-mode .article-header-box h1,
.theme-dark-mode .md-main h2,
.theme-dark-mode .md-main h3 {
    color: #e2e2e2;
}

.theme-dark-mode .md-main h2 {
    border-bottom-color: #444;
}

.theme-dark-mode .md-main p,
.theme-dark-mode .md-main li {
    color: #e2e2e2;
}

.theme-dark-mode .md-main a,
.theme-dark-mode .post-copyright a {
    color: #6ab0de;
    border-bottom-color: #6ab0de;
}

.theme-dark-mode .md-main a:hover,
.theme-dark-mode .post-copyright a:hover {
    color: #a0d4f5;
}

.theme-dark-mode .md-main blockquote {
    background-color: #1e3a2b;
    color: #81c784;
    border-left-color: #4caf50;
}

.theme-dark-mode #article-main hr {
    background: linear-gradient(to right, transparent, #444, transparent);
}

.theme-dark-mode .md-main code:not([class*="language-"]):hover {
    background-color: #444;
}

.theme-dark-mode .md-main blockquote:hover {
    background-color: #233d30;
    transition: background-color 0.2s ease;
}

.md-main table {
    width: 100%;
    display: block;
    overflow-x: auto;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 0.95em;
    line-height: 1.6;
    box-shadow: none;
}

.md-main th {
    padding: 12px 15px;
    text-align: center;
    background-color: #f5f7fa;
    color: #333;
    font-weight: 700;
    border: 1px solid #e8e8e8;
    white-space: nowrap;
}

.md-main td {
    padding: 12px 15px;
    border: 1px solid #e8e8e8;
    transition: background-color 0.15s ease;
}

.md-main tbody tr:hover {
    background-color: #f0f7ff;
}

.md-main table a {
    color: #0084ff;
    border-bottom: 1px solid #0084ff;
    background-image: none;
    padding-bottom: 1px;
}

.md-main table a:hover {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.md-main table code:not([class*="language-"]) {
    font-size: 0.9em;
}

@media (max-width:768px) {
    .md-main table {
        -webkit-overflow-scrolling: touch;
        margin: 15px 0;
    }

    .md-main th,
    .md-main td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
}

.theme-dark-mode .md-main table {
    border-color: #333;
}

.theme-dark-mode .md-main th {
    background-color: #2d2d2d;
    color: #e2e2e2;
    border-color: #444;
}

.theme-dark-mode .md-main td {
    color: #e2e2e2;
    border-color: #444;
}

.theme-dark-mode .md-main tbody tr:hover {
    background-color: #2d2d2d;
}

.theme-dark-mode .md-main table a {
    color: #4da6ff;
    border-bottom-color: #4da6ff;
}

.theme-dark-mode .md-main table a:hover {
    color: #80bfff;
    border-bottom-color: #80bfff;
}