/* digital-library.css - 数字图书馆样式 */
/* 数字图书馆样式 - 保持党建网风格 */
.library-container {
    max-width: 1130px;
    margin: 0 auto;
    padding: 0px 0;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
}

.library-header {
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
    padding: 5px 20px 1px; /* 关键：底部内边距改为1px */
    background: #f9f9f9;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    min-height: 40px;
}

.library-header h2 {
    font-size: 20px;
    color: #c00;
    font-weight: bold;
    margin: 0 0 -5px 0; /* 关键：左边距为0 */
    width: 180px; /* 控制红色线长度 */
    margin: 0;
    padding: 0 0 5px 0; /* 关键：减小底部内边距 */
    line-height: 1;
    margin-left: 0; /* 明确设置左边距为0 */
    border-bottom: 3px solid #c00;
    /* 关键：负边距等于红色线厚度+1px */
    margin-bottom: -1px; /* 3px(红线) + 1px = 4px */
 margin-left: -20px;
}

.library-header h2::before {
    content: "📚";
    margin-right: 10px;
    font-size: 18px;
}

.library-tabs {
    display: flex;
    align-items: flex-end;
    margin-bottom: 2px; /* 关键：调整按钮位置 */
}
.library-tab-btn {
    display: inline-block;
    padding: 8px 20px;
    margin-left: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: 0;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
}

.library-tab-btn:hover {
    background: #e9e9e9;
}

.library-tab-btn.active {
    background: #fff;
    border-color: #c00;
    color: #c00;
    font-weight: bold;
    position: relative;
    top: 1px;
}

.library-content {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    padding: 0 20px;
}

.library-item {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.library-item:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(-8px);
    border-color: #c00;
}

.library-item img {
    width: 100%; /* 宽度缩小 */
    height: 200px;
    object-fit: contain;
    object-position: center;
    background-color: #f8f8f8;
    margin: 4px auto; /* 居中并添加外边距 */
    display: block;
    transition: all 0.5s ease;
}

.library-item:hover img {
    transform: scale(1.1); /* 悬停时放大 */
    width: 95%; /* 悬停时宽度增加 */
}
.library-item-title {
    padding: 12px 10px;
    text-align: center;
    font-size: 14px;
    color: #333;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
    transition: background 0.3s ease;
}

.library-item:hover .library-item-title {
    background: #f0f0f0;
    color: #c00;
}

.library-tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.library-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}