/* 排行榜页专用样式 */
.ranking-container {
    margin-bottom: 30px;
}

.ranking-main {
    background: #fff;
    border: 1px solid #e9ecef;
    min-height: 600px;
}

/* 排行榜头部 */
.ranking-header {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.ranking-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.ranking-description {
    color: #666;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

/* 排行榜类型切换 */
.ranking-tabs {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.tab-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-item {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

.tab-item.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.tab-item:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* 排行榜内容 */
.ranking-content {
    padding: 30px;
}

.ranking-list {
    display: grid;
    gap: 15px;
}

.ranking-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.ranking-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #2c3e50;
    transform: translateY(-2px);
}

.ranking-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
    border-radius: 8px;
}

.ranking-number.top-3 {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.ranking-number.top-10 {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.ranking-number.normal {
    background: #f8f9fa;
    color: #666;
}

.book-cover {
    width: 60px;
    height: 80px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 20px;
}

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

.book-basic-info {
    flex: 0 0 300px;
    margin-right: 20px;
    overflow: hidden;
}

.book-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.book-category {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.book-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.book-stats span {
    white-space: nowrap;
}

.book-description {
    flex: 1;
    padding-left: 20px;
    border-left: 1px solid #e9ecef;
}

.description-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.description-text {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.ranking-change {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
}

.ranking-change.up {
    background: #e8f5e8;
    color: #27ae60;
}

.ranking-change.down {
    background: #fdeaea;
    color: #e74c3c;
}

.ranking-change.new {
    background: #fff3cd;
    color: #856404;
}

.ranking-change.same {
    background: #e2e3e5;
    color: #6c757d;
}

/* 主题样式 */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

.dark-theme .ranking-main {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.dark-theme .ranking-header {
    background: linear-gradient(135deg, #3a3a3a 0%, #2d2d2d 100%);
    border-color: #404040;
}

.dark-theme .ranking-title {
    color: #fff;
}

.dark-theme .ranking-tabs {
    border-color: #404040;
}

.dark-theme .tab-item {
    background: #404040;
    color: #e0e0e0;
    border-color: #555;
}

.dark-theme .tab-item.active {
    background: #555;
    border-color: #666;
}

.dark-theme .ranking-item {
    background: #3a3a3a;
    border-color: #555;
}

.dark-theme .ranking-item:hover {
    border-color: #666;
}

.dark-theme .ranking-number.normal {
    background: #404040;
    color: #e0e0e0;
}

.dark-theme .book-title {
    color: #fff;
}

.dark-theme .book-category {
    background: #404040;
    color: #ccc;
}

.dark-theme .book-description {
    border-color: #555;
}

.dark-theme .description-title {
    color: #fff;
}

.dark-theme .description-text {
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ranking-header {
        padding: 20px;
    }
    
    .ranking-title {
        font-size: 24px;
    }
    
    .ranking-tabs {
        padding: 15px 20px;
    }
    
    .tab-list {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .ranking-content {
        padding: 20px;
    }
    
    .ranking-item {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ranking-number {
        position: absolute;
        top: 10px;
        right: 60px;
        width: 30px;
        height: 30px;
        font-size: 14px;
        margin-right: 0;
    }
    
    .book-cover {
        width: 50px;
        height: 65px;
        margin-right: 15px;
    }
    
    .book-basic-info {
        flex: none;
        width: 100%;
        margin-right: 0;
        margin-top: 35px;
    }
    
    .book-title {
        font-size: 16px;
    }
    
    .book-stats {
        gap: 10px;
    }
    
    .book-description {
        flex: none;
        width: 100%;
        padding-left: 0;
        padding-top: 15px;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .ranking-change {
        top: 50px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .ranking-header {
        padding: 15px;
    }
    
    .ranking-tabs {
        padding: 10px 15px;
    }
    
    .ranking-content {
        padding: 15px;
    }
    
    .ranking-item {
        padding: 12px;
    }
    
    .book-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .book-stats span {
        display: block;
    }
}