/* ===== 文章头部 ===== */
.article-header {
    background: linear-gradient(135deg, #050817 0%, #581bf3 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.article-hero {
    position: relative;
    z-index: 2;
}

.article-hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.breadcrumb-custom {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    position: relative;
}

.breadcrumb-custom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-custom a:hover {
    color: var(--brand-primary);
}

.breadcrumb-custom .separator {
    color: var(--text-muted);
}

.breadcrumb-custom .current {
    color: var(--brand-primary);
    font-weight: 600;
}

.article-category-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.article-title-main {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.5;
    color: white;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.article-meta-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.article-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-small {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== 主体内容区 ===== */
.main-content {
    padding: 2rem 0 4rem;
    background: #f8f9fa;
}

/* ===== 文章正文 ===== */
.article-body-wrapper {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.article-lead {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.7;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 500;
}

.article-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 2rem 0;
    padding: 1.5rem 2rem;
    position: relative;
    color: #555;
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
}

.article-excerpt::before {
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-size: 4rem;
    color: rgba(102, 126, 234, 0.2);
    font-family: serif;
    line-height: 1;
}

.article-content {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-body);
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 2.5rem 0 1.25rem;
}

.article-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 2rem 0 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

.article-content strong {
    color: var(--text-heading);
    font-weight: 600;
}

.article-content .highlight {
    background: rgba(37, 99, 235, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    color: var(--brand-primary);
    font-weight: 600;
}

/* 引用块 */
.article-content blockquote {
    background: var(--bg-soft);
    border-left: 4px solid var(--brand-primary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-heading);
}

.article-content blockquote p {
    margin: 0;
}

/* 代码块 */
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

.article-content p code {
    background: var(--bg-soft);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: var(--brand-primary);
}

/* 表格 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.article-content th {
    background: var(--brand-gradient-start);
    color: var(--text-heading);
    font-weight: 600;
    padding: 1rem 1.5rem;
    text-align: left;
}

.article-content td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover {
    background: var(--bg-soft);
}

/* 图片 */
.article-content figure {
    margin: 2rem 0;
}

.article-content img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.article-content figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

/* 提示框 */
.info-box {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.info-box-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 0.75rem;
}

.info-box p {
    margin: 0;
    color: var(--text-body);
}

/* 特性列表 */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-item {
    background: var(--bg-soft);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--brand-primary);
}

.feature-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-item h4 i {
    color: var(--brand-primary);
}

.feature-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-body);
}

/* ===== 文章底部 ===== */
.article-footer-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-subtle);
    margin-bottom: 2rem;
}

/* 标签 */
.article-tags {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
}

.article-tags-title {
    font-weight: 600;
    color: var(--text-heading);
}

.tag-item {
    background: var(--bg-soft);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-body);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tag-item:hover {
    background: white;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* 分享 */
.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-title {
    font-weight: 600;
    color: var(--text-heading);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn.wechat { background: #07C160; }
.share-btn.weibo { background: #E6162D; }
.share-btn.qq { background: #12B7F5; }
.share-btn.link { background: var(--brand-primary); }

/* 上下篇导航 */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.nav-article {
    background: var(--bg-soft);
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-article:hover {
    background: white;
    border-color: var(--brand-primary);
    transform: translateX(5px);
}

.nav-article-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-article-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.4;
}

.nav-article:hover .nav-article-title {
    color: var(--brand-primary);
}

/* ===== 侧边栏 ===== */
.sidebar {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-subtle);
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 目录 */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background: var(--brand-gradient-start);
    color: var(--brand-primary);
}

.toc-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 600;
}

.toc-sub {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

/* 热门文章 */
.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.popular-rank {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.popular-item:nth-child(1) .popular-rank { background: linear-gradient(135deg, #F97316, #EA580C); }
.popular-item:nth-child(2) .popular-rank { background: linear-gradient(135deg, #F59E0B, #D97706); }
.popular-item:nth-child(3) .popular-rank { background: linear-gradient(135deg, #EAB308, #CA8A04); }

.popular-content {
    flex: 1;
}

.popular-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-title:hover {
    color: var(--brand-primary);
}

.popular-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* CTA 卡片 */
.cta-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: white;
}

.cta-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.cta-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-card-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* ===== 响应式 ===== */
@media (max-width: 991.98px) {
    .article-body-wrapper {
        padding: 2rem;
    }

    .article-title-main {
        font-size: 1.75rem;
    }

    .sidebar {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }

    .article-navigation {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .article-header {
        padding: 3rem 0 2rem;
    }

    .article-body-wrapper {
        padding: 1.5rem;
    }

    .article-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .article-meta-info {
        flex-wrap: wrap;
    }
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.article-tags-title {
    white-space: nowrap;
    margin-right: 8px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 4px 12px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tag-item:hover {
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .article-tags {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tag-list {
        width: 100%;
        gap: 6px;
    }

    .tag-item {
        padding: 3px 10px;
        font-size: 13px;
    }
}