/* 文章增强功能样式 */

/* 1. 目录导航样式 */
.article-toc {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-item {
    color: #a1a1aa;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: block;
}

.toc-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.toc-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    font-weight: 500;
}

.toc-level-2 {
    padding-left: 0.75rem;
}

.toc-level-3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

.toc-level-4 {
    padding-left: 2.25rem;
    font-size: 0.8rem;
}

/* 2. 代码复制按钮 */
pre {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.copy-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

/* 3. 分享功能 */
.article-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.share-label {
    color: #71717a;
    font-size: 0.9rem;
    font-weight: 500;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: #a5b4fc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.share-btn[data-platform="weibo"]:hover {
    background: rgba(230, 60, 55, 0.3);
    border-color: rgba(230, 60, 55, 0.5);
    color: #e63c37;
}

.share-btn[data-platform="wechat"]:hover {
    background: rgba(7, 193, 96, 0.3);
    border-color: rgba(7, 193, 96, 0.5);
    color: #07c160;
}

/* 4. 阅读进度条 */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* 响应式 */
@media (max-width: 768px) {
    .article-toc {
        padding: 1rem;
    }

    .toc-nav {
        max-height: 200px;
        overflow-y: auto;
    }

    .article-share {
        justify-content: center;
    }
}
