/* 统一的图书卡片样式 - 基于热门借阅页面的优秀设计 */
.books-grid {
    display: grid;
    /* 强制改为 4 列 */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.8rem;
}

.book-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
}

.book-cover {
    width: 100%;
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-details {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--primary-blue);
    line-height: 1.3;
}

.book-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.book-description {
    font-size: 0.9rem;
    color: var(--dark-gray);
    flex: 1;
    margin-bottom: 0.8rem;
    min-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.book-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.book-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.status-available {
    background: var(--success-green);
    color: white;
}

.status-borrowed {
    background: var(--warning-yellow);
    color: white;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-favorite {
    background: var(--light-gray);
    color: var(--text-primary);
}

.btn-favorite:hover {
    background: var(--accent-blue);
    color: white;
}

.btn-borrow {
    background: var(--primary-blue);
    color: white;
}

.btn-borrow:hover {
    background: var(--secondary-blue);
}

.btn-borrow:disabled {
    background: var(--light-gray);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* 借书申请等待审核状态 */
.btn-borrow.btn-pending {
    background: #F59E0B !important;
    color: white !important;
    cursor: wait !important;
    animation: pulse-btn 1.5s infinite;
}

.btn-borrow.btn-pending:hover {
    transform: none !important;
}

@keyframes pulse-btn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 中屏 3 列 */
    }
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .book-title {
        font-size: 1rem;
    }
    
    .book-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}