/* static\css\bookdetail.css */
/* ==================== 書籍詳情頁專用樣式 ==================== */

/* 書籍封面 */
.detail-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

/* 書籍資訊卡片 */
.detail-info-card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
	height: 100%;
}

.detail-info-card .card-body {
    padding: 1.25rem;
}

.detail-info-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
}

.detail-info-card .card-text {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 固定高度的簡介卡片 - 300px */
.intro-fixed {
    height: 300px !important;
}

.intro-fixed .card-header {
    padding: 0.5rem 1rem;
}

.intro-fixed .card-header h5 {
    font-size: 1.1rem;
    margin: 0;
}

.intro-fixed .card-body {
    height: calc(100% - 48px);
    overflow-y: auto;
    padding: 0.75rem 1rem;
}

.intro-fixed .card-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 作者卡片 - 300px */
.author-card {
    height: 300px !important;
}

.author-card .card-body {
    padding: 1.5rem !important;
}

.author-card h5 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.author-card .badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
}

.author-card .h5 {
    font-size: 1.3rem;
    font-weight: 600;
}

.author-card small {
    font-size: 0.8rem;
}

/* 廣告位卡片 */
.ad-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #dee2e6;
}

.ad-content i {
    opacity: 0.5;
}

/* 粉絲榜卡片 */
.fan-rank-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fan-rank-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 12px;
    font-weight: bold;
    font-size: 14px;
}

.fan-rank-header i {
    font-size: 14px;
    margin-right: 4px;
}

.fan-rank-header small {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 6px;
    font-weight: normal;
}

.fan-rank-list {
    flex: 1;
    max-height: 280px;
    overflow-y: auto;
    padding: 0;
}

.fan-rank-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.fan-rank-item:hover {
    background: #f8f9fa;
}

.fan-rank-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
    flex-shrink: 0;
}

.fan-rank-item.rank-1 .fan-rank-number {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: white;
}

.fan-rank-item.rank-2 .fan-rank-number {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: white;
}

.fan-rank-item.rank-3 .fan-rank-number {
    background: linear-gradient(135deg, #cd7f32, #b06d28);
    color: white;
}

.fan-avatar {
    flex-shrink: 0;
}

.fan-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.fan-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.fan-name {
    font-weight: 500;
    font-size: 13px;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fan-badge {
    font-size: 10px;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fan-value {
    font-weight: bold;
    font-size: 12px;
    color: #dc3545;
    flex-shrink: 0;
    white-space: nowrap;
}

.fan-rank-footer {
    padding: 8px 12px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.fan-rank-footer a {
    color: #6c757d;
    font-size: 12px;
}

.fan-rank-footer a:hover {
    color: #0d6efd;
}

/* 響應式 */
@media (max-width: 992px) {
    .fan-rank-item {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .fan-rank-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .fan-avatar img {
        width: 24px;
        height: 24px;
    }
    
    .fan-name {
        font-size: 12px;
    }
    
    .fan-badge {
        font-size: 9px;
    }
    
    .fan-value {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .fan-rank-card {
        margin-top: 1rem;
    }
    
    .ad-card {
        margin-bottom: 1rem;
        min-height: auto;
    }
}

/* ==================== 章節列表 ==================== */

.chapter-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chapter-header {
    background: transparent;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-header h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chapter-header .badge {
    background: #e9ecef;
    color: #495057;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

/* 章節項目 */
.chapter-item-compact {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.25rem;  
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background-color 0.15s ease;
}

.chapter-item-compact:hover {
    background-color: #f8f9fa;
}

.chapter-index {
    min-width: 55px;
    font-size: 0.85rem;
    color: #64748b;
}

.chapter-title {
    flex: 1;
    min-width: 0;
    margin-right: 0.75rem;
}

.chapter-title a {
    display: block;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-title a:hover {
    color: #0d6efd !important;
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chapter-meta .badge {
    font-weight: normal;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.chapter-meta .badge.bg-success {
    background: #d1e7dd !important;
    color: #0f5132;
}

.chapter-meta .badge.bg-warning {
    background: #fff3cd !important;
    color: #856404;
}

.chapter-meta .word-count {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* 章節列表容器 - 統一 */
.chapter-list-container {
    max-height: 500px;  
    overflow-y: auto;  
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* 自定義滾動條 */
.chapter-list-container::-webkit-scrollbar {
    width: 8px;  
}

.chapter-list-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.chapter-list-container::-webkit-scrollbar-thumb {
    background: #94a3b8; 
    border-radius: 4px;
}

.chapter-list-container::-webkit-scrollbar-thumb:hover {
    background: #64748b;  
}

/* 分頁 */
.chapter-pagination {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 1.25rem;
}

.pagination-sm .page-link {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.pagination-sm .page-item.active .page-link {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 空狀態 */
.empty-chapters {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: #94a3b8;
}




/* 響應式 */
@media (max-width: 768px) {
    .chapter-index {
        min-width: 45px;
        font-size: 0.75rem;
    }
    
    .chapter-title a {
        font-size: 0.85rem;
    }
    
    .chapter-meta .badge {
        display: none;
    }
}