/* Video Player Container — 去填充卡片，仅留极淡描边，与音频播放器保持一致 */
.video-player-container {
    margin: 1.618em 0;
    padding: 1.25rem;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
}

.dark .video-player-container {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Video Stage (the picture itself) */
.video-player-stage {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.video-player-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    background: #000;
}

/* Center play overlay (visible while paused) — 减淡遮罩、缩小按钮、去缩放 */
.video-player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    margin: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.18);
    color: #fff;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.video-player-overlay-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5);
    transition: none;
}

.video-player-container.is-playing .video-player-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Title */
.video-player-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.video-player-title-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.video-player-title-left>span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .video-player-title {
    color: #cbd5e1;
}

.video-player-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    color: #475569;
}

.dark .video-player-icon {
    color: #94a3b8;
}

/* Progress Bar Container */
.video-progress-container {
    position: relative;
    width: 100%;
    height: 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    margin-bottom: 1rem;
    touch-action: none;
}

.video-progress-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.375rem;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #e2e8f0;
    transition: background-color 140ms ease-out;
}

.video-progress-container:hover::before,
.video-progress-container:focus-visible::before,
.video-progress-container.is-dragging::before {
    background: #d7dee8;
}

.video-progress-container:focus-visible {
    outline: none;
}

.dark .video-progress-container::before {
    background: #334155;
}

.dark .video-progress-container:hover::before,
.dark .video-progress-container:focus-visible::before,
.dark .video-progress-container.is-dragging::before {
    background: #3d4a5e;
}

/* Progress Bar Fill */
.video-progress-bar {
    position: absolute;
    left: 0;
    top: 50%;
    height: 0.375rem;
    transform: translateY(-50%);
    background: #475569;
    border-radius: 999px;
    width: 0%;
    transition: width 120ms linear, background-color 140ms ease-out;
}

.dark .video-progress-bar {
    background: #cbd5e1;
}

/* Progress Bar Thumb — 默认隐藏，hover / 聚焦 / 拖动时才显现，去阴影去缩放 */
.video-progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.75rem;
    height: 0.75rem;
    background: #f8fafc;
    border: 1px solid #475569;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 140ms ease-out, border-color 140ms ease-out, background-color 140ms ease-out;
    pointer-events: none;
}

.video-progress-container:hover .video-progress-thumb,
.video-progress-container:focus-visible .video-progress-thumb,
.video-progress-container.is-dragging .video-progress-thumb {
    opacity: 0.82;
}

.dark .video-progress-thumb {
    background: #0f172a;
    border-color: #cbd5e1;
}

/* Progress Bar Time Tooltip */
.video-progress-tooltip {
    position: absolute;
    bottom: calc(100% + 0.375rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    color: white;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease-out;
    z-index: 10;
}

.dark .video-progress-tooltip {
    background: rgba(255, 255, 255, 0.95);
    color: #020617;
}

.video-progress-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%);
}

.video-progress-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.92);
}

.dark .video-progress-tooltip::after {
    border-top-color: rgba(255, 255, 255, 0.9);
}

/* Controls Container */
.video-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.video-controls-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.video-controls-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Play/Pause Button — 描边线性，不再使用深色实心圆 */
.video-play-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 50%;
    background: transparent;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
}

.dark .video-play-btn {
    border-color: rgba(255, 255, 255, 0.22);
    color: #e2e8f0;
}

.video-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Time Display */
.video-time {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dark .video-time {
    color: #94a3b8;
}

/* Volume Control */
.video-volume-control {
    display: flex;
    align-items: center;
    position: relative;
}

.video-volume-btn {
    background: none;
    border: none;
    padding: 0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.dark .video-volume-btn {
    color: #94a3b8;
}

.video-volume-btn:hover {
    color: #1e293b;
}

.dark .video-volume-btn:hover {
    color: #e2e8f0;
}

.video-volume-slider-wrapper {
    width: 0;
    height: 24px;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    opacity: 0;
}

.video-volume-control:hover .video-volume-slider-wrapper,
.video-volume-control:focus-within .video-volume-slider-wrapper {
    width: 80px;
    opacity: 1;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.video-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #475569 0%, #475569 var(--volume-percent, 60%), #cbd5e1 var(--volume-percent, 60%), #cbd5e1 100%);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.dark .video-volume-slider {
    background: linear-gradient(to right, #94a3b8 0%, #94a3b8 var(--volume-percent, 60%), #1e293b var(--volume-percent, 60%), #1e293b 100%);
}

.video-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #475569;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid white;
}

.dark .video-volume-slider::-webkit-slider-thumb {
    border-color: #1e293b;
}

.video-volume-slider::-webkit-slider-thumb:hover {
    background: #1e293b;
}

/* Speed Control */
.video-speed-control {
    position: relative;
}

.video-speed-btn {
    padding: 0.3rem 0.4rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dark .video-speed-btn {
    color: #94a3b8;
}

.video-speed-btn:hover {
    color: #1e293b;
    background: rgba(15, 23, 42, 0.04);
}

.dark .video-speed-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

/* Speed Dropdown */
.video-speed-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.97);
    transform-origin: bottom right;
    transition:
        transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 250ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    z-index: 10;
}

.dark .video-speed-dropdown {
    background: #1e293b;
    border-color: #475569;
}

.video-speed-dropdown.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.video-speed-dropdown.is-closing {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.99);
    transition:
        transform 150ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.video-speed-option {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.dark .video-speed-option {
    color: #cbd5e1;
}

.video-speed-option:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dark .video-speed-option:hover {
    background: #1e293b;
    color: #cbd5e1;
}

.video-speed-option.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.dark .video-speed-option.active {
    background: #1e293b;
    color: #f8fafc;
}

/* Fullscreen Button */
.video-fullscreen-btn {
    background: none;
    border: none;
    padding: 0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.dark .video-fullscreen-btn {
    color: #94a3b8;
}

.video-fullscreen-btn:hover {
    color: #1e293b;
}

.dark .video-fullscreen-btn:hover {
    color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 640px) {
    .video-player-container {
        padding: 1rem;
    }

    .video-player-title {
        font-size: 0.875rem;
    }

    .video-time {
        font-size: 0.75rem;
    }

    .video-speed-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .video-controls {
        gap: 0.5rem;
    }

    .video-controls-left,
    .video-controls-right {
        gap: 0.5rem;
    }

    .video-player-overlay-icon {
        width: 3.25rem;
        height: 3.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .video-player-overlay,
    .video-player-overlay-icon,
    .video-progress-container::before,
    .video-progress-bar,
    .video-progress-thumb,
    .video-progress-tooltip,
    .video-speed-dropdown {
        transition: none !important;
    }
}
