/**
 * 图道视频 Pro · 详情页样式
 *
 * 1:1 对齐 examples/video-detail-mockup.html
 *
 * 命名空间隔离原则：
 *   - 主站菜单接管：去掉 mockup 的 .mock-topbar / .mock-nav / .mock-theme-toggle
 *   - 全局样式（body / *）改成 .tdvp-exact-page（避免污染 WP 主题）
 *   - 暗色模式由 .tdv-wrap[data-tdv-theme="dark"] 控制（不再依赖 body.is-dark）
 */

/* ── box-sizing 命名空间隔离 ── */
.tdvp-exact-page,
.tdvp-exact-page *,
.tdvp-exact-page *::before,
.tdvp-exact-page *::after { box-sizing: border-box; }

/* ============================================================================
 * 主题反污染（dux/通用 WP 主题给 <a> 加 underline / border-bottom / box-shadow）
 * 必须放最前面，用 !important 覆盖主题的高优先级规则
 * ============================================================================ */
.tdvp-exact-page a,
.tdvp-exact-page a:link,
.tdvp-exact-page a:visited,
.tdvp-exact-page a:hover,
.tdvp-exact-page a:focus,
.tdvp-exact-page a:active {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}
.tdvp-exact-page button {
    font-family: inherit;
    line-height: inherit;
    color: inherit;
}
.tdvp-exact-page h1,
.tdvp-exact-page h2,
.tdvp-exact-page h3,
.tdvp-exact-page h4,
.tdvp-exact-page h5,
.tdvp-exact-page h6 {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-weight: inherit;
}
.tdvp-exact-page ul,
.tdvp-exact-page ol {
    margin: 0;
    padding: 0;
}
/* 主题对 .entry-content p 默认 margin-bottom，会破坏 flexbox gap 间距 */
.tdvp-exact-page p {
    margin: 0;
    padding: 0;
}
.tdvp-exact-page img {
    max-width: 100%;
    height: auto;
    margin: 0;
    border: 0;
    box-shadow: none;
}
/* .tdv-ep-item 是 button — 主题可能给 button 设 color，强制保持插件配色 */
.tdv-side .tdv-ep-item .tdv-ep-index {
    color: inherit !important;
    font-size: 13px !important;
    font-weight: inherit !important;
}

/* ── 页面外壳 ── */
.tdvp-exact-page {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f1f3f6;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* ── 面包屑（详情页特有） ── */
.mock-breadcrumb {
    max-width: 1200px;
    margin: 24px auto 12px;
    padding: 0 44px;
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mock-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}
.mock-breadcrumb a:hover { color: #3730a3; }
.mock-breadcrumb-sep { color: #d5d9e0; }
.mock-breadcrumb-current { color: #0f172a; font-weight: 500; }

/* ── 主容器 ── */
.mock-container {
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 40px 44px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ============================================================================
 * 播放器外框（命名空间 .tdv-*）— 与 mockup 1:1 一致
 * ============================================================================ */
.tdv-wrap {
    --tdv-accent: #3730a3;
    --tdv-accent-hover: #4338ca;
    --tdv-bg: #0d0d0f;
    --tdv-bg-side: #18181b;
    --tdv-text: #fafafa;
    --tdv-text-muted: #9ca3af;
    --tdv-border: rgba(255, 255, 255, 0.08);
    --tdv-success: #16a34a;
    --tdv-warning: #f59e0b;
    --tdv-danger: #dc2626;
    --tdv-radius: 10px;

    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 0;
    background: var(--tdv-bg);
    color: var(--tdv-text);
    border-radius: var(--tdv-radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    line-height: 1.5;
}
.tdv-wrap *, .tdv-wrap *::before, .tdv-wrap *::after { box-sizing: border-box; }

/* 左列：播放器 */
.tdv-main {
    position: relative;
    background: #000;
    min-height: 0;
}
.tdv-player-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000;
    overflow: hidden;
}

/* 模拟封面（mockup 用；插件真实环境由 DPlayer 接管） */
.mock-player-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #8b5cf6 100%);
    color: #fff;
    text-align: center;
    padding: 20px;
}
.mock-player-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
    pointer-events: none;
}
.mock-player-label {
    position: relative;
    font-size: 12px;
    opacity: 0.85;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.mock-player-title {
    position: relative;
    font-size: 40px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.25);
    letter-spacing: 0.02em;
}
.mock-player-sub {
    position: relative;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 10px;
}

/* 中央大播放按钮 */
.mock-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), background 0.2s;
    z-index: 3;
}
.mock-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background: #fff !important;
}
/* SVG 强制显示 + 颜色（防 dux 主题 button > svg 规则覆盖）*/
.mock-play-btn svg {
    width: 28px !important;
    height: 28px !important;
    margin-left: 3px;
    fill: #0f172a !important;
    color: #0f172a !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.mock-play-btn svg polygon,
.mock-play-btn svg path {
    fill: #0f172a !important;
}

/* DPlayer 自带的中心播放浮层；底部控制栏保留 */
.tdv-player-shell #tdvDPlayer .dplayer-bezel,
.tdv-player-shell #tdvDPlayer .dplayer-mobile-play,
.tdvp-exact-page .dplayer-bezel,
.tdvp-exact-page .dplayer-mobile-play {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 模拟 DPlayer 控制栏 */
.mock-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 14px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    z-index: 3;
}
.mock-controls-progress {
    height: 4px;
    background: rgba(255,255,255,0.22);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.mock-controls-progress:hover { height: 6px; }
.mock-controls-progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 58%;
    background: rgba(255,255,255,0.22);
    border-radius: 2px;
}
.mock-controls-progress-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 42%;
    background: var(--tdv-accent);
    border-radius: 2px;
}
.mock-controls-progress-dot {
    position: absolute;
    top: 50%;
    left: 42%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.mock-controls-progress:hover .mock-controls-progress-dot { opacity: 1; }

.mock-controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: #fff;
    font-size: 12px;
}
.mock-ctrl-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.mock-ctrl-btn:hover { background: rgba(255,255,255,0.12); }
.mock-ctrl-btn svg { width: 16px; height: 16px; }
.mock-ctrl-time { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.88); }
.mock-ctrl-spacer { flex: 1; }
.mock-ctrl-speed {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.14);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.mock-ctrl-speed:hover { background: rgba(255,255,255,0.22); }

/* 未付费遮罩 */
.tdv-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 13, 15, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.tdv-overlay[hidden] { display: none; }
.tdv-overlay-inner {
    text-align: center;
    padding: 24px;
    max-width: 380px;
}
.tdv-overlay-icon {
    margin: 0 auto 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tdv-accent);
}
.tdv-overlay-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}
.tdv-overlay-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 18px;
    line-height: 1.6;
}
.tdv-overlay-cta {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 6px;
    background: var(--tdv-accent);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}
.tdv-overlay-cta:hover { background: var(--tdv-accent-hover); }

/* 加载态/错误兜底（插件特有） */
.tdv-loading,
.tdv-error {
    position: absolute;
    inset: 0;
    z-index: 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}
.tdv-loading[hidden],
.tdv-error[hidden] { display: none !important; }
.tdv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.18);
    border-top-color: var(--tdv-accent);
    border-radius: 50%;
    animation: tdv-spin .9s linear infinite;
}
@keyframes tdv-spin { to { transform: rotate(360deg); } }
.tdv-error-icon { font-size: 32px; }
.tdv-error-message { font-size: 0.95rem; }
.tdv-error-retry {
    margin-top: 6px;
    padding: 6px 16px;
    background: var(--tdv-accent);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity .15s;
}
.tdv-error-retry:hover { opacity: 0.9; }

/* 右列：分集列表 */
.tdv-side {
    background: var(--tdv-bg-side);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tdv-side-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--tdv-border);
}
.tdv-side-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.tdv-current-ep {
    font-size: 15px;
    color: var(--tdv-text);
}
.tdv-current-ep strong {
    color: var(--tdv-accent);
    font-size: 17px;
}
.tdv-total {
    font-size: 12px;
    color: var(--tdv-text-muted);
}
.tdv-side-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 14px;
    overflow-y: auto;
    max-height: 420px;
    align-content: start;
}
.tdv-side-grid::-webkit-scrollbar { width: 6px; }
.tdv-side-grid::-webkit-scrollbar-track { background: transparent; }
.tdv-side-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
    border-radius: 3px;
}

/* 分集按钮 */
.tdv-ep-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--tdv-border);
    color: var(--tdv-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
    font-family: inherit;
}
.tdv-ep-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--tdv-text);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
}
.tdv-ep-item.is-current {
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.5);
    font-weight: 600;
}
.tdv-ep-item.is-current::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--tdv-accent);
}
.tdv-ep-item.is-locked {
    cursor: pointer;
    opacity: 0.6;
}
.tdv-ep-item.is-locked:hover { opacity: 0.85; }
.tdv-ep-item.is-watched {
    color: rgba(134, 239, 172, 0.85);
}
.tdv-ep-item.is-watched::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: rgba(134, 239, 172, 0.85);
}
.tdv-ep-item:focus-visible {
    outline: 2px solid var(--tdv-accent);
    outline-offset: 2px;
}
.tdv-ep-index {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.tdv-ep-lock {
    position: absolute;
    top: 4px;
    right: 5px;
    color: var(--tdv-warning);
    display: inline-flex;
}
.tdv-ep-lock svg { width: 10px; height: 10px; }
.tdv-ep-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: var(--tdv-accent);
    border-radius: 0 2px 2px 0;
}

/* 响应式 */
@media (max-width: 960px) {
    .tdv-wrap { grid-template-columns: 1fr; }
    .tdv-side-grid { max-height: 260px; grid-template-columns: repeat(6, 1fr); }
}

/* ============================================================================
 * 元信息区（播放器下方）
 * ============================================================================ */
.mock-meta {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 32px;
}
.mock-meta-main { min-width: 0; }

.mock-meta-cats {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
}
.mock-meta-cat {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #fafbfc;
    border: 1px solid #eaecef;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.mock-meta-cat:hover {
    color: #3730a3;
    border-color: #3730a3;
    background: rgba(67, 56, 202, 0.04);
}

.mock-meta-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.mock-meta-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748b;
}
.mock-meta-stats-sep { color: #d5d9e0; }
.mock-access-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    letter-spacing: 0.02em;
}

.mock-meta-desc {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.75;
    color: #374151;
}

.mock-meta-box {
    padding: 16px 18px;
    border-radius: 10px;
    background: #fafbfc;
    border: 1px solid #eaecef;
    margin-bottom: 16px;
}
.mock-meta-box-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mock-meta-box-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: #3730a3;
    border-radius: 2px;
}
.mock-meta-box-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #475569;
    line-height: 1.9;
}
.mock-meta-box-list li::before {
    content: '·';
    color: #3730a3;
    margin-right: 8px;
    font-weight: 700;
}

/* 讲师卡片 */
.mock-meta-side { min-width: 0; }
.mock-instructor {
    padding: 18px;
    border-radius: 10px;
    background: #fafbfc;
    border: 1px solid #eaecef;
    margin-bottom: 16px;
}
.mock-instructor-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.mock-instructor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3730a3 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
.mock-instructor-info { min-width: 0; }
.mock-instructor-name {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.mock-instructor-role {
    font-size: 12px;
    color: #64748b;
}
.mock-instructor-bio {
    margin: 0;
    font-size: 12px;
    color: #475569;
    line-height: 1.7;
}

/* CTA 按钮行 */
.mock-cta-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.mock-cta-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #eaecef;
    background: #fff;
    color: #374151;
    transition: all 0.15s;
}
.mock-cta-btn:hover {
    border-color: #3730a3;
    color: #3730a3;
    background: rgba(67,56,202,0.04);
}
.mock-cta-btn svg { width: 15px; height: 15px; }

@media (max-width: 960px) {
    .mock-meta { grid-template-columns: 1fr; }
}

/* 短代码内联错误兜底 */
.tdv-shortcode-error { margin: 14px 0; }
