/**
 * AI文章详情页统一样式
 * 适用于AI教程、AI项目、AI资讯等所有AI文章详情页
 * 确保所有AI文章页面样式保持一致
 */

/* ===== 页面布局修复 ===== */
/* 确保AI文章页面在page-container布局中正确显示 */
.page-container .main-content.page {
    margin-left: 250px !important; /* 强制设置左边距，避免与侧边栏重叠 */
    width: calc(100% - 250px) !important; /* 确保宽度正确 */
    position: relative;
    z-index: 1;
    background: #f9f9f9;
}

/* 增加选择器优先级，确保样式生效 */
body.single-ai-tutorial .page-container .main-content.page,
body.single-ai-project .page-container .main-content.page,
body.single-ai-news .page-container .main-content.page,
.page-container .main-content.page.ai-article-page {
    margin-left: 250px !important; /* 强制设置左边距，避免与侧边栏重叠 */
    width: calc(100% - 250px) !important; /* 确保宽度正确 */
    position: relative !important;
    z-index: 1 !important;
    background: #f9f9f9 !important;
}

/* 移动端布局修复 */
@media (max-width: 768px) {
    .page-container .main-content.page {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* 增加移动端选择器优先级 */
    body.single-ai-tutorial .page-container .main-content.page,
    body.single-ai-project .page-container .main-content.page,
    body.single-ai-news .page-container .main-content.page,
    .page-container .main-content.page.ai-article-page {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ===== AI文章详情页统一样式 ===== */
/* 页面容器 */
.single-ai-tutorial .main-content.page,
.single-ai-project .main-content.page,
.single-ai-news .main-content.page {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 200px);
    background: #f8f9fa;
    padding: 20px 0;
}

/* 主容器 */
.single-ai-tutorial .container,
.single-ai-project .container,
.single-ai-news .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 行布局 */
.single-ai-tutorial .row,
.single-ai-project .row,
.single-ai-news .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
    width: 100%;
    max-width: 100%;
}

/* 列布局 */
.single-ai-tutorial .col-12,
.single-ai-project .col-12,
.single-ai-news .col-12 {
    padding: 0 15px;
    position: relative;
    flex: 0 0 100%;
    max-width: 100%;
}

/* 面包屑导航 */
.breadcrumb-nav {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%;
}

.breadcrumb-nav a {
    color: #007cba;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: #005a87;
}

.separator {
    margin: 0 10px;
    color: #666;
}

.current {
    color: #333;
    font-weight: 600;
}

/* 文章头部 */
.article-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    width: 100%;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.meta-item i {
    color: #007cba;
}

/* 文章缩略图 */
.article-thumbnail,
.article-featured-image {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    width: 100%;
}

.article-thumbnail img,
.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f8f9fa;
    color: #666;
    text-align: center;
    aspect-ratio: 16 / 9;
}

.image-placeholder i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

/* 文章摘要 */
.article-excerpt {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    width: 100%;
}

.excerpt-text {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    font-style: italic;
}

/* 文章内容 */
.article-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    line-height: 1.8;
    color: #333;
    width: 100%;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content h2 {
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.article-content h3 {
    font-size: 24px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.article-content h4 {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* 免责声明 */
.disclaimer-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    color: #856404;
    width: 100%;
}

.disclaimer-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* 文章底部 */
.article-footer {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
}

.article-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* 相关文章 */
.related-articles {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 30px;
    width: 100%;
}

/* 相关项目/教程容器 */
.related-projects {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 30px;
    width: 100%;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: #667eea;
}

.related-list {
    display: grid;
    gap: 20px;
}

.related-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.related-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* 缩略图容器样式 */
.related-thumbnail {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-item:hover .related-thumbnail img {
    transform: scale(1.05);
}

/* 占位符样式 */
.related-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}

/* 相关文章网格布局占位符样式 */
.related-article-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}

.related-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.related-content {
    flex: 1;
}

.related-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.related-title a {
    color: #2c3e50;
    text-decoration: none;
}

.related-title a:hover {
    color: #667eea;
}

.related-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.related-meta {
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .single-ai-tutorial .container,
    .single-ai-project .container,
    .single-ai-news .container {
        padding: 0 10px;
    }

    .single-ai-tutorial .row,
    .single-ai-project .row,
    .single-ai-news .row {
        margin: 0 -10px;
    }

    .single-ai-tutorial .col-12,
    .single-ai-project .col-12,
    .single-ai-news .col-12 {
        padding: 0 10px;
    }

    .article-header {
        padding: 20px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    /* 相关文章响应式样式 */
    .related-projects,
    .related-articles {
        padding: 20px;
        margin-top: 20px;
    }
    
    .related-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .related-thumbnail {
        width: 100%;
        height: 120px;
        margin-bottom: 15px;
    }
    
    .related-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0 auto 10px;
    }
    
    .related-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .single-ai-tutorial .container,
    .single-ai-project .container,
    .single-ai-news .container {
        padding: 0 10px;
    }
    
    .article-header {
        padding: 15px;
    }
    
    .article-content {
        padding: 15px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    /* 相关文章小屏幕样式 */
    .related-projects,
    .related-articles {
        padding: 15px;
    }
    
    .related-item {
        padding: 12px;
    }
    
    .related-thumbnail {
        height: 100px;
    }
    
    .related-title {
        font-size: 16px;
    }
}

/* 确保ai-tutorials和ai-project页面样式完全一致 */
.page-template-page-ai-tutorials .related-projects,
.page-template-page-latest-ai-projects .related-projects {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 30px;
    width: 100%;
}

.page-template-page-ai-tutorials .related-item,
.page-template-page-latest-ai-projects .related-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.page-template-page-ai-tutorials .related-item:hover,
.page-template-page-latest-ai-projects .related-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.page-template-page-ai-tutorials .related-thumbnail,
.page-template-page-latest-ai-projects .related-thumbnail {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-template-page-ai-tutorials .related-thumbnail img,
.page-template-page-latest-ai-projects .related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.page-template-page-ai-tutorials .related-item:hover .related-thumbnail img,
.page-template-page-latest-ai-projects .related-item:hover .related-thumbnail img {
    transform: scale(1.05);
}

.page-template-page-ai-tutorials .related-placeholder,
.page-template-page-latest-ai-projects .related-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
} 