/* ============================================
 * 培训课程详情页 - 专用样式表
 * 文件路径: /css/detail.css
 * 最后更新: 2026-04-16
 * 
 * 说明: 本文件包含 detail-P1.html 页面的所有专属样式
 *       与全局 style.css 配合使用
 * ============================================ */

/* --------------------------------------------
 * 1. 全局锚点滚动偏移
 *    作用: 为所有锚点滚动预留空间，避开顶部固定导航栏
 *    数值: 桌面端130px，平板端110px，手机端95px
 * -------------------------------------------- */
html {
    scroll-padding-top: 130px;
}

/* --------------------------------------------
 * 2. 课程头部区域 (.course-hero)
 *    作用: 页面顶部介绍区域，包含标题和面包屑导航
 * -------------------------------------------- */
.course-hero {
    background: linear-gradient(135deg, #f5f0ff 0%, #ffffff 100%);
    padding: 2.5rem 0;
    border-bottom: 1px solid #e9e9f0;
    margin-bottom: 2rem;
}

.course-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e1e2f;
    margin-bottom: 0.5rem;
}

.course-hero .breadcrumb {
    color: #7c3aed;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #7c3aed;
    text-decoration: none;
}

/* --------------------------------------------
 * 3. 分类导航栏 (.category-nav)
 *    作用: 课程分类快速跳转菜单，sticky浮动在顶部
 *    特性: 桌面端换行，移动端横向滚动
 *    注意: z-index(98) 低于全局导航栏(1000)
 * -------------------------------------------- */
.category-nav {
    background: white;
    border-radius: 60px;
    padding: 0.8rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
    border: 1px solid #f0ecfe;
    position: sticky;
    top: 70px;
    z-index: 98;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.category-nav a {
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.category-nav a:hover {
    background: #7c3aed10;
    color: #7c3aed;
}

.category-nav a.active {
    background: #7c3aed;
    color: white;
}

/* --------------------------------------------
 * 4. 课程分类区块 (.category-section)
 *    作用: 每个课程大分类的容器，包含多个课程卡片
 *    scroll-margin-top: 锚点滚动时的预留空间
 * -------------------------------------------- */
.category-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 130px;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e1e2f;
    margin-bottom: 1.2rem;
    padding-left: 1rem;
    border-left: 4px solid #7c3aed;
}

/* --------------------------------------------
 * 5. 课程卡片 (.course-card)
 *    作用: 单个课程的信息展示卡片
 *    特性: hover时边框变色并轻微上浮阴影
 * -------------------------------------------- */
.course-card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    border: 1px solid #f0ecfe;
    transition: all 0.2s;
    scroll-margin-top: 130px;
}

.course-card:hover {
    border-color: #7c3aed40;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08);
}

.course-card h3 {
    font-size: 1.2rem;
    color: #1e1e2f;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.course-card h3 .duration {
    font-size: 0.75rem;
    background: #7c3aed10;
    color: #7c3aed;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: normal;
}

.course-card p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* --------------------------------------------
 * 6. 下载按钮 (.download-btn)
 *    作用: 课程大纲下载按钮样式
 * -------------------------------------------- */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #7c3aed;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid #7c3aed30;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* --------------------------------------------
 * 7. 返回顶部按钮 (.back-to-top)
 *    作用: 固定在右下角的返回顶部按钮
 *    特性: 滚动超过300px后渐显，初始隐藏
 * -------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 210px;
    right: 32px;
    background: #7c3aed;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.back-to-top.visible {
    opacity: 1;
}

/* --------------------------------------------
 * 8. 响应式布局调整
 *    断点: 992px(平板) / 768px(手机) / 600px(小屏手机)
 *    调整内容: 导航top值、滚动偏移、按钮尺寸、字体大小
 * -------------------------------------------- */

/* 平板设备 (≤992px) */
@media screen and (max-width: 992px) {
    html {
        scroll-padding-top: 110px;
    }
    
    .category-nav {
        top: 110px;
        padding: 0.6rem 1rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .category-nav a {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 横向滚动条样式 */
    .category-nav::-webkit-scrollbar {
        height: 3px;
    }
    .category-nav::-webkit-scrollbar-track {
        background: #f0ecfe;
        border-radius: 10px;
    }
    .category-nav::-webkit-scrollbar-thumb {
        background: #7c3aed60;
        border-radius: 10px;
    }
    
    .category-section {
        scroll-margin-top: 110px;
    }
    
    .course-card {
        scroll-margin-top: 110px;
    }
}

/* 手机设备 (≤768px) */
@media screen and (max-width: 768px) {
    html {
        scroll-padding-top: 100px;
    }
    
    .course-hero h1 {
        font-size: 1.5rem;
    }
    
    .category-nav {
        top: 130px;
    }
    
    .course-card {
        padding: 1.2rem;
    }
    
    .back-to-top {
        bottom: 210px;
        right: 32px;
        width: 44px;
        height: 44px;
    }
    
    .category-section {
        scroll-margin-top: 100px;
    }
    
    .course-card {
        scroll-margin-top: 100px;
    }
}

/* 小屏手机 (≤600px) */
@media screen and (max-width: 600px) {
    html {
        scroll-padding-top: 95px;
    }
    
    .category-nav {
        top: 130px;
        padding: 0.5rem 0.8rem;
        gap: 0.4rem;
    }
    
    .category-nav a {
        padding: 0.25rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .category-section {
        scroll-margin-top: 95px;
    }
    
    .course-card {
        scroll-margin-top: 95px;
    }
    
    .back-to-top {
        bottom: 180px;
        right: 22px;
        width: 44px;
        height: 44px;
    }
}






