/**
 * 文章详情页样式
 * 版本: 1.0
 */

/* 主容器样式 */
.article-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.article-detail {
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

/* 文章标题与元数据 */
.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.article-title {
    font-size: 28px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #909399;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
}

.article-meta i {
    margin-right: 5px;
}

/* 收藏按钮 */
.favorite-btn {
    cursor: pointer;
    background-color: #f5f7fa;
    color: #606266;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 14px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.favorite-btn i {
    margin-right: 5px;
}

.favorite-btn:hover {
    background-color: #ecf5ff;
    color: #409eff;
    border-color: #c6e2ff;
}

.favorite-btn.favorited {
    background-color: #f0f9eb;
    color: #67c23a;
    border-color: #e1f3d8;
}

/* 学习进度容器 - 仅学习中心分类且用户登录时显示 */
.learning-progress-container {
    background-color: #f5f7fa;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: block; /* 改为默认显示，通过父元素控制可见性 */
}

/* 确保在学习中心文章类型下，进度条正确显示 */
body:not(.post-type-learning_center) .learning-progress-container,
body:not(.logged-in) .learning-progress-container {
    display: none;
}

body.post-type-learning_center.logged-in .learning-progress-container {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin: 0;
}

#progress-percentage {
    font-size: 14px;
    font-weight: bold;
    color: #409eff;
}

.progress-bar-wrapper {
    background-color: #ebeef5;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

#learning-progress-bar {
    background-color: #409eff;
    height: 100%;
    width: 0%;
    transition: width 0.2s linear;
}

.completed-badge {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #f0f9eb;
    border-radius: 4px;
    color: #67c23a;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.completed-badge i {
    margin-right: 5px;
}

.completed-badge.show {
    opacity: 1;
    transform: translateY(0);
}

/* 学习完成摘要 */
#learning-summary {
    background-color: #ecf8ff;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #409eff;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

#learning-summary.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

#learning-summary h3 {
    margin-top: 0;
    color: #409eff;
    margin-bottom: 10px;
    font-size: 18px;
}

#learning-summary p {
    margin-bottom: 15px;
}

.summary-actions {
    display: flex;
    gap: 10px;
}

.summary-actions .btn {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    transition: all 0.3s;
}

.summary-actions .btn i {
    margin-right: 5px;
}

.summary-actions .btn-primary {
    background-color: #409eff;
    color: white;
    border: 1px solid #409eff;
}

.summary-actions .btn-primary:hover {
    background-color: #66b1ff;
    border-color: #66b1ff;
}

.summary-actions .btn-secondary {
    background-color: #f4f4f5;
    color: #606266;
    border: 1px solid #dcdfe6;
}

.summary-actions .btn-secondary:hover {
    background-color: #e9e9eb;
}

/* 文章内容 */
.content-body {
    font-size: 16px;
    line-height: 1.8;
    color: #303133;
    margin-bottom: 30px;
}

.content-body p {
    margin-bottom: 20px;
}

.content-body h2, 
.content-body h3, 
.content-body h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #303133;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.content-body ul, 
.content-body ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.content-body blockquote {
    border-left: 4px solid #409eff;
    padding: 10px 15px;
    margin: 20px 0;
    background-color: #ecf5ff;
    color: #606266;
}

/* 文章页底部信息 */
.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #606266;
    font-size: 14px;
}

.article-categories,
.article-tags {
    margin-bottom: 10px;
}

.article-categories a,
.article-tags a {
    color: #409eff;
    text-decoration: none;
    margin-right: 5px;
}

.article-categories a:hover,
.article-tags a:hover {
    text-decoration: underline;
}

/* 文章导航 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-previous,
.nav-next {
    max-width: 48%;
}

.article-navigation a {
    text-decoration: none;
    color: #409eff;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #ecf5ff;
    display: inline-block;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-navigation a:hover {
    background-color: #409eff;
    color: #fff;
}

/* 相关文章 */
.related-articles {
    margin-top: 40px;
    padding: 30px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.related-title {
    font-size: 22px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: #303133;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.related-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-item:hover {
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.related-link {
    text-decoration: none;
    display: flex;
    color: inherit;
}

.related-thumb {
    width: 100px;
    height: 70px;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 10px 15px;
    flex: 1;
}

.related-item-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #303133;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-date {
    font-size: 12px;
    color: #909399;
}

/* 图片画廊和视频 */
.image-gallery,
.video-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

.image-gallery h3,
.video-container h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #303133;
}

.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.image-card {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
}

.image-info {
    padding: 10px;
    background-color: #f5f7fa;
    font-size: 14px;
    color: #606266;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}

.video-wrapper video,
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 评论区域 */
.article-comments-section {
    margin-top: 40px;
    padding: 30px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

/* 消息提示容器 */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: 300px;
}

.message {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: translateX(0);
}

.message i {
    margin-right: 10px;
    font-size: 18px;
}

.message-success {
    background-color: #f0f9eb;
    color: #67c23a;
    border-left: 3px solid #67c23a;
}

.message-info {
    background-color: #ecf5ff;
    color: #409eff;
    border-left: 3px solid #409eff;
}

.message-warning {
    background-color: #fdf6ec;
    color: #e6a23c;
    border-left: 3px solid #e6a23c;
}

.message-error {
    background-color: #fef0f0;
    color: #f56c6c;
    border-left: 3px solid #f56c6c;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .article-detail {
        padding: 20px 15px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .related-list {
        grid-template-columns: 1fr;
    }
    
    .image-gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .article-navigation a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .message-container {
        width: calc(100% - 40px);
    }
} 