:root {
    --primary-color:#747bff;
    --vp-c-bg: #ffffff;
    --vp-c-bg-alt: #f6f6f7;
    --vp-c-divider: #e2e2e3;
    --vp-c-text-1: #213547;
    --vp-c-text-2: #5d6c7b;
    --vp-c-brand: #646cff;
    --vp-c-brand-light: #747bff;
    --vp-c-hover: rgba(100, 108, 255, 0.08);
    --vp-c-active: rgba(100, 108, 255, 0.12);
    --vp-font-family-base: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --toc-width: 280px;
    --toc-active: #747bff;
    --radius: 12px;
}

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

body {
    font-family: var(--vp-font-family-base);
    background-color: var(--vp-c-bg-alt);
    color: var(--vp-c-text-1);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    display: flex;
    max-width: 1400px;
    width: 100%;
    gap: 40px;
}

.menu-container {
    flex: 0 0 280px;
    background-color: var(--vp-c-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.content {
    flex: 1;
    background-color: var(--vp-c-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.content-header{
    border-bottom: 1px solid var(--vp-c-divider);
    color: var(--vp-c-text-1);
}

.menu-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--vp-c-divider);
    font-weight: 600;
    font-size: 18px;
    color: var(--vp-c-text-1);
}

.menu-list {
    list-style: none;
    padding: 8px 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    color: var(--vp-c-text-2);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    cursor: pointer;
}

.menu-link:hover {
    color: var(--vp-c-text-1);
    background-color: var(--vp-c-hover);
}

.menu-link.active {
    color: var(--vp-c-brand);
    font-weight: 500;
    background-color: var(--vp-c-active);
}

.menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--vp-c-brand);
}

.has-children > .menu-link {
    padding-right: 40px;
}

.menu-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    color: var(--vp-c-text-3);
}

.menu-toggle:hover {
    color: var(--vp-c-text-2);
}

.menu-toggle.open {
    transform: translateY(-50%) rotate(90deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--vp-c-bg-alt);
}

.submenu.open {
    max-height: 1000px;
}

.submenu .menu-link {
    padding-left: 40px;
}

.submenu .submenu .menu-link {
    padding-left: 56px;
}

.content h1 {
    margin-bottom: 24px;
    color: var(--vp-c-text-1);
    font-weight: 600;
    font-size: 32px;
}

.content p {
    margin-bottom: 16px;
    color: var(--vp-c-text-2);
}

.content-section {
    margin-bottom: 32px;
}

.content-section h2 {
    margin-bottom: 16px;
    color: var(--vp-c-text-1);
    font-weight: 600;
    color: var(--vp-c-text-1);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--vp-c-text-2);
}

.empty-state h2 {
    margin-bottom: 16px;
    font-size: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--vp-c-divider);
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .menu-container {
        flex: none;
        width: 100%;
        position: static;
    }
}

/* Markdown内容样式 */
.markdown-body {
    max-width: 800px;
    font-size: 16px;
    line-height: 1.7;
    flex: 1;
    min-width: 0; /* 防止flex项目溢出 */
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 28px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    scroll-margin-top: 80px; /* 为锚点跳转添加偏移 */
}

.markdown-body h1 {
    font-size: 2.2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.7em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
}

.markdown-body h3 {
    font-size: 1.4em;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-bottom: 8px;
}

.markdown-body code {
    background-color: rgba(27,31,35,0.05);
    border-radius: 4px;
    font-size: 85%;
    margin: 0;
    padding: 0.2em 0.4em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.markdown-body pre {
    border-radius: var(--radius);
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    background-color: #1e1e1e;
    border-left: 4px solid var(--primary-color);
}

.markdown-body pre code {
    background-color: transparent;
    padding: 0;
    color: #f8f8f2;
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 20px 0;
    color: var(--text-light);
    background-color: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid #dfe2e5;
    padding: 12px 15px;
    text-align: left;
}

.markdown-body table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.markdown-body table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 代码语言标签 */
.code-language {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 4px 10px;
    font-size: 0.75em;
    border-bottom-left-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 右侧目录样式 */
.toc-container {
    width: var(--toc-width);
    position: sticky;
    top: 30px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    flex-shrink: 0;
    border-radius: var(--radius);
}

.toc {
    background-color: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.toc-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.toc-list a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 4px 0;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
}

.toc-list a:hover {
    color: var(--toc-active);
    background-color: var(--primary-light);
}

.toc-list a.active {
    color: var(--toc-active);
    font-weight: 500;
}

.toc-list a.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 标题层级缩进 */
.toc-list .h2 {
    padding-left: 12px;
}

.toc-list .h3 {
    padding-left: 24px;
}

.toc-list .h4 {
    padding-left: 36px;
}

.toc-list .h5 {
    padding-left: 48px;
}

.toc-list .h6 {
    padding-left: 60px;
}