/* 案例展示区域样式 */
.cases-grid {
    margin-top: var(--spacing-md);
}

.case-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 650px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.case-img {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 添加半透明遮罩层，位于图片上方、文字下方 */
.case-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    transition: var(--transition);
}

.case-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    position: relative;
    z-index: 0;
    /* 确保图片在遮罩层下方 */
}

/* 播放按钮样式 - 垂直居中 */
.case-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    /* 确保播放按钮在遮罩层和文字上方 */
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.9;
}

.case-play-btn img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.case-play-btn:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.case-play-btn:hover img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.case-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    color: var(--white);
    transform: translateY(0);
    transition: var(--transition);
    z-index: 2;
    /* 确保文字在遮罩层上方 */
}


.case-overlay h4 {
    font-size: 26px;
    margin-bottom: 10px;
    position: relative;
}

.case-overlay p {
    font-size: 24px;
    line-height: 1.5;
    letter-spacing: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 悬停效果 */
.case-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.case-card:hover .case-img img {
    transform: scale(1.1);
}

.case-card:hover .case-overlay {
    padding-bottom: 40px;
}

/* 悬停时遮罩层变深，增强对比度 */
.case-card:hover .case-img::before {
    background: rgba(0, 0, 0, 0.5);
}

/* 悬停时播放按钮更明显 */
.case-card:hover .case-play-btn {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 视频播放弹框样式 */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10001;
}

.video-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.video-modal-header {
    padding: 25px 30px;
    background-color: #252525;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal-header h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.video-modal-body {
    padding: 40px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}

.video-placeholder {
    text-align: center;
    color: #888888;
}

.video-placeholder i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #555555;
}

.video-placeholder p {
    font-size: 1.1rem;
    margin: 0;
}

/* 弹框内占位符与播放器根据标题切换显示 */
.video-modal-body .video-placeholder.hidden,
.video-modal-body #video-player.hidden {
    display: none !important;
}

/* 视频播放器样式（预留） */
#video-player {
    width: 100%;
    max-width: 100%;
    height: auto;
    background-color: #000000;
    border-radius: 8px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .case-card {
        height: 300px;
    }

    .case-play-btn img {
        width: 60px;
        height: 60px;
    }

    .video-modal-content {
        width: 95%;
        margin: 20px;
    }

    .video-modal-header {
        padding: 20px;
    }

    .video-modal-header h3 {
        font-size: 1.2rem;
    }

    .video-modal-body {
        padding: 30px 20px;
        min-height: 300px;
    }

    .video-placeholder i {
        font-size: 48px;
    }
}