/* 自定义样式 */
.mr-2 { margin-right: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* 书籍网格布局 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

@media screen and (max-width: 1024px) {
    .book-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 书籍卡片 */
.book-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-cover {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 133.33%; /* 3:4 比例 */
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #363636;
    line-height: 1.4;
    min-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.book-title:hover {
    color: #3273dc;
}

.book-author {
    display: block;
    font-size: 12px;
    color: #7a7a7a;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author:hover {
    color: #3273dc;
}

.book-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: auto;
}

.book-meta .tag {
    font-size: 11px;
}

/* 分页 */
.pagination-custom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* 详情页布局 */
.detail-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.cover-box {
    width: 220px;
    flex-shrink: 0;
}

.cover-box .book-cover {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.detail-content {
    flex: 1;
    min-width: 0;
}

@media screen and (max-width: 768px) {
    .detail-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .cover-box {
        width: 180px;
    }
    
    .detail-content {
        width: 100%;
        text-align: center;
    }
    
    .detail-content .tags {
        justify-content: center;
    }
}

/* 标签悬停效果 */
.tags a.tag:hover {
    opacity: 0.8;
}

/* 面包屑 */
.breadcrumb-box {
    background: #f5f5f5;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* 简介区域 */
.description-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #00d1b2;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-top: 1.5rem;
}

/* 相似小说区域 */
.similar-section {
    margin-top: 1.5rem;
}

/* Hero区域 */
.hero a.has-text-white:hover {
    opacity: 0.9;
}

.hero .subtitle {
    color: rgba(255,255,255,0.8);
}

/* 小卡片网格（用于相似小说） */
.book-grid-small {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    width: 100%;
}

@media screen and (max-width: 1200px) {
    .book-grid-small {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .book-grid-small {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media screen and (max-width: 480px) {
    .book-grid-small {
        grid-template-columns: repeat(2, 1fr);
    }
}

.book-grid-small .book-title {
    font-size: 13px;
    min-height: 2.6em;
}

.book-grid-small .book-info {
    padding: 10px;
}

/* 修复 Bulma box 内的布局 */
.box {
    overflow: visible;
}

/* 书籍排名徽章 */
.book-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.book-rank:nth-child(1) { background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%); }

.book-card:nth-child(1) .book-rank { background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%); }
.book-card:nth-child(2) .book-rank { background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%); }
.book-card:nth-child(3) .book-rank { background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%); }

/* 评论列表 */
.comments-list .media {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.comments-list .media:last-child {
    margin-bottom: 0;
}

.comments-list .image img {
    object-fit: cover;
}
@media screen and (min-width: 769px) {
    .sidebar-box {
        position: sticky;
        top: 20px;
    }
}


/* 侧边栏固定 */
@media screen and (min-width: 769px) {
    .sidebar-box {
        position: sticky;
        top: 20px;
    }
}
