/* 自定义宽度类，宽度调整为 95% 并居中 */
.custom-width {
    width: 95%;
    margin: 0 auto;
}

/* 主体内容区域，统一对齐 */
.main-container {
    width: 95%;
    margin: 0 auto;
    max-width: 1400px;
}

@media (max-width: 768px) {
    /* 移动端素材展示部分样式调整 */
    .custom-width, .main-container {
        width: 100%;
        padding: 0 1rem;
    }
    /* 移动端搜索框与素材展示区添加间距 */
    .search-to-material {
        margin-top: 1.5rem;
    }
    /* 隐藏桌面端翻页样式，显示移动端样式 */
    .elemNone {
        display: none;
    }
    .elemMobile {
        display: flex;
    }
    
    /* 确保移动端素材图片容器使用百分比控制高度 */
    .material-card .overflow-hidden {
        position: relative;
        padding-bottom: 56.25%; /* 16:9的纵横比 */
        height: 0;
        width: 100%;
        overflow: hidden;
    }
    
    /* 图片元素填充容器 */
    .material-card img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* 翻页样式 - 参考图片重新设计 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.pagination-button {
    border: 1px solid #e5e7eb;
    background-color: #fff;
    color: #333;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    min-width: 2rem;
    text-align: center;
}

.pagination-button:hover {
    background-color: #f3f4f6;
}

.pagination-button.active {
    background-color: #1e88e5; /* 蓝色 */
    color: white;
    border-color: #1e88e5;
}

.pagination-button.disabled,
.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

.pagination-ellipsis {
    padding: 0.3rem 0.4rem;
    color: #666;
}

.pagination-info {
    color: #6b7280;
    margin: 0 0.4rem;
    font-size: 0.8rem;
}

.el-pagination__jump {
    margin-left: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.el-input__inner {
    border: 1px solid #e5e7eb;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    width: 2.5rem;
    text-align: center;
    font-size: 0.8rem;
}

.el-input__inner:focus {
    outline: none;
    border-color: #1e88e5;
}

.elemNone {
    display: flex;
}

.elemMobile {
    display: none;
}

/* 移动端翻页样式 */
@media (max-width: 768px) {
    .elemNone {
        display: none;
    }
    
    .elemMobile {
        display: flex;
    }
    
    .mobile-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
    }
    
    .mobile-page-button {
        width: 1.8rem;
        height: 1.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 0.8rem;
        border: 1px solid #e5e7eb;
        background-color: #fff;
        color: #333;
        border-radius: 0.25rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-page-button:hover {
        background-color: #f3f4f6;
    }
    
    .mobile-page-button.active {
        background-color: #1e88e5;
        color: white;
        border-color: #1e88e5;
    }
    
    .mobile-page-button.disabled,
    .mobile-page-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background-color: #f9f9f9;
    }
}

/* 美化素材卡片 - 再次尝试修复布局 */
.material-card {
    /* display: flex; */ /* Revert flex for now, rely on block layout */
    /* flex-direction: column; */
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 强制图片容器的宽高比 (16:9) */
#materialList .material-card .overflow-hidden {
    display: block; /* Ensure block behavior */
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background-color: #f0f0f0; /* Loading background */
    overflow: hidden; /* Ensure overflow is hidden */
}

/* 确保图片绝对定位并覆盖容器 */
#materialList .material-card .overflow-hidden img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crucial for aspect ratio */
    border-style: none; /* Remove potential borders */
    transition: transform 0.5s ease;
}

/* 图片悬停效果 */
#materialList .material-card:hover .overflow-hidden img {
     transform: scale(1.10);
}

/* 卡片标题区域 */
#materialList .material-card .p-3 {
     padding: 0.5rem;
}

/* 卡片标题样式 */
#materialList .material-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    text-align: center !important;
    margin: 0;
}

/* 导航栏美化 */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3182ce;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* 美化分类选择 */
.category-tag {
    transition: all 0.3s ease;
}

.category-tag:hover {
    transform: scale(1.05);
}

/* 弹窗容器样式 */
.modal-container {
    transition: opacity 0.3s ease-out;
    /* 添加默认透明度为0，确保隐藏状态下不可见 */
    opacity: 0; 
}

/* 当弹窗容器激活时，使其完全可见 */
.modal-container.active {
    opacity: 1;
}

/* 弹窗内容 */
.modal-content {
    transform: translateY(-50px);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* 同时过渡 transform 和 opacity */
    opacity: 0; 
}

/* 当弹窗容器激活时，内部内容恢复原位并可见 */
.modal-container.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* 素材展示网格的间距 */
.material-grid {
    gap: 1.5rem;
}

/* 移动端卡片样式 */
@media (max-width: 768px) {
    #materialList .material-card {
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    #materialList .material-card:hover {
        transform: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    /* 调整移动端图片容器宽高比为 4:3 */
    #materialList .material-card .overflow-hidden {
        padding-bottom: 75%; /* Increase height ratio */
    }

    /* Mobile image already absolute from general rule */
    
    #materialList .material-card:hover .overflow-hidden img {
        transform: none; /* Disable zoom on mobile */
    }

    #materialList .material-card .p-3 {
        padding: 0.5rem;
    }
    
    #materialList .material-card h3 {
        font-size: 0.8rem;
        font-weight: 600;
        text-align: center !important;
        color: #333;
        margin: 0;
        margin-top: 0.25rem;
    }

    /* Keep rules for hiding elements on mobile */
    .material-card .mt-2,
    .material-card .justify-between {
        display: none;
    }

    /* 调整移动端版权标签样式 */
    .copyright-tag {
        font-size: 0.6rem; /* Smaller font */
        padding: 0.1rem 0.3rem; /* Smaller padding */
        opacity: 0.8; /* Add transparency */
        top: 2px; /* Keep position for now */
        left: 2px; /* Keep position for now */
    }
}

.material-card .mt-2 {
    display: none;
}

/* 移动端调整素材日期和浏览量的间距 */
.material-card .justify-between {
    display: none;
}

.copyright-tag {
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 10;
    background-color: #ff4500;
    color: white;
    font-size: 0.75rem; /* Base font size */
    padding: 0.25rem 0.5rem; /* Base padding */
    border-radius: 0.25rem;
    display: block; /* 确保始终显示 */
}

.material-card .overflow-hidden {
    position: relative; /* 确保内部定位元素能正确显示 */
}

/* ================== Pagination Styles Start ================== */
.pagination-nav ul {
    display: inline-flex;
    align-items: center;
    /* Simulates -space-x-px */
    margin-left: 1px; 
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
}

.pagination-nav li {
    /* Simulates -space-x-px */
    margin-left: -1px;
}

.pagination-link,
.pagination-current,
.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.75rem; /* px-3 */
    padding-right: 0.75rem; /* px-3 */
    height: 2rem; /* h-8 */
    line-height: 1.25rem; /* leading-tight */
    border: 1px solid #d1d5db; /* border-gray-300 */
    background-color: #ffffff; /* bg-white */
    color: #6b7280; /* text-gray-500 */
    text-decoration: none;
}

.pagination-link:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
    color: #374151; /* hover:text-gray-700 */
}

.pagination-link.prev {
    margin-left: 0; /* ms-0 */
    border-top-left-radius: 0.5rem; /* rounded-s-lg */
    border-bottom-left-radius: 0.5rem; /* rounded-s-lg */
    border-right-width: 0; /* border-e-0 */
}

.pagination-link.next {
    border-top-right-radius: 0.5rem; /* rounded-e-lg */
    border-bottom-right-radius: 0.5rem; /* rounded-e-lg */
}

.pagination-link.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.pagination-current {
    z-index: 10;
    color: #2563eb; /* text-blue-600 */
    border-color: #93c5fd; /* border-blue-300 */
    background-color: #eff6ff; /* bg-blue-50 */
}

.pagination-current:hover {
     background-color: #dbeafe; /* hover:bg-blue-100 */
     color: #1d4ed8; /* hover:text-blue-700 */
}

/* Optional: Style for the ellipsis */
.pagination-ellipsis {
    /* Keep default styles, maybe adjust padding/color if needed */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ================== Pagination Styles End ================== */ 

/* Hide Download Button in Modal */
#downloadButtonWrapper {
    display: none !important;
} 