/* ==============================================
 * Yooox Course Player — Udemy-style Design
 * ============================================== */

: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-error:       #ef4444;
    --ycp-header-h:    56px;
    --ycp-sidebar-w:   400px;
}

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

.ycp-player-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    background: var(--ycp-bg);
    color: var(--ycp-text);
    overflow: hidden;
    height: 100vh;
}

/* ——— TOP HEADER ——— */
.ycp-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--ycp-header-h);
    background: var(--ycp-bg);
    border-bottom: 1px solid var(--ycp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    gap: 12px;
}

.ycp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ycp-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ycp-text);
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background .15s;
    flex-shrink: 0;
}
.ycp-header-back:hover { background: var(--ycp-surface); color: var(--ycp-text-bright); }
.ycp-header-back svg { width: 20px; height: 20px; fill: currentColor; }

.ycp-header-divider { width: 1px; height: 24px; background: var(--ycp-border); flex-shrink: 0; }

.ycp-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ycp-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ycp-header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.ycp-header-progress { display: flex; align-items: center; gap: 10px; }
.ycp-header-progress-bar { width: 120px; height: 4px; background: var(--ycp-surface2); border-radius: 2px; overflow: hidden; }
.ycp-header-progress-fill { height: 100%; background: var(--ycp-primary); border-radius: 2px; transition: width .5s ease; }
.ycp-header-progress-text { font-size: 12px; color: var(--ycp-text-muted); white-space: nowrap; }

.ycp-btn-toggle-sidebar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--ycp-border);
    color: var(--ycp-text);
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
    white-space: nowrap;
}
.ycp-btn-toggle-sidebar:hover { background: var(--ycp-surface); color: var(--ycp-text-bright); }
.ycp-btn-toggle-sidebar svg { width: 16px; height: 16px; fill: currentColor; }

.ycp-preview-banner {
    position: fixed;
    top: var(--ycp-header-h);
    left: 0;
    right: 0;
    z-index: 99;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    background: #241331;
    border-bottom: 1px solid rgba(164,53,240,.45);
    color: var(--ycp-text-bright);
    font-size: 13px;
    text-align: center;
}
.ycp-preview-banner a { color: #c084fc; font-weight: 700; text-decoration: none; }
.ycp-preview-banner a:hover { color: #e9d5ff; }
.ycp-preview-banner + .ycp-container {
    margin-top: calc(var(--ycp-header-h) + 38px);
    height: calc(100vh - var(--ycp-header-h) - 38px);
}

/* ——— MAIN CONTAINER ——— */
.ycp-container {
    display: flex;
    height: calc(100vh - var(--ycp-header-h));
    margin-top: var(--ycp-header-h);
    overflow: hidden;
    min-height: 0;
}

/* ——— LEFT: VIDEO + TABS ——— */
.ycp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
    min-height: 0;
    background: #0a0a0a;
}
.ycp-main::-webkit-scrollbar { width: 6px; }
.ycp-main::-webkit-scrollbar-track { background: var(--ycp-bg); }
.ycp-main::-webkit-scrollbar-thumb { background: var(--ycp-surface2); border-radius: 3px; }

/* Video */
.ycp-video-wrap {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
    /* 56px header + 68px lesson-bar + 50px tabs = 174px；多留 20px 喘气 */
    max-height: calc(100vh - var(--ycp-header-h) - 194px);
    flex-shrink: 0;
}
.ycp-video-wrap video,
.ycp-video-wrap .video-js { width: 100%; height: 100%; object-fit: contain; display: block; }

.ycp-video-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,.85); z-index: 5;
}
.ycp-video-loading p { color: var(--ycp-text-muted); margin: 14px 0 0; font-size: 14px; }

.ycp-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--ycp-surface2); border-top-color: var(--ycp-primary);
    border-radius: 50%; animation: ycp-spin .8s linear infinite;
}
@keyframes ycp-spin { to { transform: rotate(360deg); } }

.ycp-video-error {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,.85); z-index: 5; gap: 14px;
}
.ycp-video-error-icon {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(239,68,68,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.ycp-video-error p { color: var(--ycp-error); margin: 0; font-size: 15px; }
.ycp-video-error-retry {
    background: transparent; border: 1px solid var(--ycp-border);
    color: var(--ycp-text); padding: 8px 22px; border-radius: 4px;
    cursor: pointer; font-size: 13px; transition: all .15s;
}
.ycp-video-error-retry:hover { background: var(--ycp-surface); color: var(--ycp-text-bright); }

.ycp-no-video {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #111; gap: 14px;
}
.ycp-no-video svg { width: 72px; height: 72px; fill: var(--ycp-surface2); }
.ycp-no-video p { color: var(--ycp-text-muted); margin: 0; font-size: 15px; }

/* ——— LESSON BAR ——— */
.ycp-lesson-bar {
    background: var(--ycp-bg);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; border-bottom: 1px solid var(--ycp-border);
    flex-wrap: wrap; flex-shrink: 0;
}
.ycp-lesson-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }

.ycp-status-badge {
    flex-shrink: 0; font-size: 11px; padding: 3px 10px; border-radius: 12px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    background: var(--ycp-surface); color: var(--ycp-text-muted);
}
.ycp-status-badge.completed { background: rgba(30,169,124,.15); color: var(--ycp-success); }
.ycp-status-badge.in-progress { background: rgba(246,156,8,.1); color: var(--ycp-warning); }

.ycp-lesson-heading {
    font-size: 18px; font-weight: 700; color: var(--ycp-text-bright);
    margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ycp-lesson-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.ycp-nav-btn {
    display: flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--ycp-border);
    color: var(--ycp-text); padding: 8px 16px; border-radius: 4px;
    cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s;
}
.ycp-nav-btn:hover:not(:disabled) { background: var(--ycp-surface); color: var(--ycp-text-bright); border-color: var(--ycp-surface2); }
.ycp-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.ycp-nav-btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

.ycp-btn-complete {
    display: flex; align-items: center; gap: 6px;
    background: var(--ycp-primary); border: none;
    color: #fff; padding: 8px 18px; border-radius: 4px;
    cursor: pointer; font-size: 13px; font-weight: 700; transition: background .15s;
}
.ycp-btn-complete:hover { background: var(--ycp-primary-h); }
.ycp-btn-complete.done { background: var(--ycp-success); }
.ycp-btn-complete svg { width: 14px; height: 14px; fill: currentColor; }

/* ——— TABS ——— */
.ycp-tabs {
    background: var(--ycp-bg); display: flex;
    border-bottom: 1px solid var(--ycp-border);
    padding: 0 24px; flex-shrink: 0;
}
.ycp-tab-btn {
    background: none; border: none; color: var(--ycp-text-muted);
    padding: 14px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.ycp-tab-btn:hover { color: var(--ycp-text-bright); }
.ycp-tab-btn.active { color: var(--ycp-text-bright); border-bottom-color: var(--ycp-text-bright); }

.ycp-tab-panels { background: var(--ycp-bg); flex: 1; min-height: 160px; }
.ycp-tab-panels { min-height: 0; }
.ycp-tab-panel { display: none; padding: 24px; }
.ycp-tab-panel.active { display: block; }
.ycp-overview-desc { font-size: 15px; line-height: 1.75; color: var(--ycp-text); max-width: 760px; }

.ycp-header-course {
    color: var(--ycp-text-bright);
    text-decoration: none;
    min-width: 0;
}
.ycp-header-course:hover {
    color: var(--ycp-text-bright);
    text-decoration: underline;
}

/* ——— RIGHT SIDEBAR ——— */
.ycp-sidebar {
    width: var(--ycp-sidebar-w); min-width: var(--ycp-sidebar-w);
    background: var(--ycp-bg); border-left: 1px solid var(--ycp-border);
    display: flex; flex-direction: column; overflow: hidden;
    transition: margin-right .3s ease;
}
.ycp-sidebar.hidden { margin-right: calc(-1 * var(--ycp-sidebar-w)); }

.ycp-sidebar-hdr {
    padding: 16px 20px; border-bottom: 1px solid var(--ycp-border);
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.ycp-sidebar-hdr h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ycp-text-bright); }

.ycp-sidebar-close {
    background: none; border: none; color: var(--ycp-text-muted);
    cursor: pointer; padding: 4px; display: flex; align-items: center; transition: color .15s;
}
.ycp-sidebar-close:hover { color: var(--ycp-text-bright); }
.ycp-sidebar-close svg { width: 20px; height: 20px; fill: currentColor; }

.ycp-sidebar-progress {
    padding: 10px 20px 12px; font-size: 12px; color: var(--ycp-text-muted);
    border-bottom: 1px solid var(--ycp-border); flex-shrink: 0;
}
.ycp-sidebar-progress-bar { height: 4px; background: var(--ycp-surface2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.ycp-sidebar-progress-fill { height: 100%; background: var(--ycp-primary); border-radius: 2px; transition: width .5s; }

.ycp-chapters-scroll { flex: 1; overflow-y: auto; }
.ycp-chapters-scroll::-webkit-scrollbar { width: 4px; }
.ycp-chapters-scroll::-webkit-scrollbar-track { background: transparent; }
.ycp-chapters-scroll::-webkit-scrollbar-thumb { background: var(--ycp-surface2); border-radius: 2px; }

/* Chapter accordion */
.ycp-chapter { border-bottom: 1px solid var(--ycp-border); }
.ycp-chapter-toggle {
    width: 100%; display: flex; align-items: flex-start; justify-content: space-between;
    padding: 14px 20px; background: var(--ycp-surface); border: none;
    cursor: pointer; text-align: left; gap: 10px; transition: background .15s;
}
.ycp-chapter-toggle:hover { background: var(--ycp-surface2); }
.ycp-chapter-toggle-left { flex: 1; min-width: 0; }
.ycp-chapter-name { font-size: 13px; font-weight: 700; color: var(--ycp-text-bright); line-height: 1.4; display: block; margin-bottom: 3px; }
.ycp-chapter-meta { font-size: 12px; color: var(--ycp-text-muted); }
.ycp-chapter-chevron { flex-shrink: 0; color: var(--ycp-text-muted); transition: transform .2s; margin-top: 2px; }
.ycp-chapter-chevron svg { width: 16px; height: 16px; fill: currentColor; }
.ycp-chapter.open .ycp-chapter-chevron { transform: rotate(180deg); }

/* Lesson list */
.ycp-lesson-list { list-style: none; margin: 0; padding: 0; display: none; }
.ycp-chapter.open .ycp-lesson-list { display: block; }

.ycp-lesson-item {
    display: flex; align-items: flex-start; padding: 10px 20px; gap: 10px;
    cursor: pointer; transition: background .15s; border-left: 3px solid transparent;
}
.ycp-lesson-item:hover { background: var(--ycp-surface); }
.ycp-lesson-item.active { background: rgba(164,53,240,.08); border-left-color: var(--ycp-primary); }
.ycp-lesson-item.locked { opacity: .62; }
.ycp-lesson-item.locked:hover { background: rgba(255,255,255,.03); }
.ycp-lesson-item.locked .ycp-lesson-title-text { color: var(--ycp-text-muted); }
.ycp-lesson-item.locked .ycp-lesson-check svg { display: block; fill: var(--ycp-text-muted); }

.ycp-lesson-check {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--ycp-surface2); display: flex; align-items: center;
    justify-content: center; margin-top: 2px; transition: all .15s;
}
.ycp-lesson-item.completed .ycp-lesson-check { background: var(--ycp-primary); border-color: var(--ycp-primary); }
.ycp-lesson-check svg { width: 10px; height: 10px; fill: #fff; display: none; }
.ycp-lesson-item.completed .ycp-lesson-check svg { display: block; }

.ycp-lesson-body { flex: 1; min-width: 0; }
.ycp-lesson-title-text { font-size: 13px; color: var(--ycp-text); line-height: 1.4; display: block; }
.ycp-lesson-item.active .ycp-lesson-title-text { color: var(--ycp-text-bright); font-weight: 600; }

.ycp-lesson-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ycp-lesson-type-icon { color: var(--ycp-text-muted); }
.ycp-lesson-type-icon svg { width: 13px; height: 13px; fill: currentColor; }
.ycp-lesson-dur { font-size: 11px; color: var(--ycp-text-muted); }
.ycp-lesson-free { font-size: 11px; background: rgba(14,165,233,.15); color: #38bdf8; padding: 2px 6px; border-radius: 3px; font-weight: 600; }

/* ——— QUIZ ——— */
.ycp-quiz-wrap { max-width: 760px; }
.ycp-quiz-title { font-size: 18px; font-weight: 700; color: var(--ycp-text-bright); margin: 0 0 6px; }
.ycp-quiz-desc { color: var(--ycp-text-muted); margin: 0 0 20px; font-size: 14px; }
.ycp-question { background: var(--ycp-surface); border: 1px solid var(--ycp-border); border-radius: 6px; padding: 18px; margin-bottom: 14px; }
.ycp-question-title { font-size: 15px; color: var(--ycp-text-bright); margin: 0 0 14px; line-height: 1.5; }
.ycp-question-num { color: var(--ycp-primary); font-weight: 700; margin-right: 6px; }
.ycp-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; margin-bottom: 8px;
    background: var(--ycp-bg); border: 1px solid var(--ycp-border); border-radius: 4px;
    cursor: pointer; font-size: 14px; color: var(--ycp-text); transition: all .15s;
}
.ycp-option:hover { border-color: var(--ycp-primary); color: var(--ycp-text-bright); }
.ycp-option.selected { border-color: var(--ycp-primary); background: rgba(164,53,240,.08); color: var(--ycp-text-bright); }
.ycp-option input { flex-shrink: 0; accent-color: var(--ycp-primary); }
.ycp-quiz-submit-btn {
    background: var(--ycp-primary); color: #fff; border: none;
    padding: 12px 32px; border-radius: 4px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background .15s; margin-top: 8px;
}
.ycp-quiz-submit-btn:hover { background: var(--ycp-primary-h); }
.ycp-quiz-result-box { margin-top: 16px; padding: 16px; border-radius: 6px; text-align: center; font-size: 16px; font-weight: 600; }
.ycp-quiz-result-box.passed { background: rgba(30,169,124,.12); color: var(--ycp-success); border: 1px solid var(--ycp-success); }
.ycp-quiz-result-box.failed { background: rgba(239,68,68,.1); color: var(--ycp-error); border: 1px solid var(--ycp-error); }

/* ——— SIDEBAR OVERLAY (mobile backdrop) ——— */
.ycp-sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 190;
    background: rgba(0,0,0,.62);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.ycp-sidebar-overlay.visible { display: block; }

/* ——— RESPONSIVE ——— */

/* Small desktop / iPad landscape (769-960px): narrower sidebar */
@media (max-width: 960px) {
    :root { --ycp-sidebar-w: 300px; }
    .ycp-header-progress { display: none; }
    .ycp-header-title { font-size: 13px; }
    .ycp-lesson-heading { font-size: 16px; }
}

/* iPad portrait / large phone (≤768px): sidebar becomes overlay drawer,
   layout becomes scrollable single column */
@media (max-width: 768px) {
    /* Allow normal page scroll on mobile */
    .ycp-player-body { overflow: auto; height: auto; }
    .ycp-container   { height: auto; overflow: visible; flex-direction: column; }
    .ycp-preview-banner + .ycp-container { height: auto; }
    .ycp-main        { overflow: visible; }
    /* Sidebar: fixed overlay drawer from right */
    .ycp-sidebar {
        position: fixed; right: 0;
        top: var(--ycp-header-h); bottom: 0; z-index: 200;
        width: min(300px, 88vw); min-width: 0;
        transition: transform .28s ease;
        box-shadow: -4px 0 32px rgba(0,0,0,.7);
        overflow-y: auto;
        /* reset desktop margin-right transition */
        margin-right: 0 !important;
    }
    .ycp-sidebar.hidden { transform: translateX(100%); }
    /* Video: remove max-height cap, let aspect-ratio rule it */
    .ycp-video-wrap { max-height: none; }
    /* Lesson bar */
    .ycp-lesson-bar  { padding: 11px 16px; gap: 10px; }
    .ycp-lesson-heading { font-size: 15px; }
    /* Touch-friendly lesson items in sidebar */
    .ycp-lesson-item    { min-height: 48px; padding: 12px 16px; align-items: center; }
    .ycp-chapter-toggle { min-height: 48px; padding: 13px 16px; }
    /* Tabs */
    .ycp-tab-btn  { padding: 12px 14px; font-size: 13px; }
    .ycp-tabs     { padding: 0 16px; }
    .ycp-tab-panel { padding: 16px; }
    /* Buttons */
    .ycp-nav-btn    { min-height: 40px; padding: 8px 12px; touch-action: manipulation; }
    .ycp-btn-complete { min-height: 40px; touch-action: manipulation; }
    .ycp-btn-complete span { display: none; }
    .ycp-btn-toggle-sidebar { touch-action: manipulation; }
    /* Quiz */
    .ycp-quiz-submit-btn { width: 100%; }
}

/* Phone (≤480px): ultra-compact */
@media (max-width: 480px) {
    :root { --ycp-header-h: 50px; }
    .ycp-header-divider { display: none; }
    .ycp-header-title {
        font-size: 12px;
        max-width: 120px;
    }
    .ycp-btn-toggle-sidebar { padding: 8px 10px; min-width: 40px; justify-content: center; }
    .ycp-btn-toggle-sidebar span { display: none; }
    .ycp-sidebar { width: 92vw; }
    /* Lesson bar: stack on small screens */
    .ycp-lesson-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .ycp-lesson-bar-right {
        align-self: stretch;
        justify-content: space-between;
        width: 100%;
    }
    .ycp-lesson-heading { font-size: 15px; white-space: normal; }
    /* Icon-only nav buttons on phone */
    .ycp-nav-btn span { display: none; }
    .ycp-nav-btn {
        width: 40px; height: 40px;
        justify-content: center; padding: 0;
    }
    .ycp-tab-btn { padding: 11px 10px; font-size: 12px; }
}

/* ==============================================
 * Watermark — 防盗录屏水印
 * ============================================== */
.ycp-watermark {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 4;
    color: rgba(255, 255, 255, 0.18);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    transition: left 2s ease, top 2s ease;
    transform: rotate(-15deg);
}

/* ==============================================
 * Video.js 主题覆盖 — 暗色风格
 * ============================================== */
.ycp-video-wrap .video-js {
    width: 100%;
    height: 100%;
    background: #000;
}
.ycp-video-wrap .vjs-tech {
    object-fit: contain;
}
/* 控制栏背景 */
.ycp-video-wrap .vjs-control-bar {
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    font-family: inherit;
}
/* 进度条主色 */
.ycp-video-wrap .vjs-play-progress,
.ycp-video-wrap .vjs-volume-level {
    background: var(--ycp-primary);
}
.ycp-video-wrap .vjs-play-progress:before {
    color: var(--ycp-primary);
}
/* 播放速率菜单 */
.ycp-video-wrap .vjs-playback-rate .vjs-menu-content {
    bottom: 2.5em;
}
/* 大播放按钮 */
.ycp-video-wrap .vjs-big-play-button {
    border-color: rgba(255,255,255,.8);
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    line-height: 64px;
    margin-left: -32px;
    margin-top: -32px;
}
.ycp-video-wrap .vjs-big-play-button:hover {
    background: var(--ycp-primary);
    border-color: var(--ycp-primary);
}

/* ===== 评论/提问 ===== */
.ycp-comments-wrap { max-width: 760px; }
.ycp-comment-list { margin-bottom: 20px; }
.ycp-comment-empty { color: var(--ycp-text-muted); font-size: 14px; }
.ycp-comment-item { display: flex; gap: 12px; margin-bottom: 18px; }
.ycp-comment-avatar {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--ycp-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
}
.ycp-comment-body { flex: 1; }
.ycp-comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ycp-comment-author { font-size: 13px; font-weight: 600; color: var(--ycp-text-bright); }
.ycp-comment-time { font-size: 12px; color: var(--ycp-text-muted); }
.ycp-comment-text { font-size: 14px; color: var(--ycp-text); line-height: 1.6; margin: 0; white-space: pre-wrap; word-break: break-word; }
.ycp-comment-form { display: flex; flex-direction: column; gap: 10px; }
.ycp-comment-input {
    width: 100%; background: var(--ycp-surface); border: 1px solid var(--ycp-border);
    border-radius: 6px; color: var(--ycp-text-bright); font-size: 14px;
    padding: 10px 12px; resize: vertical; box-sizing: border-box;
}
.ycp-comment-input:focus { outline: none; border-color: var(--ycp-primary); }
.ycp-comment-submit-btn {
    align-self: flex-end; background: var(--ycp-primary); color: #fff;
    border: none; border-radius: 6px; padding: 8px 22px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.ycp-comment-submit-btn:hover { background: var(--ycp-primary-h); }
.ycp-comment-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ===== 证书按钮 ===== */
.ycp-btn-certificate {
    display: flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg,#f5a623,#e8860f);
    color: #fff; text-decoration: none;
    border-radius: 6px; padding: 6px 14px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
}
.ycp-btn-certificate:hover { opacity: .88; color: #fff; }

/* ===== 证书弹窗 ===== */
.ycp-cert-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.ycp-cert-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.ycp-cert-box {
    position: relative; background: #fffdf5;
    border-radius: 12px; width: 640px; max-width: 94vw;
    padding: 40px 50px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    border: 6px double #c8a96a;
    color: #2c1a00;
}
.ycp-cert-close {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none; font-size: 22px;
    cursor: pointer; color: #888; line-height: 1;
}
.ycp-cert-logo { font-size: 28px; font-weight: 900; letter-spacing: 2px; color: #b8860b; margin-bottom: 6px; }
.ycp-cert-heading { font-size: 32px; font-weight: 800; color: #2c1a00; margin-bottom: 24px; letter-spacing: 4px; }
.ycp-cert-line { font-size: 15px; margin: 8px 0; color: #555; }
.ycp-cert-name { font-size: 28px; font-weight: 700; color: #b8860b; margin: 6px 0; border-bottom: 1px solid #c8a96a; padding-bottom: 8px; }
.ycp-cert-course { font-size: 20px; font-weight: 600; color: #2c1a00; margin: 8px 0 20px; }
.ycp-cert-date { font-size: 14px; color: #888; }
.ycp-cert-actions { margin-top: 28px; }
.ycp-cert-print-btn {
    background: var(--ycp-primary); color: #fff; border: none;
    border-radius: 6px; padding: 10px 28px; font-size: 15px;
    font-weight: 600; cursor: pointer;
}
.ycp-cert-print-btn:hover { background: var(--ycp-primary-h); }
@media print {
    body > *:not(.ycp-cert-modal) { display: none !important; }
    .ycp-cert-modal { position: static; background: none; }
    .ycp-cert-backdrop, .ycp-cert-close, .ycp-cert-actions { display: none !important; }
    .ycp-cert-box { box-shadow: none; border: 4px double #c8a96a; width: 100%; max-width: 100%; }
}
