/* 默认样式 */
body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-family: Arial, sans-serif;
}

/* header-container 样式保持不变 */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 8%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1200px; /* 最大宽度与 layui-container 保持一致 */
    margin: 0 auto;
    padding: 0 20px; /* 左右内边距 */
    box-sizing: border-box;
}

/* 状态按钮组样式 */
.status-group {
    display: flex;
    gap: 10px;
}

.status-button {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background-color: #ddd;
    color: #333;
    transition: background-color 0.3s;
}

.status-button.active,
.status-button:hover {
    background-color: #bbb;
}

.search-bar {
    position: relative;
    height: 50px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 45%;
}

.search-bar input {
    flex: 1;
    border: none;
    height: 100%;
    padding-left: 50px;
    font-size: 18px;
    outline: none;
    background-color: transparent;
}

.search-bar i {
    position: absolute;
    left: 15px;
    font-size: 22px;
    color: #aaa;
}

.search-bar button {
    position: absolute;
    right: 10px;
    height: 35px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background-color: #ddd;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #bbb;
}

/* 大于等于 1400px 屏幕宽度（超大屏幕设备，如大型桌面显示器） */
@media (min-width: 1400px) {
    .header-container {
        max-width: 1350px;
    }
    .search-bar {
        width: 35%; /* 更大屏幕上搜索框占 35% */
    }
}

/* 大于等于 1200px 屏幕宽度（标准桌面设备） */
@media (max-width: 1399px) and (min-width: 1200px) {
    .header-container {
        max-width: 1170px;
    }
    .search-bar {
        width: 40%; /* 中大屏幕时搜索框占 40% */
    }
}

/* 大于等于 992px 屏幕宽度（中等桌面设备） */
@media (max-width: 1199px) and (min-width: 992px) {
    .header-container {
        max-width: 980px;
    }
    .search-bar {
        width: 45%; /* 搜索框占 45% */
    }
}

/* 小于 992px 屏幕宽度（平板和小屏幕设备） */
@media (max-width: 991px) {
    .header-container {
        position: relative;
        margin-top: 10%;
        flex-direction: column; /* 垂直排列 */
        align-items: center;    /* 居中显示 */
        padding: 20px 0;
    }

    /* 搜索框样式 */
    .search-bar {
        width: 90%;          /* 搜索框宽度为90% */
        max-width: 400px;    /* 最大宽度 */
        margin-bottom: 10px; /* 搜索框和状态按钮之间的间距 */
        order: 1;            /* 保证搜索框排在按钮组上方 */
    }

    /* 状态按钮样式 */
    .status-group {
        display: flex;
        justify-content: center; /* 居中显示按钮 */
        gap: 10px;
        width: 100%;              /* 状态按钮宽度占满 */
        order: 2;                 /* 保证按钮在搜索框下方 */
    }

    .status-button {
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 5px;
        border: none;
        cursor: pointer;
        background-color: #ddd;
        color: #333;
        transition: background-color 0.3s;
    }

    .status-button.active,
    .status-button:hover {
        background-color: #bbb;
    }
}

/* 小于 768px 屏幕宽度（手机屏幕） */
@media (max-width: 767px) {
    .header-container {
        padding: 12px 8px;
    }

    .search-bar {
        width: 100%;
        max-width: 280px; /* 最大宽度设置为 280px，避免太宽 */
        margin-bottom: 10px; /* 添加底部间距 */
    }

    .status-group {
        display: flex;
        justify-content: center; /* 居中显示按钮 */
        gap: 6px;
        width: 100%; /* 确保按钮宽度占满 */
    }

    .status-button {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* 小于 480px 屏幕宽度（手机屏幕） */
@media (max-width: 479px) {
    .header-container {
        padding: 10px 5px;
    }

    .search-bar {
        width: 100%;
        max-width: 240px;
        margin-bottom: 10px;
    }

    .status-group {
        display: flex;
        justify-content: center;
        gap: 4px;
        width: 100%;
    }

    .status-button {
        font-size: 10px;
        padding: 5px 8px;
    }
}





/* 项目列表 */
.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* 自适应列数 */
    gap: 20px;
    padding: 20px;
    justify-items: center;
    margin-top: 12%; /* 与搜索框的间距 */
}

.project-container .default-image {
    grid-column: 1 / -1; /* 占满整个网格宽度 */
    width: 100%;
    height: 100%;
    object-fit: cover; /* 适应容器大小 */
    display: block; /* 默认显示 */
}

/* 项目卡片样式 */
.project-item {
    width: 100%;
    overflow: hidden;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer; /* 鼠标指针变为手型 */
}

.project-item:hover {
    transform: scale(1.03); /* 悬停时稍微放大 */
}

.project-item img {
    width: 100%;
    height: 150px; /* 固定高度，保持项目卡片高度一致 */
    object-fit: contain; /* 显示图片完整内容，不裁剪 */
    background-color: #f0f0f0; /* 加个背景色，防止图片比例不一致时留白 */
    display: none; /* 默认隐藏，懒加载时显示 */
}

/* 占位文字样式 */
.no-image {
    width: 100%;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #eee;
    color: #999;
    font-size: 14px;
    border-radius: 8px 8px 0 0;
}

.project-item h3 {
    font-size: 14px;
    margin: 10px;
    color: #333;
    padding: 0 5px;
}

/* 没有数据时显示的提示 */
.no-data {
    text-align: center;
    color: #999;
    font-size: 18px;
    margin-top: 20px;
}

#pagination {
    text-align: center;
    margin-top: 20px;
    display: none;
}

/* 小屏幕下列表改为两列 */
@media (max-width: 991px)  {
    .project-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 设置为两列 */
        gap: 10px;
        padding: 10px;
        margin-top: 1%; /* 调整搜索框与项目列表间距 */
    }

    .project-item {
        width: 100%;
    }

    .search-bar {
        position: relative;
        width: 100%;
        margin-top: 15px; /* 保证搜索框与其他内容的间距 */
    }
}
