/* 技术文章详情页样式 */
.article-content-wrapper {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tech-detail-page,
.tech-detail-page *:not(.bi) {
    font-family: "PingFang SC", "PingFang TC", "苹方", "Microsoft YaHei", Arial, sans-serif;
    font-weight: 400 !important;
}

.article-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.article-category-badge {
    margin-bottom: 0.75rem;
}

.article-category-badge .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.article-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-meta-bar {
    color: #999;
    font-size: 0.85rem;
}

.article-meta-bar span {
    margin-right: 1rem;
}

.article-body {
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    line-height: 1.85;
    color: #444;
    font-size: 1rem;
}

/* Markdown 标题样式 - 从1级到4级，逐级缩小 */
.article-body h1 {
    font-size: 1.45rem;
    color: #333;
    margin-top: 2rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.article-body h2 {
    font-size: 1.28rem;
    color: #444;
    margin-top: 1.6rem;
    margin-bottom: 0.8rem;
}

.article-body h3 {
    font-size: 1.15rem;
    color: #555;
    margin-top: 1.35rem;
    margin-bottom: 0.65rem;
}

.article-body h4 {
    font-size: 1.02rem;
    color: #666;
    margin-top: 1.15rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin-bottom: 1rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body pre {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.article-body code {
    background: #f8f9fa;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.article-body table {
    width: 100%;
    margin-bottom: 0.75rem;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.article-body th, .article-body td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.article-body th {
    background: #f8f9fa;
}

/* 侧边栏样式 - 与产品详情页一致 */
.nav-card {
    position: sticky;
    top: var(--sticky-offset);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

/* 导航头部样式 - 与产品详情页一致 */
.nav-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #0d6efd;
}

.nav-header i {
    color: #0d6efd;
}

/* 阅读导航样式 */
.toc-nav {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* 隐藏滚动条 */
.toc-nav::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

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

.toc-item {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.toc-link {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.toc-link:hover {
    color: #0d6efd;
    background: #f8f9fa;
}

/* 不同级别标题的缩进和样式 */
.toc-item.level-1 .toc-link {
    color: #333;
}

.toc-item.level-2 {
    padding-left: 0.75rem;
}

.toc-item.level-3 {
    padding-left: 1.5rem;
    font-size: 0.8rem;
}

.toc-item.level-4 {
    padding-left: 2rem;
    font-size: 0.75rem;
}

/* 当前章节高亮 */
.toc-link.active {
    color: #0d6efd;
    background: #e7f1ff;
}

/* 上一篇/下一篇导航 */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.article-nav-item {
    flex: 1;
    max-width: 45%;
}

.article-nav-item.next {
    text-align: right;
}

.article-nav-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.35rem;
}

.article-nav-title {
    color: #667eea;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.article-nav-title:hover {
    text-decoration: underline;
}

/* 文章内容中的标题锚点 - 为固定导航栏留出空间 */
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
    scroll-margin-top: var(--sticky-offset);
}

/* 粘性侧边栏 */
.sticky-sidebar {
    position: sticky;
    top: var(--sticky-offset);
}

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

.related-item {
    border-bottom: 1px solid #f0f0f0;
}

.related-item:last-child {
    border-bottom: none;
}

.related-link {
    display: block;
    padding: 0.65rem 0;
    color: #475569;
    text-decoration: none;
    line-height: 1.5;
    font-size: 0.9rem;
}

.related-link:hover {
    color: #0d6efd;
}

.related-empty {
    color: #94a3b8;
    font-size: 0.88rem;
    padding: 0.25rem 0;
}
