/* 页面目录样式 */
.page-toc {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e1e4e5;
    border-radius: 6px;
    padding: 15px;
    max-width: 280px;
    max-height: 75vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* 收起状态 - 纵向文字 */
.page-toc.collapsed {
    max-width: 30px;
    max-height: 100px;
    min-width: 30px;
    min-height: 100px;
    padding: 15px 8px;
    overflow: hidden;
    writing-mode: vertical-rl; /* 纵向排列 */
    text-orientation: mixed;
}

.page-toc.collapsed .page-toc-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 100%;
    justify-content: center;
}

.page-toc.collapsed .page-toc-header span {
    display: inline;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 2px; /* 字间距 */
}

.page-toc.collapsed .page-toc-header::before {
    display: none;
}

.page-toc.collapsed .page-toc-header .toggle-btn {
    display: none;
}

.page-toc.collapsed .page-toc-content {
    display: none;
}

.page-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    cursor: pointer;
    user-select: none;
    min-height: 24px;
}

.page-toc.collapsed .page-toc-header {
    justify-content: center;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    min-height: auto;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.page-toc.collapsed .toggle-btn {
    transform: rotate(180deg);
}

.page-toc-content {
    transition: opacity 0.3s ease;
}

.page-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-toc li {
    margin: 6px 0;
    position: relative;
}

.page-toc a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.page-toc a:hover {
    color: #2980b9;
    background: #f8f9fa;
    border-left-color: #2980b9;
}

.page-toc .h1 {
    font-weight: 600;
    color: #2c3e50;
    margin-left: 0;
}

.page-toc .h2 {
    margin-left: 12px;
    font-size: 14px;
}

.page-toc .h3 {
    margin-left: 24px;
    font-size: 13px;
    color: #666;
}

.page-toc .h4 {
    margin-left: 36px;
    font-size: 12px;
    color: #777;
}

.page-toc a.active {
    color: #e74c3c;
    background: #fff5f5;
    border-left-color: #e74c3c;
    font-weight: 500;
}

/* 隐藏标题中的锚点符号 */
.page-toc a::after {
    display: none !important;
}

/* 同时隐藏原始标题中的锚点链接（可选） */
.wy-nav-content .headerlink {
    display: none !important;
}

/* 或者只在目录中清理文本内容 */
.page-toc a {
    /* 确保没有额外的伪元素 */
    content: none !important;
}

@media (max-width: 1100px) {
    .page-toc {
        right: 10px;
        max-width: 240px;
    }
    
    .page-toc.collapsed {
        max-width: 28px;
        max-height: 90px;
        min-width: 28px;
        min-height: 90px;
        padding: 12px 6px;
    }
    
    .page-toc.collapsed .page-toc-header span {
        font-size: 13px;
        letter-spacing: 1px;
    }
}

@media (max-width: 768px) {
    .page-toc {
        display: none;
    }
}