/* 文章展示页面主内容 */
.article-main-section {
    padding: 2rem 0;
}

.article-main-center {
    display: flex;
    justify-content: center; /* 水平居中 */
    width: 100%;
}

.article-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* 面包屑导航 */
.breadcrumb-nav {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    color: var(--medium-gray);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb-nav i {
    margin-right: 0.6rem;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav .separator {
    margin: 0 0.6rem;
    color: var(--medium-gray);
    font-weight: 300;
}

.breadcrumb-nav a,
.breadcrumb-nav a:visited {
    color: var(--medium-gray);
    text-decoration: none;
    font-weight: 400;
}

.breadcrumb-nav .current {
    color: var(--medium-gray);
    font-weight: 400;
}

.breadcrumb-nav .separator {
    color: var(--medium-gray);
    margin: 0 0.6rem;
}

.article-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.article-category {
    display: inline-block;
    background-color: var(--light-gray);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center; /* 新增：水平居中 */
    align-items: center;     /* 新增：垂直居中 */
    gap: 1.5rem;
    flex-wrap: wrap;
    /* border-top: 1px solid #f3f4f6; */
    width: 100%;             /* 新增：确保占满父容器宽度 */
    max-width: 800px;        /* 可选：限制最大宽度，避免过宽 */
    margin: 0 auto;          /* 新增：水平居中 */
    color: var(--medium-gray);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    align-items: center;
}

/* 文章图片/视频容器 */
.article-image {
    width: 100%;
    height: 400px;
    background-color: var(--light-gray);
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

/* 新增：视频居中容器 */
.video-wrapper-center {
    width: 100%;
    display: flex;
    justify-content: center; /* 水平居中 */
    margin-bottom: 2rem;     /* 和下面的简介保持距离 */
}

/* 处理视频播放器容器 */
.video-player-wrapper {
    width: 100%;            
    max-width: 800px;       /* 在手机端取消最大宽度限制，让其撑满容器 */
    margin: 20px auto;      
    aspect-ratio: 16/9;    /* 保持 16:9 的视频比例，防止变形 */
    background-color: #000; 
    border-radius: var(--border-radius); /* 保持与文章卡片一致的圆角 */
}

.video-js.vjs-big-play-centered {
    width: 100% !important;
    height: 100% !important;
    margin: 0 auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

.article-body h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 1.5rem 0 0.8rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0 1rem 2rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--medium-gray);
}

.article-body .mrg {
    margin: 3rem 0 1rem;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.article-tag {
    background-color: var(--light-gray);
    color: var(--medium-gray);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.article-tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* 侧边栏 */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.sidebar-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.related-articles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-article-item {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.related-article-item:last-child {
    border-bottom: none;
}

.related-article-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.related-article-title:hover {
    color: var(--primary-color);
}

.related-article-date {
    font-size: 0.8rem;
    color: var(--medium-gray);
}

.author-info {
    text-align: center;
}

.author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background-image: url('https://images.unsplash.com/photo-1559839734-2b71ea197ec2?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80');
    background-size: cover;
    background-position: center;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.author-title {
    color: var(--medium-gray);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--dark-color);
    line-height: 1.5;
}

/* ==========================================================================
   响应式设计：兼容手机端 (屏幕宽度小于 992px 时生效)
   ========================================================================== */
@media (max-width: 992px) {
    /* 1. 将网格布局改为单列，侧边栏移到文章底部 */
    .article-container {
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }

    /* 2. 减小内边距，让手机端有更多可视空间 */
    .article-content {
        padding: 1.5rem;
    }

    /* 3. 调整标题和图片/视频尺寸 */
    .article-title {
        font-size: 1.8rem; /* 缩小标题字号 */
    }
    
    .article-image {
        height: 250px; /* 降低图片/视频的高度 */
    }

    /* 4. 优化元信息行间距 */
    .article-meta {
        gap: 1rem;
    }

    /* 5. 侧边栏小屏幕适配 */
    .sidebar-widget {
        padding: 1rem;
    }

    /* 6. 调整面包屑导航字号 */
    .breadcrumb-nav {
        font-size: 0.85rem;
    }
}


/*处理视频*/
/* 视频播放器外层容器 */
.video-player-wrapper {
    width: 100%;            /* 宽度充满父元素 */
    max-width: 960px;       /* 限制最大宽度（可选，根据设计调整） */
    margin: 20px auto;      /* 上下间距 + 水平居中 */
    aspect-ratio: 16/9;     /* 视频宽高比（16:9，可根据视频比例修改） */
    background-color: #000; /* 视频加载前的背景色 */
    border-radius: 8px;     /* 圆角（可选，增强设计感） */
    overflow: hidden;       /* 隐藏溢出内容 */
}

/* 视频标签样式 */
.video-player-wrapper video {
    width: 100%;   /* 宽度充满容器 */
    height: 100%;  /* 高度充满容器（由 aspect-ratio 控制比例） */
    display: block;/* 消除底部默认空隙 */
    border-radius: inherit; /* 继承容器圆角 */
}

/* 响应式：小屏幕（手机）下调整 */
@media (max-width: 768px) {
    .video-player-wrapper {
        max-width: 100%;  /* 手机端宽度充满屏幕 */
        margin: 10px auto;/* 缩小上下间距 */
    }
}

.article-images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* 预览模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.modal-image.hidden {
    display: none;
}

.gallery-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: white;
}

.btn-prev, .btn-next {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-prev:hover, .btn-next:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-counter {
    font-size: 16px;
    font-weight: bold;
}

/* ======================================
   课程头部卡片（两列）
   ====================================== */
.course-header-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 左侧封面 */
.course-cover {
    flex: 0 0 40%;
    max-width: 420px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.course-img {
    width: 100%;
    /* max-height: 320px; */
    /* height: 100%; */
    object-fit: cover;
    border-radius: 10px;
}

/* 右侧信息区 */
.course-info {
    flex: 1;
    padding: 35px 40px;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 15px;
}

.course-meta {
    display: flex;
    gap: 20px;
    color: #718096;
    font-size: 0.95rem;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

/* ======================================
   ✅ 核心：Flex 信息列表（左右对齐）
   ====================================== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 每一行：标签 + 内容 */
.info-flex {
    display: flex;
    align-items: flex-start;   /* ✅ 多行内容顶部对齐 */
    gap: 16px;
}

/* 左侧标签 */
.info-label {
    flex-shrink: 0;
    width: 140px;              /* ✅ 固定宽度，保证冒号对齐 */
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a5568;
}

/* 右侧内容 */
.info-value {
    flex: 1;
    color: #2d3748;
    line-height: 1.8;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 报名按钮 */
.btn-enroll {
    width: fit-content;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    margin-top: auto;
}

/* ======================================
   响应式（移动端转单列）
   ====================================== */
@media (max-width: 992px) {
    .course-header-card {
        flex-direction: column;
    }

    .course-cover {
        max-width: 100%;
        border-bottom: 1px solid #eee;
    }

    .info-label {
        width: 110px;
    }
}

@media (max-width: 576px) {
    .course-info {
        padding: 25px 20px;
    }

    .info-flex {
        flex-direction: column;
        gap: 6px;
    }

    .info-label {
        width: 100%;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover{
    background-color: var(--primary-color);
    color: white;
}
.btn-info {
    background-color: var(--medium-gray);
    color: white;
}
.btn-info:hover{
    background-color: var(--medium-gray);
    color: white;
}