:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --light-color: #f9f9f9;
    --border-color: #eaeaea;
    --text-color: #333;
    --text-light: #7f8c8d;
}

/* 文章目录样式 */
.article-catalog {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    /* background: white; */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9997;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* 必须配合半透明背景色 */
    background-color: rgba(222, 223, 224, 0.014);

    /* 模糊 20px，饱和度提升到 180% */
    backdrop-filter: blur(1px) saturate(180%);

    /* 兼容 Safari */
    -webkit-backdrop-filter: blur(1px) saturate(180%);
}

.article-catalog.show {
    transform: translateX(0);
}

.catalog-header {
    padding: 20px;
    /* background: var(--primary-color); */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    /* 必须配合半透明背景色 */
    background-color: rgba(10, 91, 158, 0.295);

    /* 模糊 20px，饱和度提升到 180% */
    backdrop-filter: blur(2px) saturate(180%);

    /* 兼容 Safari */
    -webkit-backdrop-filter: blur(2px) saturate(180%);
}

.catalog-title {
    font-size: 1.2rem;
    margin: 0;
    font-weight: normal;
}

.catalog-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-search {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.catalog-stats {
    padding: 10px 15px;
    background: var(--light-color);
    font-size: 0.8rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.catalog-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.article-catalog-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.article-catalog-item:hover {
    background: var(--light-color);
}

.article-catalog-item.active {
    background: #3498db33;
    color: white;
    backdrop-filter: blur(2px) saturate(180%);
    /* 兼容 Safari */
    -webkit-backdrop-filter: blur(2px) saturate(180%);
}

.article-catalog-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.catalog-item-title {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.catalog-item-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    display: flex;
    justify-content: space-between;
}

.catalog-item-level {
    display: inline-block;
    padding: 2px 6px;
    background: #95a5a6;
    color: white;
    border-radius: 3px;
    font-size: 0.7rem;
}

.catalog-item-tags {
    margin-top: 4px;
}

.catalog-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 4px;
    border-radius: 2px;
    margin-right: 3px;
    font-size: 0.7rem;
}

.article-catalog-item.active .catalog-tag {
    background: rgba(255, 255, 255, 0.3);
}

.catalog-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid #95a5a6;
    color: #95a5a6;
}

.btn-outline-secondary:hover {
    background: #95a5a6;
    color: white;
}

/* 目录切换按钮 */
.catalog-toggle-btn {
    position: fixed;
    left: 20px;
    top: 20px;
    /* background: var(--secondary-color); */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 999;
    /* 必须配合半透明背景色 */
    background-color: rgba(0, 111, 175, 0.411);

    /* 模糊 20px，饱和度提升到 180% */
    backdrop-filter: blur(20px) saturate(180%);

    /* 兼容 Safari */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.catalog-toggle-btn:hover {
    background: #005ac01a;
    transform: translateX(5px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-catalog {
        width: 280px;
    }



    .catalog-toggle-btn {
        left: 10px;
        top: 10px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .catalog-header {
        padding: 15px;
    }

    .catalog-title {
        font-size: 1.1rem;
    }

    .article-catalog-item {
        padding: 10px 12px;
    }

    .catalog-item-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-catalog {
        width: 100%;
    }

    .catalog-toggle-btn {
        display: none;
    }
}

/* 确保目录在悬浮菜单之上 */
.floating-menu {
    z-index: 9998;
}

.article-catalog {
    z-index: 9997;
}

.catalog-toggle-btn {
    z-index: 9996;
}