/* ============================================================
   课程详情页样式（course / content_edu 共用 single-content_edu.php）
   v2 — Tab 导航 + 考证推荐 + 亮点/目标列表 + 全面移动端适配
   ============================================================ */

.course-detail {
    max-width: 1040px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    padding-bottom: 28px;
    border: 1px solid #eceef3;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
}

/* ---------- 头部 ---------- */
.course-header {
    position: relative;
    padding: 40px 28px 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #3b82f6 100%);
    color: #fff;
    border-radius: 0 0 24px 24px;
}
.course-header .back {
    display: inline-block;
    margin-bottom: 16px;
    padding: 6px 14px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s;
}
.course-header .back:hover { background: rgba(255, 255, 255, 0.32); }
.course-header .title {
    margin: 0 0 14px;
    font-size: 1.9rem;
    line-height: 1.35;
    font-weight: 800;
    color: #fff;
}
.course-header .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
}
.course-header .meta-item { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 信息条：4 列网格，上移覆盖头部 ---------- */
.course-info-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: -28px 20px 22px;
    padding: 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}
.course-info-bar .item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: #f7f8fc;
}
.course-info-bar .value { font-size: 1.25rem; font-weight: 800; color: #4f46e5; }
.course-info-bar .value small { font-size: 12px; font-weight: 500; color: #6b7280; margin-left: 2px; }
.course-info-bar .label { margin-top: 4px; font-size: 12px; color: #888; }

/* 价格区原价删除线 */
.price-val { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.price-now { font-size: 1.4rem; font-weight: 800; color: #e11d48; }
.price-free { font-size: 1.4rem; font-weight: 800; color: #10b981; }
.price-orig { font-size: 13px; font-weight: 400; color: #9ca3af; text-decoration: line-through; margin-top: 2px; }

/* ---------- Tab 导航（sticky） ---------- */
.course-tabs {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid #f0f1f5;
    margin: 0 20px 0;
    border-radius: 12px 12px 0 0;
}
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 6px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    flex: 0 0 auto;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.tab-btn:hover { color: #4f46e5; background: #eef2ff; }
.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ---------- Tab 面板 ---------- */
.tab-panel { display: none; animation: fadeTab .25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeTab { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 内容区 ---------- */
.course-content { padding: 16px 20px 0; }
.course-section {
    padding: 20px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}
.course-section h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    padding-left: 12px;
    border-left: 4px solid #4f46e5;
}
.course-section .desc { font-size: 15px; line-height: 1.8; color: #374151; word-break: break-word; max-width: 820px; }
.course-section .desc p { margin: 0 0 12px; }
.course-section .desc img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 14px auto; }
.course-section .desc h1,
.course-section .desc h2,
.course-section .desc h3,
.course-section .desc h4 { margin: 18px 0 10px; color: #111827; }

/* 富文本兜底 */
.course-section .desc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.course-section .desc th, .course-section .desc td { border: 1px solid #e5e7eb; padding: 10px 12px; text-align: left; vertical-align: top; }
.course-section .desc th { background: #f9fafb; font-weight: 700; color: #111827; }
.course-section .desc tr:nth-child(even) td { background: #fafbfc; }
.course-section .desc ul, .course-section .desc ol { margin: 12px 0; padding-left: 24px; }
.course-section .desc li { margin: 6px 0; }
.course-section .desc strong { color: #111827; font-weight: 700; }
.course-section .desc code { display: inline-block; padding: 2px 6px; background: #f3f4f6; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; color: #dc2626; }
.course-section .desc pre { background: #1f2937; color: #f3f4f6; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.course-section .desc pre code { background: transparent; color: inherit; padding: 0; }

/* ---------- 亮点/目标列表 ---------- */
.feature-list { display: flex; flex-direction: column; gap: 10px; }
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde68a;
    border-radius: 12px;
    transition: transform .15s;
}
.feature-item:hover { transform: translateX(4px); }
.feature-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #d97706;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}
.feature-text { font-size: 14px; line-height: 1.6; color: #422006; font-weight: 500; }

/* 学习目标列表（绿色调） */
.outcome-list .feature-item {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}
.outcome-list .feature-icon { color: #059669; box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2); }
.outcome-list .feature-icon.check { font-size: 13px; }
.outcome-list .feature-text { color: #064e3b; }

/* ---------- 先修要求 ---------- */
.prereq-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 14px;
    color: #9a3412;
    line-height: 1.6;
}
.prereq-icon { flex: 0 0 auto; font-size: 18px; }

/* ---------- 分类标签 ---------- */
.category-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.category-tag {
    font-size: 12px;
    padding: 5px 14px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 999px;
    font-weight: 500;
}

/* ---------- Meta Strip（语言/机构） ---------- */
.course-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 20px;
    background: #f8fafc;
    border-radius: 12px;
}
.meta-strip-item { font-size: 13px; color: #475569; }

/* ---------- 讲师卡 ---------- */
.teacher-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 16px;
}
.teacher-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    overflow: hidden;
}
.teacher-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.teacher-info { flex: 1; min-width: 0; }
.teacher-name { font-size: 17px; font-weight: 700; color: #1f2937; }
.teacher-title { margin-top: 4px; font-size: 13px; color: #6b7280; line-height: 1.5; }
.teacher-stats { margin-top: 8px; display: flex; gap: 12px; }
.teacher-stat-item { font-size: 12px; color: #4f46e5; font-weight: 600; }

/* ---------- 章节列表 ---------- */
.chapter-list, .outline-text-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    cursor: pointer;
}
.chapter-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
    border-color: #c7d2fe;
}
.chapter-num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-radius: 50%;
}
.chapter-title {
    flex: 1;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}
.chapter-dur {
    font-size: 12px;
    color: #9ca3af;
    flex: 0 0 auto;
    background: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
}

/* ---------- 考证推荐 ---------- */
/* 本课证书 badge */
.course-cert-own {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 14px;
}
.cert-own-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.cert-own-label { font-size: 12px; color: #3b82f6; font-weight: 600; }
.cert-own-name { font-size: 16px; font-weight: 700; color: #1e40af; margin-top: 2px; }

/* 考证卡片网格 */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.cert-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
}
.cert-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-bottom: 1px solid #e9d5ff;
}
.cert-card-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}
.cert-card-name { font-size: 15px; font-weight: 700; color: #5b21b6; line-height: 1.4; }
.cert-card-body { padding: 14px 16px; flex: 1; }
.cert-card-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.cert-label { color: #6b7280; font-weight: 500; flex: 0 0 auto; }
.cert-val { color: #374151; font-weight: 500; }
.cert-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
}
.cert-card-desc { font-size: 13px; line-height: 1.6; color: #6b7280; margin: 8px 0 0; }
.cert-card-link {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    background: #f5f3ff;
    border-top: 1px solid #e9d5ff;
    text-decoration: none;
    transition: background .2s;
}
.cert-card-link:hover { background: #ede9fe; }

/* ---------- 底部操作栏 ---------- */
.course-buy {
    position: relative;
    margin: 24px 20px 0;
    width: auto;
    max-width: 1000px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #eceef3;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(17, 24, 39, 0.06);
}
.course-buy .btn { flex: 0 0 auto; }
.course-price { font-size: 1.25rem; font-weight: 800; color: #4f46e5; }

/* ---------- 按钮 ---------- */
.course-detail .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background .2s, transform .1s;
    white-space: nowrap;
}
.course-detail .btn:active { transform: scale(0.98); }
.course-detail .btn-primary { background: #4f46e5; color: #fff; }
.course-detail .btn-primary:hover { background: #4338ca; }
.course-detail .btn-outline { background: #fff; color: #4f46e5; border-color: #c7d2fe; }
.course-detail .btn-outline:hover { background: #eef2ff; }

/* ---------- 关联招生计划兜底 ---------- */
.course-section .bg-gradient-to-br { background-image: linear-gradient(to bottom right, #eff6ff, #eef2ff); }
.course-section .from-blue-50 { --tw-gradient-from: #eff6ff; }
.course-section .to-indigo-50 { --tw-gradient-to: #eef2ff; }

/* ---------- 相关推荐 ---------- */
.related-content-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}
.related-content-wrap h3 { text-align: center; }

/* ============================================================
   移动端适配（<= 768px）
   ============================================================ */
@media (max-width: 768px) {
    .course-detail {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
        padding-bottom: 84px;
    }

    .course-header {
        padding: 28px 16px 28px;
        border-radius: 0 0 20px 20px;
    }
    .course-header .back { margin-bottom: 12px; padding: 5px 12px; font-size: 12px; }
    .course-header .title { margin-bottom: 12px; font-size: 1.35rem; line-height: 1.4; }
    .course-header .meta { gap: 8px 12px; font-size: 12px; }

    .course-info-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: -22px 12px 16px;
        padding: 12px;
        border-radius: 14px;
    }
    .course-info-bar .item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 14px;
        border-radius: 10px;
        text-align: left;
    }
    .course-info-bar .value { font-size: 15px; line-height: 1.3; white-space: nowrap; }
    .course-info-bar .value small { font-size: 11px; }
    .course-info-bar .label { margin-top: 0; font-size: 11px; color: #9ca3af; white-space: nowrap; }
    .price-now, .price-free { font-size: 1.1rem; }
    .price-orig { font-size: 11px; }

    /* Tab 导航：横滑 */
    .course-tabs {
        margin: 0 12px 0;
        border-radius: 12px 12px 0 0;
    }
    .tab-btn { padding: 8px 14px; font-size: 13px; }

    .course-content { padding: 12px 12px 0; }
    .course-section { padding: 14px; margin-bottom: 12px; border-radius: 14px; }
    .course-section h3 { margin-bottom: 10px; font-size: 15px; padding-left: 10px; border-left-width: 3px; }
    .course-section .desc { font-size: 14px; line-height: 1.75; }
    .course-section .desc table { font-size: 13px; }
    .course-section .desc th, .course-section .desc td { padding: 8px 10px; }

    /* 亮点/目标 */
    .feature-item { padding: 10px 12px; gap: 8px; }
    .feature-icon { flex: 0 0 22px; width: 22px; height: 22px; font-size: 12px; }
    .feature-text { font-size: 13px; }

    /* 先修要求 */
    .prereq-box { padding: 12px 14px; font-size: 13px; }
    .prereq-icon { font-size: 16px; }

    /* 讲师卡 */
    .teacher-card { gap: 12px; padding: 14px; }
    .teacher-avatar { width: 52px; height: 52px; flex: 0 0 52px; font-size: 24px; }
    .teacher-name { font-size: 15px; }
    .teacher-title { font-size: 12px; }

    /* 章节列表 */
    .chapter-item { padding: 12px 14px; gap: 10px; }
    .chapter-num { flex: 0 0 28px; width: 28px; height: 28px; font-size: 12px; }
    .chapter-title { font-size: 13px; }
    .chapter-dur { font-size: 11px; padding: 2px 8px; }

    /* 考证推荐 */
    .course-cert-own { padding: 12px 14px; gap: 10px; }
    .cert-own-icon { flex: 0 0 40px; width: 40px; height: 40px; font-size: 20px; }
    .cert-own-name { font-size: 14px; }
    .cert-grid { grid-template-columns: 1fr; gap: 12px; }
    .cert-card-top { padding: 12px 14px; gap: 10px; }
    .cert-card-icon { flex: 0 0 36px; width: 36px; height: 36px; font-size: 18px; }
    .cert-card-name { font-size: 14px; }
    .cert-card-body { padding: 12px 14px; }
    .cert-card-row { font-size: 12px; }
    .cert-card-desc { font-size: 12px; }
    .cert-card-link { padding: 8px 14px; font-size: 13px; }

    /* Meta strip */
    .course-meta-strip { padding: 10px 14px; gap: 10px; }
    .meta-strip-item { font-size: 12px; }

    /* 底部操作栏：吸底 */
    .course-buy {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
        width: 100%;
        max-width: 760px;
        margin: 0;
        padding: 10px 12px;
        gap: 10px;
        border-radius: 14px 14px 0 0;
        border: 0;
        border-top: 1px solid #eceef3;
        border-left: 1px solid #eceef3;
        border-right: 1px solid #eceef3;
        box-shadow: 0 -6px 24px rgba(17, 24, 39, 0.08);
        z-index: 99998;
    }
    .course-detail .btn { padding: 11px 16px; font-size: 14px; border-radius: 10px; flex: 1 1 auto; min-width: 0; }
    .course-detail .btn-outline { flex: 0 0 auto; }
    .course-price { font-size: 1rem; }

    .related-content-wrap { padding-left: 12px; padding-right: 12px; }
}

/* 超小屏（<= 380px）额外收紧 */
@media (max-width: 380px) {
    .course-header .title { font-size: 1.15rem; }
    .course-info-bar { grid-template-columns: 1fr; gap: 6px; margin: -18px 8px 14px; padding: 8px; }
    .course-info-bar .item { padding: 8px 12px; }
    .course-info-bar .value { font-size: 14px; }
    .cert-card-top { padding: 10px 12px; }
}
