/* 操作演示页面样式 */

/* 操作演示页面的header不固定 */
body.demo-page .header {
    position: relative;
    box-shadow: none;
    height: auto;
    z-index: 1;
}

body.demo-page {
    padding-top: 0;
}

/* 页面标题区 */
.demo-hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    padding: 60px 0 40px;
    text-align: center;
}

.demo-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.demo-hero h1 {
    font-size: 36px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.demo-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* 搜索和筛选区 */
.demo-filter {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

/* 只有当搜索和筛选区固定在顶部时才显示阴影 */
.demo-filter.sticky {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 搜索框 */
.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto 25px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: #00BC66;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 15px;
    outline: none;
    background: transparent;
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.search-btn:hover {
    color: #00BC66;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tab {
    padding: 10px 24px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.category-tab:hover {
    background: #e8f5e9;
    color: #00BC66;
}

.category-tab.active {
    background: #00BC66;
    color: #fff;
}

/* 视频列表区 */
.demo-content {
    padding: 40px 0 60px;
    background: #fafafa;
    min-height: 500px;
}

.video-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* 视频卡片 */
.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* 视频缩略图 */
.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* 播放按钮覆盖层 */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: #00BC66;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.video-card:hover .play-btn {
    transform: scale(1);
}

/* 视频时长 */
.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 视频信息 */
.video-info {
    padding: 20px;
}

.video-title {
    font-size: 16px;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.4;
}

.video-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-category {
    font-size: 12px;
    color: #00BC66;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 10px;
}

.video-views {
    font-size: 12px;
    color: #999;
}

/* 无结果提示 */
.no-results {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.no-results svg {
    margin-bottom: 20px;
}

.no-results p {
    font-size: 16px;
    margin-bottom: 20px;
}

.clear-search {
    padding: 10px 24px;
    background: #00BC66;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.clear-search:hover {
    background: #00a857;
}

/* 防止模态框打开时页面抖动 */
body.modal-open {
    overflow: hidden;
}

body.modal-open .header {
    padding-right: var(--scrollbar-width, 0px);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.video-modal {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s, color 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 0;
}

.modal-body.video-body {
    background: #000;
}

/* 视频播放器 */
.video-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-description {
    padding: 20px 25px;
    background: #fff;
}

.video-description p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .demo-hero {
        padding: 40px 0 30px;
    }
    
    .demo-hero h1 {
        font-size: 28px;
    }
    
    .demo-subtitle {
        font-size: 16px;
    }
    
    .demo-filter {
        top: 80px;
        padding: 20px 0;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .category-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .video-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .demo-hero h1 {
        font-size: 24px;
    }
    
    .search-box {
        margin-bottom: 20px;
    }
    
    .category-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .video-info {
        padding: 15px;
    }
    
    .video-title {
        font-size: 15px;
    }
}