/**
 * 博客详情页专属样式
 * Blog Detail Page Styles
 */

/* ========================================
   Blog Detail Page Header
   ======================================== */
.blog-page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 180px 0 80px;
    text-align: center;
    color: var(--bg-white);
    margin-top: 80px;
}

.blog-page-header .page-header-content h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.3;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    /* 限制标题为 3 行 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-page-header .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    opacity: 0.9;
    flex-wrap: wrap;
}

.blog-page-header .breadcrumb a {
    color: var(--bg-white);
    transition: var(--transition);
}

.blog-page-header .breadcrumb a:hover {
    color: var(--secondary-color);
}

.blog-page-header .breadcrumb i {
    font-size: 0.75rem;
}

/* ========================================
   Blog Detail Section
   ======================================== */
.blog-detail-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.blog-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 50px;
}

/* ========================================
   Article Meta
   ======================================== */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 20px;
}

.meta-left {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.meta-category,
.meta-date,
.meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-medium);
    font-size: 0.95rem;
}

.meta-category i,
.meta-date i,
.meta-author i {
    color: var(--primary-color);
}

.meta-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-share > span {
    color: var(--text-medium);
    font-weight: 500;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--bg-white);
    transition: var(--transition);
}

.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.whatsapp { background: #25D366; }

.share-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* ========================================
   Table of Contents (参考 linenwind)
   ======================================== */
.table-of-contents {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.toc-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 700;
}

.toc-title i {
    color: var(--primary-color);
    margin-right: 10px;
}

.toc-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toc-link {
    display: block;
    padding: 10px 15px;
    color: var(--text-medium);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.95rem;
}

.toc-link:hover,
.toc-link.active {
    background: var(--bg-light);
    color: var(--primary-color);
}

.toc-link.active {
    font-weight: 600;
}

/* ========================================
   Article Content
   ======================================== */
.article-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.content-section {
    margin-bottom: 50px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.intro-lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-weight: 400;
}

.content-section h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.content-section h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 35px 0 20px;
    font-weight: 600;
}

.content-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* Highlight Box */
.highlight-box {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: rgba(243, 156, 18, 0.1);
    border-left: 4px solid var(--secondary-color);
    border-radius: var(--border-radius);
    margin: 30px 0;
}

.highlight-box i {
    font-size: 2rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.highlight-box strong {
    color: var(--text-dark);
}

/* Process Steps */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.step {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.step-num {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.step-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

/* Content Note */
.content-note {
    padding: 15px 20px;
    background: rgba(0, 51, 102, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    margin: 25px 0;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.content-note i {
    color: var(--primary-color);
    margin-right: 8px;
}

/* Feature List */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-medium);
    line-height: 1.7;
}

.feature-list li i {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-top: 3px;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 30px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.comparison-table thead {
    background: var(--primary-color);
    color: var(--bg-white);
}

.comparison-table th,
.comparison-table td {
    padding: 18px 20px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.comparison-table th {
    font-weight: 700;
    font-size: 1rem;
}

.comparison-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.comparison-table tbody tr:hover {
    background: rgba(0, 51, 102, 0.05);
}

/* Application Grid */
.application-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.app-card {
    padding: 25px;
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: var(--transition);
}

.app-card:hover {
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.app-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.app-card h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.app-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Cost Comparison */
.cost-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.cost-item {
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
}

.cost-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.cost-header i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.cost-header h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0;
}

.cost-factors {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.cost-factors li {
    color: var(--text-medium);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Pros & Cons Grid */
.pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.pros-cons-card {
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
}

.pros-cons-card h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pros-cons-card h3 i {
    font-size: 1.5rem;
}

.pros-list,
.cons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.pros-list li,
.cons-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-medium);
    line-height: 1.7;
    font-size: 0.95rem;
}

.pros-list li i {
    color: var(--secondary-color);
    margin-top: 3px;
}

.cons-list li i {
    color: #e74c3c;
    margin-top: 3px;
}

/* Selection Guide */
.selection-guide {
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin: 30px 0;
}

.guide-question {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.guide-question:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.guide-question h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-question h3 i {
    color: var(--primary-color);
}

.guide-answer p {
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 1rem;
}

.guide-answer strong {
    color: var(--text-dark);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    text-align: center;
    margin: 40px 0;
}

.cta-box h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.cta-box h3 i {
    margin-right: 10px;
}

.cta-box p {
    opacity: 0.95;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.cta-btn-primary {
    display: inline-block;
    padding: 16px 40px;
    background: var(--secondary-color);
    color: var(--bg-white);
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.cta-btn-primary:hover {
    background: var(--secondary-hover);
    transform: translateY(-3px);
}

/* Article Tags */
.article-tags {
    padding: 25px 30px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    margin-top: 30px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-right: 10px;
}

.tag-link {
    padding: 6px 15px;
    background: var(--bg-light);
    color: var(--text-medium);
    font-size: 0.9rem;
    border-radius: 20px;
    transition: var(--transition);
}

.tag-link:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 25px;
    padding: 35px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    margin-top: 30px;
    box-shadow: var(--shadow-md);
}

.author-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 2.5rem;
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.author-info p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 15px;
}

.author-social {
    display: flex;
    gap: 12px;
}

.author-social a {
    width: 35px;
    height: 35px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: var(--transition);
}

.author-social a:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* Related Articles */
.related-articles {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.related-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-weight: 700;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.related-card {
    padding: 25px;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-decoration: none;
}

.related-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.related-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    margin-bottom: 20px;
}

.related-image i {
    font-size: 3rem;
    opacity: 0.5;
}

.related-card h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.related-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .blog-detail-grid {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-page-header .page-header-content h1 {
        font-size: 2rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-content {
        padding: 25px;
    }

    .content-section h2 {
        font-size: 1.6rem;
    }

    .content-section h3 {
        font-size: 1.3rem;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-social {
        justify-content: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
    
    /* 移动端目录优化 */
    .table-of-contents {
        position: relative;
    }
    
    .toc-toggle {
        display: flex !important;
        width: 100%;
        padding: 15px 20px;
        background: var(--bg-white);
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;
        transition: var(--transition);
    }
    
    .toc-toggle:hover {
        border-color: var(--primary-color);
    }
    
    .toc-toggle i:last-child {
        transition: transform 0.3s ease;
    }
    
    .toc-toggle.active i:last-child {
        transform: rotate(180deg);
    }
    
    .toc-nav {
        display: none;
    }
    
    .toc-nav.show {
        display: block;
        animation: slideDown 0.3s ease;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .blog-page-header .page-header-content h1 {
        font-size: 1.6rem;
    }

    .table-of-contents {
        padding: 20px;
    }

    .toc-link {
        font-size: 0.9rem;
    }

    .highlight-box {
        flex-direction: column;
        gap: 15px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
