:root {
     --primary-color: #2c3e50;
     --secondary-color: #3498db;
     --background-color: #ecf0f1;
     --container-bg: #ffffff;
     --text-color: #34495e;
     --body-font: 'Georgia', serif;
     --border-radius: 8px;
     --shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Mermaid diagram styling */
.mermaid {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow-x: auto;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Responsive design for mermaid diagrams */
@media (max-width: 768px) {
    .mermaid {
        margin: 15px 0;
        padding: 10px;
        font-size: 12px;
    }
}

/* 全局样式 */
body {
    /* font-family: Arial, sans-serif; */
    font-family: var(--body-font);
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f4f4f4;
}

h1 {
    color: #2c3e50;
    text-align: center;
}


/* 页面头部样式 */
.page-header {
    background-color: #34495e;
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #ecf0f1;
}

/* 文章区域样式 */
.post-section {
    background-color: #ffffff;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 16%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 15px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: visible; /* 允许 hover 弹出框显示 */
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* 自定义滚动条样式 - 只在需要时显示 */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar:hover {
    scrollbar-color: #f39c12 rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.sidebar:hover::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.sidebar h1 {
    color: #f39c12;
    margin-bottom: 25px;
    font-size: 1.6em;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 2px solid #f39c12;
    padding-bottom: 10px;
}

.sidebar h1 a {
    color: #f39c12;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sidebar h1 a:hover {
    color: #e67e22;
}

.sidebar h1 a:visited,
.sidebar h1 a:active {
    color: #f39c12;
}

.sidebar h2 {
    color: #ecf0f1;
    font-size: 1.1em;
    margin: 25px 0 15px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid #f39c12;
    padding-left: 10px;
}

/* Pygments monokai style */
.codehilite {
    background: #272822;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}


.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    padding: 6px;
    background-color: rgba(243, 156, 18, 0.15);
}

.sidebar ul li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar ul li a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.4;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar ul li a:hover {
    color: #f39c12;
    background-color: rgba(243, 156, 18, 0.15);
    padding-left: 20px;
}

.sidebar ul li a.active {
    color: #f39c12;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.2) 0%, rgba(230, 126, 34, 0.2) 100%);
    border-left: 4px solid #f39c12;
    padding-left: 20px;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.sidebar ul li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* 调整主内容区域样式 */
.content {
    margin-left: 17%; /* 稍微减少左边空白 */
    margin-right: 17%; /* 稍微减少右边空白 */
    padding: 20px 30px; /* 增加内边距防止贴边 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
    min-height: 100vh;
}

/* 内嵌 HTML 内容样式处理 */
.post-content {
    max-width: none !important;
    padding: 0 !important;
}

.post-content .container,
.post-content .report-container {
    max-width: none !important;
    width: 100% !important;
    padding: 20px !important;
    margin: 0 !important;
}

.post-content .basic-stats-section,
.post-content .highlight-box {
    padding: 20px !important;
    margin: 15px 0 !important;
}

.comments-section {
    padding-left: 1.5rem;
}

.comment {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
    background-color: #f9f9f9;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    min-width: 80px;
    margin-right: 10px;
}

/* 为 codehilite 添加样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

.chart-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 20px;
}

.chart {
    width: 45%;
    min-width: 300px;
    margin-bottom: 20px;
}

.chart-horizontal {
    width: 100%;
    min-width: 300px;
    margin-bottom: 20px;
}

/* 文档标题样式 */
.document-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 1rem;
    text-align: center; /* 居中显示 */
    padding-left: 20px;
    padding-right: 20px;
}

/* 右侧大纲侧边栏 */
.outline-sidebar {
    position: fixed;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15.5%;
    background: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

/* 大纲条目样式 */
.outline-item {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 4px 0;
    font-size: 0.9em;
    line-height: 1.4;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.outline-item:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.outline-item.active {
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

.hidden {
    display: none;
}

.content.full-width {
    margin-left: 2%;
    margin-right: 2%;
}

.outline-header {
    position: relative;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #34495e;
    font-size: 1.1rem;
}

.outline-list a {
    display: block;
    padding: 0.2rem 0;
    color: #7f8c8d;
    text-decoration: none;
    transition: all 0.2s;
}

.outline-list a:hover {
    color: #3498db;
    transform: translateX(5px);
}

@media (max-width: 1200px) {
    .outline-sidebar {
        display: none;
    }
    .content {
        margin-right: 0;
    }
}

.content ul li a {
    display: inline-block;
    margin-right: 10px;
}

.post-time {
    color: #7f8c8d;
    font-size: 0.5em;
    margin-left: auto;
    padding-left: 15px;
    white-space: nowrap;
}

.post-list-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-card-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.post-card-date {
    font-size: 0.9em;
    color: #666;
}

.sidebar, .outline-sidebar {
    transition: width 0.3s ease;
}
.sidebar.collapsed, .outline-sidebar.collapsed {
    top: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
}
.sidebar.collapsed h1,
.sidebar.collapsed h2,
.sidebar.collapsed ul,
.outline-sidebar.collapsed .outline-header,
.outline-sidebar.collapsed .outline-list {
    display: none;
}
.collapse-btn-left {
    position: absolute;
    right: -2px;
    top: -1px;
    z-index: 1000;
    color: #f39c12;
    background: rgba(44, 62, 80, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.collapse-btn-left:hover {
    background: #f39c12;
    color: #2c3e50;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.collapse-btn-left:focus {
    outline: none;
}

/* 收缩状态下的按钮样式 */
.sidebar.collapsed .collapse-btn-left {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 18px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sidebar.collapsed .collapse-btn-left:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #2c3e50;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}
.collapse-btn-right {
    position: absolute;
    left: -2px;
    top: -1px;
    z-index: 1000;
    color: #333;
    background: rgba(248, 249, 250, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.collapse-btn-right:hover {
    background: #007bff;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.collapse-btn-right:focus {
    outline: none;
}

/* 右侧收缩状态下的按钮样式 */
.outline-sidebar.collapsed .collapse-btn-right {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-size: 18px;
    background: #f8f9fa;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.outline-sidebar.collapsed .collapse-btn-right:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}
@media (max-width: 768px) {
    /* Automatically collapse sidebars on narrow screens */
    .sidebar, .outline-sidebar {
        width: 0;
        overflow: hidden;
    }
    .collapse-btn-left {
        padding-right: 6px;
    }
    .sidebar:not(.collapsed), .outline-sidebar:not(.collapsed) {
        width: 50%;
    }
}

/* Adjust content area to take full width when sidebars are collapsed */
.sidebar.collapsed ~ .content {
    margin-left: 0;
}
.outline-sidebar.collapsed ~ .content {
    margin-right: 0;
}

/* Show collapse buttons when sidebars are expanded */
.sidebar:not(.collapsed) .collapse-btn-left,
.outline-sidebar:not(.collapsed) .collapse-btn-right {
    display: block;
}

pre {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-left: 3px solid #f36d33;
    color: #666;
    page-break-inside: avoid;
    font-family: monospace;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 1.6em;
    max-width: 100%;
    overflow: auto;
    padding: 1em 1.5em;
    display: block;
    word-wrap: break-word;
}

canvas {
    max-width: 100%;
    max-height: 400px;
}

.paper-list {
    margin-top: 20px;
}

.paper-category {
    margin-bottom: 20px;
}

.paper-category-title {
    cursor: pointer;
    padding: 10px;
    background-color: #f2f2f2;
    border-radius: 5px;
}

.paper-item {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.paper-title {
    font-weight: bold;
    cursor: pointer;
}

.paper-author {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.paper-abstract {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.note {
    font-style: italic;
    color: #666;
    margin-top: 20px;
}

/* code style */
code {
    font-family: monospace, monospace;
    font-size: 0.9em;
    color: #c7254e;
    border-radius: 3px;
}

/* 内联代码特殊样式 */
:not(pre) > code {
    padding: 2px 4px;
    background-color: rgba(243,109,51,0.1);
    color: #f36d33;
    border: 1px solid rgba(243,109,51,0.2);
}

/* 为不同的代码语言添加特定样式 */
.codehilite .hll { background-color: #ffffcc }
.codehilite  { background: #f8f8f8; }
.codehilite .c { color: #408080; font-style: italic } /* Comment */
.codehilite .err { border: 1px solid #FF0000 } /* Error */
.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
.codehilite .o { color: #666666 } /* Operator */
.codehilite .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
.codehilite .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #A00000 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #FF0000 } /* Generic.Error */
.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #00A000 } /* Generic.Inserted */
.codehilite .go { color: #888888 } /* Generic.Output */
.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #0044DD } /* Generic.Traceback */
.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #008000 } /* Keyword.Pseudo */
.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #B00040 } /* Keyword.Type */
.codehilite .m { color: #666666 } /* Literal.Number */
.codehilite .s { color: #BA2121 } /* Literal.String */
.codehilite .na { color: #7D9029 } /* Name.Attribute */
.codehilite .nb { color: #008000 } /* Name.Builtin */
.codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.codehilite .no { color: #880000 } /* Name.Constant */
.codehilite .nd { color: #AA22FF } /* Name.Decorator */
.codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
.codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #0000FF } /* Name.Function */
.codehilite .nl { color: #A0A000 } /* Name.Label */
.codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
.codehilite .nv { color: #19177C } /* Name.Variable */
.codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.codehilite .w { color: #bbbbbb } /* Text.Whitespace */
.codehilite .mb { color: #666666 } /* Literal.Number.Bin */
.codehilite .mf { color: #666666 } /* Literal.Number.Float */
.codehilite .mh { color: #666666 } /* Literal.Number.Hex */
.codehilite .mi { color: #666666 } /* Literal.Number.Integer */
.codehilite .mo { color: #666666 } /* Literal.Number.Oct */
.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
.codehilite .sc { color: #BA2121 } /* Literal.String.Char */
.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
.codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
.codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.codehilite .sx { color: #008000 } /* Literal.String.Other */
.codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
.codehilite .ss { color: #19177C } /* Literal.String.Symbol */
.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #0000FF } /* Name.Function.Magic */
.codehilite .vc { color: #19177C } /* Name.Variable.Class */
.codehilite .vg { color: #19177C } /* Name.Variable.Global */
.codehilite .vi { color: #19177C } /* Name.Variable.Instance */
.codehilite .vm { color: #19177C } /* Name.Variable.Magic */
.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */

/* 添加针对Python语言的样式 */
.codehilite .python .k { color: #008000; font-weight: bold; } /* Keyword */
.codehilite .python .s { color: #BA2121; } /* String */
.codehilite .python .nb { color: #008000; } /* Built-in */
.codehilite .python .mf { color: #666666; } /* Float */

/* 确保所有代码块都有基本样式 */
.codehilite {
    background: #f8f8f8;
    padding: 0.5em;
    border-radius: 3px;
    overflow: auto;
}
.codehilite .python .nb { color: #008000; } /* Built-in */
.codehilite .python .mf { color: #666666; } /* Float */

/* 添加针对Bash语言的样式 */
.codehilite .bash .k { color: #008000; font-weight: bold; } /* Keyword */
.codehilite .bash .s { color: #BA2121; } /* String */
.codehilite .bash .nv { color: #19177C; } /* Variable */
.codehilite .bash .o { color: #666666; } /* Operator */
