/* 书籍展示网格样式 - 6列默认布局 */
.book-showcase-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 默认6列 */
    gap: 15px; /* 减小间距适应6列 */
    margin: 30px 0;
    padding: 0;
    list-style: none;
}

.book-item {
    break-inside: avoid;
    margin: 0;
}

.book-inner {
    background: #ffffff;
    border-radius: 8px; /* 减小圆角适应小尺寸 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 100%;
    border: 1px solid #f0f0f0;
}

.book-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.book-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: all 0.3s ease;
}

.book-link:hover {
    text-decoration: none;
    color: inherit;
}

.book-image {
    width: 100%;
    height: 180px; /* 减小高度适应6列 */
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-inner:hover .book-image img {
    transform: scale(1.05);
}

/* 无图片时的占位符 */
.book-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-placeholder {
    text-align: center;
    color: white;
}

.book-placeholder .dashicons-book-alt {
    font-size: 48px; /* 减小图标大小 */
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.book-content {
    padding: 12px; /* 减小内边距 */
}

.book-title {
    margin: 0 0 8px 0;
    font-size: 0.95em; /* 减小字体大小 */
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.book-author {
    margin: 0 0 10px 0;
    font-size: 0.85em; /* 减小字体大小 */
    color: #718096;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

.book-description {
    font-size: 0.8em; /* 减小字体大小 */
    color: #4a5568;
    line-height: 1.4;
    margin: 0;
}

/* 空状态提示 */
.book-showcase-empty {
    text-align: center;
    padding: 40px;
    background: #f7fafc;
    border-radius: 8px;
    color: #718096;
}

.book-showcase-empty p {
    margin: 0;
    font-size: 1.1em;
}

/* 响应式设计 - 针对6列优化 */
@media (max-width: 1600px) {
    .book-showcase-grid {
        grid-template-columns: repeat(5, 1fr); /* 大屏幕5列 */
    }
}

@media (max-width: 1400px) {
    .book-showcase-grid {
        grid-template-columns: repeat(4, 1fr); /* 中等屏幕4列 */
    }
}

@media (max-width: 1200px) {
    .book-showcase-grid {
        grid-template-columns: repeat(3, 1fr); /* 小屏幕3列 */
    }
}

@media (max-width: 992px) {
    .book-showcase-grid {
        grid-template-columns: repeat(2, 1fr); /* 平板2列 */
        gap: 12px;
    }
    
    .book-image {
        height: 200px;
    }
    
    .book-content {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .book-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .book-image {
        height: 180px;
    }
    
    .book-content {
        padding: 12px;
    }
    
    .book-title {
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .book-showcase-grid {
        grid-template-columns: 1fr; /* 手机1列 */
        gap: 10px;
    }
    
    .book-image {
        height: 200px;
    }
    
    .book-content {
        padding: 15px;
    }
    
    .book-title {
        font-size: 1em;
    }
}

/* 自定义列数样式 */
.book-showcase-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.book-showcase-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.book-showcase-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.book-showcase-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.book-showcase-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.book-showcase-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .book-inner {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .book-title {
        color: #e2e8f0;
    }
    
    .book-author {
        color: #a0aec0;
        border-color: #4a5568;
    }
    
    .book-description {
        color: #cbd5e0;
    }
}