/* ==============================================
 * Yooox Course Player — Course Home Page
 * /course/{id}/
 * ============================================== */

:root {
    --ycp-bg:          #1c1d1f;
    --ycp-surface:     #2d2f31;
    --ycp-surface2:    #3d3f41;
    --ycp-border:      #3d3d3d;
    --ycp-text:        #d1d7dc;
    --ycp-text-muted:  #9e9ea9;
    --ycp-text-bright: #ffffff;
    --ycp-primary:     #a435f0;
    --ycp-primary-h:   #8710d8;
    --ycp-success:     #1ea97c;
    --ycp-warning:     #f69c08;
    --ycp-hero-bg:     #1c1d1f;
    --ycp-card-w:      320px;
}

*, *::before, *::after { box-sizing: border-box; }

/* ———————————————————————————
 * COURSE HALL SHORTCODE
 * [yooox_courses]
 * ——————————————————————————— */
.ycp-course-hall {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 20px 56px;
    color: #1d2327;
}

.ycp-course-page-intro {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 0;
    color: #1d2327;
}

.ycp-course-hall-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.ycp-course-hall-kicker {
    margin: 0 0 6px;
    color: #2271b1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.ycp-course-hall-head h2 {
    margin: 0;
    color: #1d2327;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 800;
}

.ycp-course-hall-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(360px, 100%);
}

.ycp-course-hall-search input[type="search"] {
    width: 100%;
    height: 40px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
}

.ycp-course-hall-search button,
.ycp-course-tile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: 0;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ycp-course-hall-search button:hover,
.ycp-course-tile-link:hover {
    background: #135e96;
    color: #fff;
}

.ycp-course-hall-filters {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0 28px;
    background: #f8f9fa;
    border: 1px solid #e7e8ea;
    border-radius: 12px;
    overflow: hidden;
}

.ycp-course-filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid #dcdcde;
    border-radius: 16px;
    color: #50575e;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.ycp-course-filter-chip:hover,
.ycp-course-filter-chip.is-active {
    border-color: #2271b1;
    background: #eef4ff;
    color: #135e96;
}

.ycp-course-filter-chip-legacy {
    background: #fffaf0;
}

/* ── 分组行 ── */
.ycp-filter-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 16px;
    min-height: 52px;
}
.ycp-filter-row + .ycp-filter-row {
    border-top: 1px solid #e7e8ea;
}
.ycp-filter-row-label {
    flex-shrink: 0;
    width: 36px;
    font-size: 12px;
    font-weight: 700;
    color: #9ea3ae;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-right: 12px;
}
.ycp-filter-row-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── 方向行 chip ── */
.ycp-filter-primary {
    border-color: #e2e8f0;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.ycp-filter-primary:hover {
    border-color: #2271b1;
    background: #eef4ff;
    color: #135e96;
}
.ycp-filter-primary.is-active {
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
}

/* "全部" chip */
.ycp-filter-all {
    border-color: #e2e8f0;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.ycp-filter-all:hover {
    border-color: #2271b1;
    background: #eef4ff;
    color: #135e96;
}
.ycp-filter-all.is-active {
    border-color: #2271b1;
    background: #2271b1;
    color: #fff;
}

/* ── 类型行 chip ── */
.ycp-filter-row-secondary {
    background: #fff;
}
.ycp-filter-secondary {
    border-color: #e2e8f0;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    transition: all .15s;
}
.ycp-filter-secondary:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #5b21b6;
}
.ycp-filter-secondary.is-active {
    border-color: #7c3aed;
    background: #7c3aed;
    color: #fff;
}

.ycp-course-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin: 26px 0 14px;
    padding-top: 4px;
}

.ycp-course-section-head h3 {
    margin: 0;
    color: #1d2327;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 800;
}

.ycp-course-section-head p {
    margin: 0;
    color: #646970;
    font-size: 13px;
}

.ycp-course-section-head-legacy {
    margin-top: 38px;
    border-top: 1px solid #e7e8ea;
    padding-top: 24px;
}

.ycp-course-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.ycp-course-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0,0,0,.06);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ycp-course-tile:hover {
    border-color: #c3d7ec;
    box-shadow: 0 12px 28px rgba(0,0,0,.09);
    transform: translateY(-2px);
}

.ycp-course-tile-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: #fff;
    color: #2271b1;
    overflow: hidden;
    text-decoration: none;
}

.ycp-course-tile-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #fff;
    transition: transform .2s ease;
}

.ycp-course-tile:hover .ycp-course-tile-cover img {
    transform: none;
}

.ycp-course-tile-cover .dashicons {
    width: 42px;
    height: 42px;
    font-size: 42px;
}

.ycp-course-tile-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.ycp-course-tile-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 23px;
    margin-bottom: 8px;
}

.ycp-course-tile-cats span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: 11px;
    background: #f0f6fc;
    color: #135e96;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}

.ycp-course-tile-cats .ycp-course-source-badge {
    color: #fff;
    background: #2271b1;
}

.ycp-course-tile-cats .ycp-course-source-article {
    background: #8a5700;
}

.ycp-course-tile h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 800;
}

.ycp-course-tile h3 a {
    color: #1d2327;
    text-decoration: none;
}

.ycp-course-tile h3 a:hover {
    color: #2271b1;
}

.ycp-course-tile p {
    margin: 0 0 14px;
    color: #646970;
    font-size: 14px;
    line-height: 1.65;
}

.ycp-course-tile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 14px;
    color: #646970;
    font-size: 13px;
}

.ycp-course-tile-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f6f7f7;
}

.ycp-course-tile-link {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    border-radius: 6px;
}

.ycp-course-tile-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.ycp-course-tile-actions .ycp-course-tile-link {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}

.ycp-course-tile-link-intro {
    background: #fff;
    color: #2271b1;
    border: 1px solid #2271b1;
    box-shadow: inset 0 0 0 1px rgba(34,113,177,.02);
}

.ycp-course-tile-link-intro:hover {
    background: #eef4ff;
    color: #135e96;
}

.ycp-course-tile-link-legacy {
    background: #50575e;
}

.ycp-course-tile-link-legacy:hover {
    background: #3c434a;
}

.ycp-course-hall-empty {
    border: 1px dashed #c3c4c7;
    border-radius: 8px;
    padding: 32px 20px;
    color: #646970;
    text-align: center;
    background: #fff;
}

@media (max-width: 980px) {
    .ycp-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ycp-course-hall-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 640px) {
    .ycp-course-hall { padding: 24px 14px 40px; }
    .ycp-course-hall-head h2 { font-size: 24px; }
    .ycp-course-hall-search { flex-direction: column; align-items: stretch; }
    .ycp-course-section-head { display: block; }
    .ycp-course-section-head p { margin-top: 5px; }
    .ycp-course-grid { grid-template-columns: 1fr; }
}

.ycp-course-body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    background: var(--ycp-bg);
    color: var(--ycp-text);
    -webkit-font-smoothing: antialiased;
}

/* ———————————————————————————
 * BACK BAR (全局导航条)
 * ——————————————————————————— */
.ycp-course-back-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: 48px;
    background: #000;
    border-bottom: 1px solid var(--ycp-border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 20px;
}
.ycp-back-link {
    display: flex; align-items: center; gap: 6px;
    color: var(--ycp-text); text-decoration: none; font-size: 13px; font-weight: 600;
    flex-shrink: 0;
    transition: color .15s;
}
.ycp-back-link:hover { color: var(--ycp-text-bright); }
.ycp-back-link svg { width: 18px; height: 18px; fill: currentColor; }
.ycp-course-back-title {
    font-size: 13px; color: var(--ycp-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ycp-course-mobile-login {
    display: none;
    margin-left: auto;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    color: var(--ycp-text);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255,255,255,.08);
}
.ycp-course-mobile-login:hover,
.ycp-course-mobile-login:active { color: #fff; background: rgba(255,255,255,.14); }

/* ———————————————————————————
 * HERO SECTION
 * ——————————————————————————— */
.ycp-course-hero {
    background: var(--ycp-hero-bg);
    padding-top: 48px; /* back bar height */
    border-bottom: 1px solid var(--ycp-border);
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 40px;
    padding-left: 24px; padding-right: 24px;
    padding-bottom: 40px;
    padding-top: calc(48px + 32px);
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

.ycp-course-hero-inner {
    flex: 1; min-width: 0;
    max-width: calc(100% - var(--ycp-card-w) - 60px);
}

.ycp-course-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ycp-text-muted); margin-bottom: 14px;
    flex-wrap: wrap;
}
.ycp-course-breadcrumb a { color: var(--ycp-text-muted); text-decoration: none; }
.ycp-course-breadcrumb a:hover { color: var(--ycp-text-bright); text-decoration: underline; }
.ycp-bc-sep { opacity: .5; }
.ycp-bc-current { color: var(--ycp-text); }

.ycp-course-title {
    font-size: 32px; font-weight: 800; line-height: 1.25;
    color: var(--ycp-text-bright); margin: 0 0 14px;
}
@media (max-width: 768px) { .ycp-course-title { font-size: 24px; } }

.ycp-course-subtitle {
    font-size: 16px; line-height: 1.65; color: var(--ycp-text);
    margin: 0 0 20px; max-width: 720px;
    display: -webkit-box; line-clamp: 3; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.ycp-course-meta-row {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px;
}
.ycp-meta-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--ycp-surface); border: 1px solid var(--ycp-border);
    color: var(--ycp-text-muted); font-size: 12px; font-weight: 600;
    padding: 5px 12px; border-radius: 20px;
}
.ycp-meta-chip svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }
.ycp-course-status-published { background: rgba(30,169,124,.12); border-color: var(--ycp-success); color: var(--ycp-success); }
.ycp-course-status-archived   { background: rgba(246,156,8,.1); border-color: var(--ycp-warning); color: var(--ycp-warning); }

/* Cover image (hero) - right side */
.ycp-course-cover {
    flex-shrink: 0; width: 320px;
    border-radius: 6px; overflow: hidden; cursor: pointer;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    display: none;
}
.ycp-course-cover img {
    width: 100%; display: block; aspect-ratio: 16/9;
    object-fit: contain; background: #f5f5f5;
}
.ycp-cover-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
}
.ycp-course-cover:hover .ycp-cover-overlay { opacity: 1; }
.ycp-cover-play {
    width: 60px; height: 60px; border-radius: 50%; background: rgba(164,53,240,.9);
    display: flex; align-items: center; justify-content: center;
}
.ycp-cover-play svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }

/* ———————————————————————————
 * ENROLLED BOX (已购学员)
 * ——————————————————————————— */
.ycp-enrolled-box {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.ycp-enrolled-progress { display: flex; flex-direction: column; gap: 6px; }
.ycp-ep-track { width: min(220px, 100%); height: 6px; background: var(--ycp-surface2); border-radius: 3px; overflow: hidden; }
.ycp-ep-fill  { height: 100%; background: var(--ycp-primary); border-radius: 3px; transition: width .5s; }
.ycp-ep-text  { font-size: 13px; color: var(--ycp-text-muted); }

/* ———————————————————————————
 * BUTTONS
 * ——————————————————————————— */
.ycp-btn-start {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ycp-primary); color: #fff; border: none;
    padding: 13px 28px; border-radius: 4px;
    font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.ycp-btn-start:hover { background: var(--ycp-primary-h); color: #fff; }
.ycp-btn-start svg   { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.ycp-btn-secondary {
    background: transparent;
    color: var(--ycp-text-bright);
    border: 1px solid var(--ycp-border);
}
.ycp-btn-secondary:hover {
    background: var(--ycp-surface2);
    color: var(--ycp-text-bright);
}

.ycp-cta-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ———————————————————————————
 * MAIN LAYOUT (content + sidebar)
 * ——————————————————————————— */
.ycp-course-main {
    max-width: 1280px; margin: 0 auto;
    display: flex; gap: 40px;
    padding: 40px 24px 80px;
    align-items: flex-start;
}

.ycp-course-content { flex: 1; min-width: 0; }

/* ———————————————————————————
 * SECTIONS
 * ——————————————————————————— */
.ycp-section { margin-bottom: 48px; }
.ycp-section-title {
    font-size: 20px; font-weight: 800; color: var(--ycp-text-bright);
    margin: 0 0 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--ycp-border);
}

.ycp-outline-summary {
    font-size: 14px; color: var(--ycp-text-muted); margin: 0 0 16px;
}

/* Chapter / lesson accordion */
.ycp-outline-list { border: 1px solid var(--ycp-border); border-radius: 6px; overflow: hidden; }

.ycp-ol-chapter { border-bottom: 1px solid var(--ycp-border); }
.ycp-ol-chapter:last-child { border-bottom: none; }

.ycp-ol-chapter-hdr {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--ycp-surface); border: none;
    cursor: pointer; text-align: left; gap: 12px; transition: background .15s;
}
.ycp-ol-chapter-hdr:hover { background: var(--ycp-surface2); }
.ycp-ol-chapter-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ycp-ch-chevron { flex-shrink: 0; color: var(--ycp-text-muted); transition: transform .2s; }
.ycp-ch-chevron svg { width: 16px; height: 16px; fill: currentColor; }
.ycp-ol-chapter.open .ycp-ch-chevron { transform: rotate(180deg); }
.ycp-ch-name { font-size: 14px; font-weight: 700; color: var(--ycp-text-bright); }
.ycp-ch-meta { font-size: 12px; color: var(--ycp-text-muted); white-space: nowrap; flex-shrink: 0; }

.ycp-ol-lessons { list-style: none; margin: 0; padding: 0; display: none; }
.ycp-ol-chapter.open .ycp-ol-lessons { display: block; }

.ycp-ol-lesson {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 18px 11px 24px;
    border-top: 1px solid var(--ycp-border);
    transition: background .12s;
}
.ycp-ol-lesson:hover { background: rgba(255,255,255,.03); }
.ycp-ol-lesson.completed { background: rgba(30,169,124,.04); }

.ycp-ol-lesson-check {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.ycp-ol-lesson-check svg { width: 16px; height: 16px; fill: var(--ycp-text-muted); }
.ycp-ol-lesson.completed .ycp-ol-lesson-check svg { fill: var(--ycp-success); }

.ycp-ol-lesson-body { flex: 1; min-width: 0; }
.ycp-ol-lesson-title {
    font-size: 14px; color: var(--ycp-text); line-height: 1.4;
    display: block; text-decoration: none;
}
.ycp-ol-lesson-title:hover { color: var(--ycp-text-bright); text-decoration: underline; }
.ycp-ol-lesson-title.locked { color: var(--ycp-text-muted); cursor: default; }

.ycp-ol-lesson-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ycp-tag-free {
    font-size: 11px; font-weight: 700;
    background: rgba(14,165,233,.15); color: #38bdf8;
    padding: 2px 7px; border-radius: 3px;
}
.ycp-ol-dur { font-size: 12px; color: var(--ycp-text-muted); }

/* ———————————————————————————
 * DESCRIPTION
 * ——————————————————————————— */
.ycp-desc-body {
    font-size: 15px; line-height: 1.8; color: var(--ycp-text);
    max-width: 800px;
}
.ycp-desc-body h1,.ycp-desc-body h2,.ycp-desc-body h3 {
    color: var(--ycp-text-bright); margin-top: 1.4em; font-weight: 700;
}
.ycp-desc-body p   { margin: 0 0 1em; }
.ycp-desc-body ul  { padding-left: 1.4em; margin: 0 0 1em; }
.ycp-desc-body li  { margin-bottom: .4em; }
.ycp-desc-body a   { color: var(--ycp-primary); }

/* ———————————————————————————
 * STICKY CARD (RIGHT SIDEBAR)
 * ——————————————————————————— */
.ycp-course-card {
    width: var(--ycp-card-w);
    min-width: var(--ycp-card-w);
    position: sticky; top: 60px;
    background: var(--ycp-surface);
    border: 1px solid var(--ycp-border);
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    margin-top: -160px; /* overlap hero */
    flex-shrink: 0;
}
@media (max-width: 1024px) { .ycp-course-card { display: none; } }

.ycp-card-cover { position: relative; line-height: 0; aspect-ratio: 16/9; overflow: hidden; background: #f5f5f5; }
.ycp-card-cover img { width: 100%; height: 100%; display: block; object-fit: contain; }
.ycp-card-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.3);
}
.ycp-card-play-btn {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(164,53,240,.9);
    display: flex; align-items: center; justify-content: center;
}
.ycp-card-play-btn svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }

.ycp-card-body { padding: 22px 20px; }

.ycp-card-stats { margin-bottom: 20px; }
.ycp-card-stat {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--ycp-border);
    font-size: 13px; color: var(--ycp-text);
}
.ycp-card-stat:last-child { border-bottom: none; }
.ycp-card-stat svg { width: 16px; height: 16px; fill: var(--ycp-text-muted); flex-shrink: 0; }

.ycp-card-free-badge {
    font-size: 28px; font-weight: 800; color: var(--ycp-text-bright);
    margin-bottom: 14px;
}

.ycp-card-btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    background: var(--ycp-primary); color: #fff; border: none;
    padding: 13px 20px; border-radius: 4px;
    font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s; margin-bottom: 12px; text-align: center;
}
.ycp-card-btn-primary:hover { background: var(--ycp-primary-h); color: #fff; }
.ycp-card-btn-primary svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.ycp-card-btn-secondary {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    background: transparent; color: var(--ycp-text-bright);
    border: 1px solid var(--ycp-border);
    padding: 12px 20px; border-radius: 4px;
    font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s;
    margin-bottom: 12px; text-align: center;
}
.ycp-card-btn-secondary:hover {
    background: var(--ycp-surface2);
    border-color: var(--ycp-text-muted);
    color: var(--ycp-text-bright);
}

.ycp-card-tip { font-size: 12px; color: var(--ycp-text-muted); text-align: center; margin: 0; }

.ycp-card-progress-bar {
    height: 5px; background: var(--ycp-surface2); border-radius: 3px;
    margin-bottom: 6px; overflow: hidden;
}
.ycp-card-progress-fill { height: 100%; background: var(--ycp-primary); border-radius: 3px; transition: width .5s; }
.ycp-card-progress-text { font-size: 12px; color: var(--ycp-text-muted); margin: 0 0 14px; }

/* Enroll feedback */
.ycp-enroll-ok  { color: var(--ycp-success); font-size: 13px; font-weight: 600; margin-top: 8px; text-align: center; }
.ycp-enroll-err { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }

/* ———————————————————————————
 * MOBILE CTA BAR (tablet & phone)
 * ——————————————————————————— */
.ycp-mobile-cta-bar {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--ycp-surface);
    border-top: 1px solid var(--ycp-border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.55);
}
.ycp-mobile-cta-actions {
    display: grid;
    grid-template-columns: minmax(108px, .42fr) minmax(0, 1fr);
    gap: 10px;
}
.ycp-mobile-cta-actions .ycp-mobile-cta-btn:only-child {
    grid-column: 1 / -1;
}
.ycp-mobile-cta-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 48px;
    background: var(--ycp-primary); color: #fff; border: none;
    border-radius: 6px; font-size: 15px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    transition: background .15s;
    touch-action: manipulation;
}
.ycp-mobile-cta-btn:hover,
.ycp-mobile-cta-btn:active { background: var(--ycp-primary-h); color: #fff; }
.ycp-mobile-cta-secondary {
    background: transparent;
    color: var(--ycp-text);
    border: 1px solid var(--ycp-border);
}
.ycp-mobile-cta-secondary:hover,
.ycp-mobile-cta-secondary:active {
    background: rgba(255,255,255,.08);
    color: var(--ycp-text-bright);
}
.ycp-mobile-cta-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.ycp-mobile-pct {
    font-size: 12px; opacity: .85;
    background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 10px;
    margin-left: 4px;
}

/* ———————————————————————————
 * RESPONSIVE
 * ——————————————————————————— */

/* Large screen: more breathing room */
@media (min-width: 1281px) {
    .ycp-course-hero  { padding-left: 40px; padding-right: 40px; }
    .ycp-course-main  { padding-left: 40px; padding-right: 40px; }
}

/* Small desktop / iPad landscape: narrow sidebar card */
@media (max-width: 1280px) {
    :root { --ycp-card-w: 290px; }
    .ycp-course-hero-inner { max-width: calc(100% - var(--ycp-card-w) - 40px); }
}

/* iPad portrait + large tablet (≤1024px):
   Stack hero, show cover below text, hide sticky card, show mobile bar */
@media (max-width: 1024px) {
    .ycp-course-hero {
        flex-direction: column;
        padding-top: calc(48px + 24px);
        padding-bottom: 28px;
    }
    .ycp-course-hero-inner  { max-width: 100%; }
    .ycp-course-cover {
        display: block;
        width: 100%; max-width: 500px;
        margin: 20px auto 0;
        border-radius: 8px;
    }
    .ycp-course-main  {
        flex-direction: column;
        padding-top: 28px;
        /* reserve space for mobile CTA bar */
        padding-bottom: calc(20px + 68px + env(safe-area-inset-bottom, 0px));
    }
    .ycp-course-card  { display: none; }
    .ycp-mobile-cta-bar { display: block; }
    .ycp-ep-track     { width: min(200px, 100%); }
}

/* Tablet portrait / large phone (≤768px) */
@media (max-width: 768px) {
    .ycp-course-title    { font-size: 26px; }
    .ycp-course-subtitle { font-size: 15px; }
    .ycp-course-cover    { max-width: 100%; }
    .ycp-section-title   { font-size: 18px; }
    /* Touch-friendly tap targets */
    .ycp-ol-chapter-hdr  { padding: 14px 14px; min-height: 48px; }
    .ycp-ol-lesson       { padding: 13px 14px 13px 18px; min-height: 48px; }
    .ycp-btn-start       { touch-action: manipulation; }
}

/* Phone (≤480px): compact & thumb-friendly */
@media (max-width: 480px) {
    .ycp-course-hero {
        padding-top: 48px; /* cover comes first via order, no extra top gap */
        padding-left: 16px; padding-right: 16px;
        padding-bottom: 20px;
    }
    .ycp-course-cover {
        order: -1;               /* show cover above text on phone */
        margin: 0 -16px;         /* full-bleed edge-to-edge */
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        border-radius: 0;
    }
    .ycp-course-main {
        padding-left: 16px; padding-right: 16px;
        padding-top: 20px;
    }
    .ycp-course-title    { font-size: 21px; }
    .ycp-course-breadcrumb { font-size: 11px; }
    .ycp-course-subtitle { font-size: 14px; }
    .ycp-enrolled-box    { flex-direction: column; align-items: flex-start; gap: 10px; }
    .ycp-ep-track        { width: 100%; max-width: none; }
    .ycp-course-mobile-login { display: inline-flex; align-items: center; justify-content: center; }
    .ycp-btn-start       { width: 100%; justify-content: center; }
    .ycp-cta-box         { flex-direction: column; width: 100%; }
    .ycp-section-title   { font-size: 16px; }
    .ycp-ol-chapter-hdr  { padding: 13px 12px; }
    .ycp-ol-lesson       { padding: 12px 12px 12px 16px; }
    .ycp-course-back-title { font-size: 11px; }
}

/* ============================================================
 * Stage 3: Rating chip + Coupon input (course page)
 * ============================================================ */

/* Rating chip in meta row */
.ycp-rating-chip svg { width: 15px; height: 15px; vertical-align: middle; margin-right: 3px; }

/* Coupon input in sidebar CTA */
.ycp-coupon-wrap { margin-top: 14px; }
.ycp-coupon-hint { font-size: 12px; color: var(--ycp-text-muted); margin: 0 0 6px; }
.ycp-coupon-row  { display: flex; gap: 6px; }
.ycp-coupon-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--ycp-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--ycp-surface);
    color: var(--ycp-text);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ycp-coupon-input:focus { outline: none; border-color: var(--ycp-primary); }
.ycp-coupon-btn {
    padding: 9px 16px;
    background: var(--ycp-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.ycp-coupon-btn:hover    { background: var(--ycp-primary-h); }
.ycp-coupon-btn:disabled { opacity: .6; cursor: default; }
.ycp-coupon-msg { font-size: 12px; margin-top: 6px; min-height: 16px; }
.ycp-coupon-ok  { color: #43a047; }
.ycp-coupon-err { color: #ef4444; }

/* ===== 购买按钮 ===== */
.ycp-btn-buy {
    background: var(--ycp-primary, #ff6b35) !important;
    color: #fff !important;
    border: none;
    cursor: pointer;
    font-weight: 700;
    gap: 6px;
}
.ycp-btn-buy:hover { background: var(--ycp-primary-h, #e55a24) !important; }
.ycp-card-price-badge {
    font-size: 28px;
    font-weight: 800;
    color: var(--ycp-primary, #ff6b35);
    margin-bottom: 12px;
}
.ycp-card-btn-buy {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--ycp-primary, #ff6b35);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 8px;
    transition: background .2s;
}
.ycp-card-btn-buy:hover { background: var(--ycp-primary-h, #e55a24); color: #fff; }

/* ============================================================
 * 课时素材文件列表
 * ============================================================ */
.ycp-materials-wrap { padding: 4px 0 8px; }
.ycp-materials-list { list-style: none; margin: 0; padding: 0; }
.ycp-material-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ycp-border, #2a2a2a);
    flex-wrap: wrap;
}
.ycp-material-item:last-child { border-bottom: none; }
.ycp-material-ext {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 34px;
    text-align: center;
    flex-shrink: 0;
}
.ycp-material-title {
    flex: 1;
    font-size: 14px;
    color: var(--ycp-text, #f0f0f0);
    word-break: break-word;
}
.ycp-material-size {
    font-size: 12px;
    color: var(--ycp-text-muted, #888);
    white-space: nowrap;
}
.ycp-material-dl {
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--ycp-primary, #2271b1);
    color: var(--ycp-primary, #2271b1);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.ycp-material-dl:hover { background: var(--ycp-primary, #2271b1); color: #fff; }
.ycp-material-dl:disabled { opacity: .6; cursor: default; }
.ycp-material-locked {
    font-size: 12px;
    color: var(--ycp-text-muted, #888);
}

/* 素材面板 — 未购课锁定状态 */
.ycp-materials-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--ycp-text-muted, #888);
}
.ycp-materials-lock-icon {
    font-size: 36px;
    line-height: 1;
}
.ycp-materials-locked p {
    margin: 0;
    font-size: 14px;
}
.ycp-btn-purchase {
    display: inline-block;
    padding: 8px 24px;
    background: var(--ycp-primary, #2271b1);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .15s;
}
.ycp-btn-purchase:hover { opacity: .85; }

/* ============================================================
 * 文章课程衔接卡片
 * ============================================================ */
.ycp-article-course-card {
    margin: 26px 0;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 20px rgba(13, 39, 80, 0.06);
    overflow: hidden;
}

.ycp-article-course-card-inner {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.ycp-article-course-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e7eef8;
    color: #2271b1;
    overflow: hidden;
    text-decoration: none;
}

.ycp-article-course-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.ycp-article-course-cover .dashicons {
    width: 36px;
    height: 36px;
    font-size: 36px;
}

.ycp-article-course-main {
    min-width: 0;
}

.ycp-article-course-kicker {
    margin: 0 0 6px;
    color: #2271b1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ycp-article-course-main h3 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
}

.ycp-article-course-main h3 a {
    color: #1d2327;
    text-decoration: none;
}

.ycp-article-course-main h3 a:hover {
    color: #2271b1;
}

.ycp-article-course-desc {
    margin: 0 0 10px;
    color: #4f5966;
    font-size: 14px;
    line-height: 1.7;
}

.ycp-article-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ycp-article-course-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 12px;
    background: #edf4ff;
    color: #135e96;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
}

.ycp-article-course-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.ycp-article-course-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    background: #2271b1;
    color: #fff;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.ycp-article-course-btn:hover {
    background: #135e96;
    color: #fff;
}

.ycp-article-course-card--compact {
    background: #fff;
}

.ycp-article-course-card--compact .ycp-article-course-card-inner {
    grid-template-columns: 160px 1fr auto;
    gap: 14px;
    padding: 14px;
}

.ycp-article-course-card--compact .ycp-article-course-main h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.ycp-article-course-card--compact .ycp-article-course-desc {
    font-size: 13px;
    margin-bottom: 8px;
}

@media (max-width: 960px) {
    .ycp-article-course-card-inner {
        grid-template-columns: 180px 1fr;
        gap: 12px;
    }

    .ycp-article-course-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .ycp-article-course-card--compact .ycp-article-course-card-inner {
        grid-template-columns: 140px 1fr;
    }
}

@media (max-width: 640px) {
    .ycp-article-course-card {
        margin: 18px 0;
        border-radius: 10px;
    }

    .ycp-article-course-card-inner,
    .ycp-article-course-card--compact .ycp-article-course-card-inner {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .ycp-article-course-main h3,
    .ycp-article-course-card--compact .ycp-article-course-main h3 {
        font-size: 18px;
    }

    .ycp-article-course-btn {
        width: 100%;
    }
}

/* 课程素材 — 网盘打包入口 */
.ycp-materials-disk {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ycp-card-bg, #1e1e1e);
    border: 1px solid var(--ycp-border, #2a2a2a);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.ycp-disk-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}
.ycp-disk-info {
    flex: 1;
    min-width: 0;
}
.ycp-disk-info strong {
    display: block;
    font-size: 14px;
    color: var(--ycp-text, #f0f0f0);
    margin-bottom: 3px;
}
.ycp-disk-info p {
    margin: 0;
    font-size: 12px;
    color: var(--ycp-text-muted, #888);
}
.ycp-disk-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--ycp-primary, #2271b1);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity .15s;
    flex-shrink: 0;
}
.ycp-disk-btn:hover { opacity: .85; }
