﻿.blog-container {
    width: 90%;
    margin: auto;
    overflow: hidden;
    max-width: 1200px;
}

h1 {
    font-size: 2rem;
}

.blog-overview {
    padding: 20px 0 20px 0;
}

    .blog-overview h2 {
        color: #333;
    }

    .blog-overview p {
        color: #666;
        margin-bottom: 10px;
    }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

    .card img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Ensures the image keeps its aspect ratio and fills the container */
    }
    .card video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.download-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
}

.card:hover .download-overlay, .card.active .download-overlay {
    display: flex;
}

.download-button {
    background-color: #007bff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

    .download-button:hover {
        background-color: #0056b3;
    }

/* 背景遮罩层 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

/* 模态框内容 */
.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 450px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease-in-out;
}

    /* 标题样式 */
    .modal-content h2 {
        margin-bottom: 15px;
        font-size: 24px;
        color: #333;
        line-height: 1.4;
    }

    /* 内容文字样式 */
    .modal-content p {
        font-size: 16px;
        color: #666;
        margin-bottom: 20px;
    }

/* 按钮样式 */
.modal button {
    background-color: rgba(0, 0, 0, 0.1);
    color: #fff;
    border: none;
    padding: 7px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

/* 关闭按钮（×）样式 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
}

/* Container for layout */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    gap: 15px; /* 间距适配 */
    width: 100%;
}

/* 分类按钮组样式 */
.filter-buttons {
    display: flex;
    flex-wrap: wrap; /* 支持多行排列 */
    gap: 10px;
}

.filter-button {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #f9f9f9;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .filter-button:hover {
        background-color: #e6e6e6;
    }

    .filter-button.active {
        background-color: #007bff;
        color: #fff;
        border-color: #007bff;
    }

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

    .pagination button {
        padding: 10px 20px;
        border: 1px solid #ccc;
        background-color: #fff;
        border-radius: 4px;
        cursor: pointer;
    }

        .pagination button:hover {
            background-color: #f0f0f0;
        }

    .pagination .page-num {
        margin: 0 15px;
        font-size: 1rem;
        color: #333;
    }

.gallery {
    background: #f4f4f4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 响应式设计：适应小屏幕设备 */
@media (max-width: 600px) {
    .modal-content {
        width: 90%; /* 在小屏幕上宽度调整为90% */
        padding: 15px;
    }

        .modal-content h2 {
            font-size: 20px; /* 标题字体大小适配小屏 */
        }

        .modal-content p {
            font-size: 14px; /* 内容字体大小适配小屏 */
        }

    .modal button {
        font-size: 14px; /* 按钮字体大小适配小屏 */
        padding: 8px 16px;
    }

    .close-btn {
        font-size: 26px; /* 关闭按钮适配小屏 */
    }
}

/* Loading screen styling */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Spinner animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Text styling */
#loading-screen p {
    margin-top: 20px;
    font-size: 18px;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* Main content styling */
#main-content {
    padding: 20px;
    text-align: center;
}

/* Media Queries for Mobile */
@media screen and (max-width: 768px) {
    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
}